Trouble getting program uploaded/J-link rules issue

Hello - I’m just getting started with the HiFive1 RevB board, was able to successfully see the welcome banner and have installed both the freedom_e_sdk and Freedom Studio environments. However, I’m getting stuck on the part that discusses the Upload step using make (page 21 of the Getting Started guide for Rev B). This is the error message I keep getting:

Now, if I switch to using Freedom Studio, I can confirm I get a similar issue which is below (no J-Link connection established):

“J-Link GDB Server failed: Could not connect to J-Link. Please check if plugged into USB port or Ethernet switch”

Can anyone share how they got past this? My 99-jlink.rules file is bare minimum (I only put in the line in the getting started guide to get the USB port to correctly recognize the device and see the welcome output message):

SUBSYSTEM=“tty”, ATTRS{idVendor}=“1366”, ATTRS{idProduct} = “1051”, MODE=“664”, GROUP=“plugdev”
LABEL=“jlink_rules_end”

Do I need to add anything further? Thanks for the insights!

When I was getting started with the HiFive, it only supported the Olimex. Are you sure your device is supported?

Thanks, Donnie. It seemed based on the Make sequence that I should be able to upload a simple ‘Hello World’ program on to the board - that is where I’m stuck. I can compile programs but can’t actually get anything accomplished aside from the Welcome banner that the board came with. How was your experience trying to upload a program? Thanks!

Anybody from SiFive can help shed light on this, please? Thanks.

Check the udev rules as described in the Freedom Studio Manual (Help → Open Freedom Studio Manual). There is a section titled “Let’s Check our Dependencies” that might be helpful. Segger will automatically install the udev rules so that Linux will recognize your device, if you install the latest JLink Software.

Thanks, once we do a new install of Jlink software, are we to copy in the 99-rules.patch that comes with it into /etc/udev/rules.d/99-jlink.rules?

I don’t think you’ll need to do that. After you install the Segger software, try 'lsusb` on the command line to make sure you see something like this:

Bus 001 Device 005: ID 1366:1061 SEGGER

Assuming that udev rules are relevant at all here… (I don;t know)

If you try to use the jlink as root/su does it work?
If so then perhaps you need to add the user to the plugdev group?

It seems to me that everyone is working in the dark as the OP hasn’t described their computer setup.

My setup is Ubuntu 20.04 running in an Oracle VM on my Windows machine. USB is mounted, and querying lsusb both before and after the Segger software, I consistently can see my HiFive1 RevB board as follows:

Bus 001 Device 030: ID 1366:1051 SEGGER J-Link

I already have these Unix groups (including plugdev and dialout):

adm dialout cdrom sudo dip plugdev lpadmin lxd sambashare

I haven’t done anything more to the jlink rules other than have this line in it:

SUBSYSTEM=“tty”, ATTRS{idVendor}=“1366”, ATTRS{idProduct} = “1051”, MODE=“664”, GROUP=“plugdev”
LABEL=“jlink_rules_end”

The only thing I’ve been able to accomplish is successfully see the SiFive Welcome banner by doing a ‘sudo screen /dev/ttyACM0’ and verify it is displaying properly.

Thanks.

Currently we do not test on or officially support a VM setup within Windows unfortunately. Would it be possible for you to try it natively on your Windows machine?

Hi David, if I try this in Windows (Freedom Studio), I get the same error saying connection to J-Link via US failed. If I’m in a Windows environment, aside from Freedom Studio, I do not know how else I can successfully try running the sample programs (like Hello World). Separately, I’ve tried doing a drag/drop of a .hex file as well (I started a separate thread on that), but the unit seems to disconnect immediately when I try to drop in a .hex file. Any ideas why that would be? Thanks.

Can you let us know what version of board to you have (B00/B01)? Also did you just buy this board recently? In Windows Device Manager you should see two COMx ports (JLink CDC UART Port) and a USB Mass Storage Device. Are these visible when the board is plugged in?

There is a recovery mechanism if you press reset, wait for the green LED, then quickly press reset again. The LED will then blink red and you should be able to drag and drop a new HEX file.

Hi David, thank you. For the first time, I think I’m getting some forward progress here. After ditching the VM environment in Ubuntu on a Windows platform (thanks for confirming not to try with it as it’s not been qualified), I switched to a pure Windows 10 environment. I’m using Freedom Studio, and here’re my notes:

  1. I downloaded from the Segger Jlink site the latest updates for Windows 10 specifically (all this while, I had been spending my efforts on Ubuntu inside a VM and was getting nowhere).
  2. I rebooted the PC and immediately in Device Manager, I can see this now (COM5 & COM6 are listed as Jlink ports)

image

I see a USB Mass storage device as well under “Universal Bus Controller Devices” as well as “Segger MSD Volume USB Device” under “Disk Drives”

Thanks for telling me about the recovery mechanism - I did not know that. Now, in Freedom Studio, when I start a new SDK project, am I to always make sure the board is in the “recovery state” (blinking red) LED before I tell it to get to the “Debug” stage where it opens up a COM6 connection to display the output?

I think this is the furthest I’ve been able to get to in many days. This board was recently purchased and delivered by Crowd Supply (it is a HiFive 1 Rev B01 board). Thanks, I think I’m almost there - I just don’t know how to consistently be able to see output in the Debug terminal every time I want to run a sample program (“Hello World”, “Welcome” etc).

Hi @dconn , if I wanted to drag and drop programs in succession, what’s the correct sequence to follow - am I to first put the board in recovery state (LED blinking red), drag in the .hex file for the 1st program, check its output on the terminal, and then power off the board to do further drag & drops, or just press the reset button to put the board out of recovery state each time I’ve dragged and dropped in a .hex file? Thanks.

The recovery state is usually only necessary when you have a bad program that does not allow a debugger to connect, for instance. If you are able to download and establish a debug connection with Freedom Studio you should be able to see the COMx window output (within FS) when it’s configured for 115200 8N1 (which should be the default).