openwch / ch583

The datasheet/SDK/HDK docmentation of Bluetooth LE RISC-V MCU CH582M/CH583M
Apache License 2.0
134 stars 32 forks source link

CH582M won't work at system frequency 2 MHz and lower #31

Open aleph-five opened 1 year ago

aleph-five commented 1 year ago

Hello! I tried to set system frequency 2 MHz via function SetSysClock(), but after that microcontroller goes into hardfault. In datasheet I found information that Fsys range supports this frequency. I tried to disable SysTick interrupt but this didn't help. I read the implementation of SetSysClock() and info about related registers, it seems that all ok. I suggest that problem may be because flash won't work at this frequency (because if hardfault handler contains custom reset function calling from flash, it won't reset. On the other hand, if I use _PFICSystemReset(), which is inlineable and only uses peripheral register, it resets). But I would like to know real reason of that.