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
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.
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)
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!
\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!