Can't program my HiFive1 board

Board comes up just fine. Attaching to the /dev/ttyUSB1 via screen /dev/ttyUSB1 115200 works per the getting started docs. I see the logo display, enter ‘y’, and it says ‘PASS’.

I can compile the programs but uploading fails. Both at command line and via arduino ui. Here’s a sample session:

scherrey@squire:~/develop/risc-v/freedom-e-sdk$ lsusb
Bus 006 Device 002: ID 8087:8001 Intel Corp.
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 002: ID 8087:8009 Intel Corp.
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 093a:2521 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 002: ID 0566:3067 Monterey International Corp.
Bus 001 Device 004: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

scherrey@squire:~/develop/risc-v/freedom-e-sdk$ dir /dev/ttyUS*
crw-rw-r-- 1 root plugdev 188, 0 Jan 2 23:22 /dev/ttyUSB0
crw-rw-r-- 1 root plugdev 188, 1 Jan 2 23:34 /dev/ttyUSB1

scherrey@squire:~/develop/risc-v/freedom-e-sdk$ groups
scherrey adm dialout cdrom sudo dip plugdev lpadmin sambashare docker

scherrey@squire:~/develop/risc-v/freedom-e-sdk$ make upload PROGRAM=dhrystone BOARD=freedom-e300-hifive1
/home/scherrey/develop/risc-v/freedom-e-sdk/bsp/tools/openocd_upload.sh /home/scherrey/develop/risc-v/freedom-e-sdk/software/dhrystone/dhrystone /home/scherrey/develop/risc-v/freedom-e-sdk/bsp/env/freedom-e300-hifive1/openocd.cfg

  • openocd -f /home/scherrey/develop/risc-v/freedom-e-sdk/bsp/env/freedom-e300-hifive1/openocd.cfg -c ‘flash protect 0 64 last off; program /home/scherrey/develop/risc-v/freedom-e-sdk/software/dhrystone/dhrystone verify; resume 0x20400000; exit’
  • tee openocd_upload.log
    Open On-Chip Debugger 0.10.0-dev-g193f630 (2017-01-02-22:38)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    adapter speed: 10000 kHz
    Info : auto-selecting first available session transport “jtag”. To override use 'transport select '.
    Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
    Error: no device found
    Error: unable to open ftdi device with vid 0403, pid 6010, description ‘Dual RS232-HS’, serial ‘’ at bus location '

scherrey@squire:~/develop/risc-v/freedom-e-sdk$

Any ideas?

Post retracted.

Same error message with mine. Try sudo.
See my post in HiFive1 Getting Started Guide and Other Docs are available! for more details.

1 Like

I had the same symptoms, but I just tried again until it worked. Later I discovered that the USB cable I used is marginal, but I haven’t checked if it another worked better.

Bit of a longshot, but adding a user to a group requires them to log out and back in again to pick up the new permissions. Could that have been what happened to you?

That probably needs to be noted in the Getting Start guide.

You don’t have to log out. Just run newgrp to gain access to the group.

1 Like

I logged out and back in as documented in the Getting Started Guide. But I need sudo to upload a program.

I’m using a fresh Ubuntu in VMware as I reported in HiFive1 Getting Started Guide and Other Docs are available!.

I got the same result. Rebooted the host computer completely. I can access the ttyUSB just fine as my regular user but I still require sudo to actually upload the program. Happily I can now program my SiFive - but I’m curious why it requires root privileges to upload.

many thanx!

– Ben Scherrey

Interesting, it is kind of the opposite on arch linux. I was able to upload programs to my hifive1 without sudo without adding myself to a group. Accessing the ttyUSB device did require root privs however (such as when connecting with GNU screen). Arch gives it the group uucp, so after adding myself to that group I don’t need sudo for anything at all when working with the hifive1. No special udev rules or anything

1 Like

I noticed that there’s actually a typo in the Getting Started Guide’s udev rules code snippet. The word “SUSBSYSTEM” should actually be “SUBSYSTEM” (this occurs twice in the snippet). If you fix that typo, then I believe you should be able to run make upload without sudo.

Sorry for all the confusion this caused; I’ll update the guide shortly.

Now I can upload without sudo. Thanks!

Hi,
Probably is not the right thread, but instead of opening one, this is somewhat related.
I cannot per the getting started/freedom studio manual communicate with the board using screen.
I am in the plugdev group in my work station, but when I type
screen /dev/ttyUSB1 115200

I don’t see anything at all back. I was expecting to see tha HiFive Logo somewhere which is not the case. I’ll appreciate your help on this. Thanks,

When you provide power to the board, do you see the RGB LED cycling through a fade pattern (this is a check to make sure it is running the demo SW).

Yes, I do see the color pattern. Furthermore, lsusb gives me

Bus 002 Device 009: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC

Thanks,

Once you connect with screen, do you press the RESET button? The message only appears just after RESET.

ok, got it! Somehow it was not evident from the instructions that I had to press RESET :grin:

Thanks, @mwachs5!

Yes, I was also baffled by this. In hindsight, it makes sense. Would be good to include pressing the RESET button in the documentation IMHO…