Freedom E SDK FreeRTOS blinky demo issue

Hi,

I am encountering a problem when debugging the qemu_sifive_e31_example_freertos_blinky demo project from the Freedom E SDK. I get Invalid register read/write errors printed to the console window.

I am not sure how to proceed and fix this error.

FreedomStudio Version: 4.7.2.2020-06-3

Thank you!

Hi Ryan,

I’ve reproduced the issue you described with the same Freedom Studio version and a newer version also. I see more than a thousand messages like:

...
sifive_plic_write: Invalid register write 0x2018
sifive_plic_read: Invalid register read 0x2018
sifive_plic_write: Invalid register write 0x2018
...

But the program does seem to continue and terminates successfully after printing “Blink” to the console several times.

We’re discussing this issue internally. It seems like the errors are based in QEMU or freedom-e-sdk.

1 Like

Hi Jim,

Thanks for the reply!

Those look exactly like the errors I am getting. However, only “FreeRTOS Demo start” is printed to the console window. “Blink” is not printed. Would it be possible that you could assist me in figuring out why my build won’t run as yours did? I am running the IDE on OSX Catalina v10.15.7.

I feel inclined to let you know that I received the following response from a FreeRTOS representative on their forums.

“We removed the demo from the download because of issues with certain versions of QEMU - as I recall correctly the machine timer didn’t appear to be modelled correctly somehow and that caused the tests to fail (although the code still ran). We replaced the demo with one running on the actual SiFive hardware (HiFive rev2 hardware) - where it runs without a problem.” - Richard Barry

The issue I presented to them was not the same as the one I’m experiencing here. I was trying to follow the tutorial on their blinky demo for RISC-V QEMU sifive_e Model. You can view the brief thread on their forums here for more details.

I hope his response may give insight into the issue.

Thank you,

Ryan

Hi Ryan,

For my project I had to issue a resume before the “Blink” was printed. Freedom Studio puts a breakpoint at main (an option) and you have to resume execution for the program to continue.

The errors seems to be coming from a value that was incorrectly hard coded in freedom-metal. The value of PLIC0_MAX_INTERRUPTS was hard coded to 1024 and it seems like it should be more like 27. Even after I fixed this in /qemu_sifive_e31_example_freertos_blinky/freedom-metal/src/drivers/riscv_plic0.c I still saw one remaining error.