sifive / freedom-u-sdk

Freedom U Software Development Kit (FUSDK)
278 stars 125 forks source link

Failed to access CSR 0xc01 from M-modesbi_trap_error #181

Closed Mammon-github closed 3 weeks ago

Mammon-github commented 1 year ago

When I was running linux kernel on sifive unmatched board, I found that get_cycles() always return 0, this function will return the value of CSR_TIME register, It shouldn‘t be zero. but the CSR_CYCLE can be read and working properly. By reading the SiFive FU740-C000 Manual. I realized that RTC may need a battery, and the problem persisted even after the battery was installed. Then I add those code in Opensbi: jj_mtime_addr = 0x0200_BFF8 (mtime register addr in clint) image And error occurs:

image

I don‘t known why CSR_TIME can't be access. please help me