New HiFive cannot connect to console over usb

Hi Dale, sorry about that. Do you want to do what the others here have done in the meantime, or wait for a more official solution?

If you donā€™t have the boot-loader but just go straight to the app, and the app is buggy, you can brick the board enough that JTAG is the only way to recover.

Is it possible to fix the bootloader from Freedom Studio?

Hi Bruce and thanks for your help. I managed to install the boot where it should be, and now it loads the led_fade program from the right address (0x20400000) and I now see the banner at startup and then I see the led changing color. Again, thanks for you help.

R/Egil

1 Like

How about if the bootloader finds itself loaded at 0x20400000, it relocates itself to 0x20000000? That way any of the standard tools to load a program will work to load/repair a new bootloader.

That doesnā€™t work, because in that case the bootloader would need to contain code to program the flash which is quite a complex process.

Here is my canned procedure to program the flash:

cd freedom-e-sdk
curl http://hoult.org/flash_bootloader.sh | sh

Thanks for the informative shell script. However, it wonā€™t run on my platform (Mac). ā€œmake toolsā€ fails to find ā€œriscv-gnu-toolchain/configureā€.

Iā€™ve installed FreedomStudio, and used it to successfully load/debug the ā€œled_fadeā€ example. Is there a way to use the FreedomStudio IDE to flash the bootloader?

Hi Dale, it should work on a Mac, though I havenā€™t tried it.

If you downloaded the prebuilt binaries then ā€œmake toolsā€ wonā€™t work. I hadnā€™t thought of that. Thatā€™s just a sanity check to see if you have gcc, OpenOCD etc but maybe I need to find a more direct way. In the meantime you can just delete that part from the script. If you can actually compile and upload things using the freedom-e-sdk then all should be well.

Iā€™ve never used FreedomStudio, so I canā€™t advise about that. Eclipse-based things have never agreed with me ā€¦ Iā€™m an emacs-and-makefile kinda guy.

Success path:

  • git clone freedom-e-sdk
  • install pre-built binaries per README.md
  • fetch your repair script
  • remove ā€œtoolsā€ check from script
  • run script

As desired, led_fade is running. Reset shows bright green LED briefly, then runs led_fade again. Reset during bright green bootloader pause loops with flashing red LED, as expected.

1 Like

Hi Dale, Iā€™m glad you got it going.

Iā€™ve uploaded a new version of the script. Instead of running ā€œmake toolsā€ it checks for the presence of working gcc, gdb, and openocd (that they all respond as expected to ā€œā€“versionā€) and complains if not. So if people didnā€™t set RISCV_PATH or RISCV_OPENOCD_PATH correctly that should be diagnosed and reported.

It should work for both self-built and pre-built tools, on Mac and Linux. At least it works on my Mac and Linux.

Could you please try it on your setup?

(if you load a different program, such as dhrystone, first then the LED should stop cycling ā€“ and go and stay off if you reset the board)

1 Like

Confirmed that the updated script works for me too. Iā€™ve already uploaded new programs, so it was obvious when led_fade ran. The bootloader, of course, was already there. Also didnā€™t test the absence of tools, etc.

Thanks for your assistance!

1 Like

\o/

Hi Bruce,
Thanks for uploading the new version of your script. I can confirm that it worked on my setup as well. I am using precompiled tools as well.
Regards,
Karthik

Great! Sorry for the hassle.

Thanks a lot, I had the same issue! This was helpful!