2018-05-19 10:51 AM
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?
2018-06-06 04:17 AM
Sorry
Waclawek.Jan
,I didn't see that it has been updated in the Last RM.
I'm rechecking your configuration.
2018-06-15 03:40 AM
Thank you for your answers.
In my first post I wrote that the configuration SYSCLK = 48 MHz, HCLK = 12 MHz works fine. That is only true for low temperatures (25 °C). One of our prototypes seemed to go into a hard fault after a random time, but the weather was quite hot last week and I discovered that the hard fault immediately occured when the device was heated up by a few degrees (> 30 °C).
With one wait state instead of zero the same device didn't go into hard fault.