I am working on a program, written in RV32 assembly language, for the HiFive1 to drive a strip of WS2812B leds. WS2812B relies of very tight timings (1.25 ns tolerance), and I had a fair bit of trouble getting things right. However, by enabling the PLL, setting a high multiplier, and using my oscilloscope to make sure all the timing was correct, I was able to get everything working. However, I was surprised to discover that it only works when connected to my computer machine and after it is reprogrammed via openocd. It does not work after a reset or when first powered on.
I have looked at all the documentation I could find, but I can’t figure out what might be different between when the board is powered on and post programming.
If anybody has any insight, please let me know, and thank you in advance. If I have no provided enough information or I am not making sense or being an idiot or something, please forgive me, after all, I have been drinking, as I always do while writing assembly code.
I program the board with openocd using the following commands (from my makefile). These are basically just adapted from the fe310 sdk, ./config/openocd.cfg is copied from the fe310 sdk:
upload: openocd -f config/openocd.cfg & $(HOST)-gdb $(PROGRAM) --batch -ex "set remotetimeout 240" -ex "target extended-remote localhost:3333" -ex "monitor reset halt" -ex "monitor flash protect 0 64 last off" -ex "load" -ex "monitor resume" -ex "monitor shutdown" -ex "quit"