Hi guys,
I’m still trying to use the latest version of the demo RISC-V_RV32_QEMU_VIRT_GCC and I encountered this error running the latest version, enabling the 64-bit architecture.
I compiled the application using the makefile provided in the repository, and then I executed the application with QEMU, as indicated in the README file:
$ make -C build/gcc/ RVA23=1
$ qemu-system-riscv64 -nographic -machine virt -net none -chardev stdio,id=con,mux=on \
-serial chardev:con -mon chardev=con,mode=readline -bios none -smp 4 \
-cpu rv64,zba=true,zbb=true,v=true,vlen=256,vext_spec=v1.0,rvv_ta_all_1s=true,rvv_ma_all_1s=true -s --kernel build/gcc/output/RTOSDemo.elf
Here is my output on the terminal.
FreeRTOS Demo Start (With FPU and vector)
FreeRTOS Demo SUCCESS: : 5035
FreeRTOS Demo ERROR: Register test 1.
: 10035
FreeRTOS Demo ERROR: Register test 1.
: 15035
FreeRTOS Demo ERROR: Register test 1.
: 20035
FreeRTOS Demo ERROR: Register test 1.
: 25035
... (repeats indefinitely)
So, from what I see, the demo starts, prints the initial “Start” message, and usually one “SUCCESS” message from the prvCheckTask
. Shortly after, it consistently starts reporting errors from the register check task 1. From what I understand, this indicates that the ulRegTest1LoopCounter
variable (updated by vRegTest1Implementation
in RegTest.S
) is no longer incrementing, meaning the task has likely hit its error loop due to a failed register comparison after a context switch.
Troubleshooting Done
- RV32 Build: The demo works perfectly fine when built for the default RV32IMAC target (
make -C build/gcc/
). main_blinky
: The other demo works perfectly in both versions (32-bits and 64-bits)- RV64 Build (No VPU): If I modify the
build/gcc/Makefile
for theRVA23=1
target to disable the VPU by removing-DconfigENABLE_VPU=1
fromCFLAGS
(leaving FPU enabled with-DconfigENABLE_FPU=1
), clean, and rebuild, the demo runs correctly on the same QEMU command line. It prints continuous “SUCCESS” messages.
Conclusions and Suspected Cause
Based on the troubleshooting, the issue seems specifically related to enabling the Vector Processing Unit (VPU) (-DconfigENABLE_VPU=1
) on the 64-bit RISC-V port.
However, I am not so expert with hardware and assembly language to continue the investigation by myself
Could you help me understand which part of the code I should update to make the demo completely work?
As always, thank you for your time and support!