AnsweredAssumed Answered

Wrong flash latency from CubeMX with STM32F302CC?

Question asked by Moritz Diller on May 19, 2018
Latest reply on Jun 15, 2018 by Moritz Diller

My program crashes with the following error in TrueStudio:

 

"Program received signal SIGTRAP, Trace/breakpoint trap.
0xfffffffe in ?? ()"

 

The fault occurs in line 692 of stm32f3xx_hal_rcc.c:

__HAL_RCC_SYSCLK_CONFIG(RCC_ClkInitStruct->SYSCLKSource);

 

If I change

HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0)

to

HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1)

everything works fine.

 

I use an external 12 MHz clock source and this configuration in CubeMX 4.25.1:

According to RM0365 the flash access time depends on HCLK not SYSCLK like in RM0008 (STM32F1...), but I tried two other configurations which indicate that flash latency should rather be set according to SYSCLK:

SYSCLK = 72 MHz, HCLK = 9 MHz -> program crashes

SYSCLK = 48 MHz, HCLK = 12 MHz -> works

 

Did I overlook something else or is this a bug in the reference manual / CubeMX?

Outcomes