Open 123swk123 opened 4 years ago
Hi @123swk123,
We have improved the startup and exception handling for Nuclei RISC-V processor using NMSIS, and adjust the gd32vf103 firmware in our Nuclei SDK, which will of course fix the issue.
Thanks Huaqi
Has it been fixed already?
If so please share the commit details let me try to use it for my current work and feedback if I find something.
It is not fixed in this repo, it is fixed in a seperated repo mentioned above maintained by Nuclei RISC-V Processor software team.
Thanks Huaqi
If you are using this repo, you can simply change this csrci CSR_MCOUNTINHIBIT, 0x5
to csrsi CSR_MCOUNTINHIBIT, 0x5
to enable the cycle/instret counter.
Thanks Huaqi
CSR_MCOUNTINHIBIT is reset back to 0x05 after executing function libc_init_array https://github.com/riscv-mcu/GD32VF103_Firmware_Library/blob/12b61d1bf29afbee8ec4eee81cdbf1bd9f89470a/Firmware/RISCV/env_Eclipse/start.S#L237
even though it was cleared at https://github.com/riscv-mcu/GD32VF103_Firmware_Library/blob/12b61d1bf29afbee8ec4eee81cdbf1bd9f89470a/Firmware/RISCV/env_Eclipse/start.S#L233
clear these bits just before calling main.