A board with STM32F103C8T6 sometimes runs into hard fault handler.
When I heat up the board to 65C or higher, a hard fault will be caused randomly, which leads me to check if the latency of the flash is not enough.
Then I set the flash latency to 1 clock, the problem is solved,the chip runs stably even when I heat it up to 100C.
But it makes no sense because CPU runs at 24MHZ(HCLK is 24MHZ), which means no flash latency is needed as the datasheet says.
Here are my detailed clock configuration:
Clock source is 16MHZ given by external crystal, and PLL is 3x(I need to use USB ,so a clock of 48MHZ at SYSCLK is needed), then the AHB prescaler is configured to 2, so the clock of the CPU is 24MHZ.
I looked up the datasheet and it doesn't say clearly where the flash is clocked, but it says "Flash memory instructions and data access are performed through the AHB bus", does it mean the clock of the flash equals to AHB (24MHZ in my application)? But it doesn't work stably, where am I wrong?