HardFault_Handler() after MxCube project regeneration by using ST Example project
Hello
Currently I am working with NUCLEO-N657X0-Q by using
- STM32CubeIDE_2.1.1
- STM32Cube_FW_N6_V1.3.0
- MxCube v6.17.0
Trying to investigate and migrate CDC ACM feature in to the my own project. As basis I am using Ux_Device_CDC_ACM Example provided by ST as reference.
It was discovered that Ux_Device_CDC_ACM example would not work properly after MxCube project regeneration -- it goes to the HardFault_Handler() at some point (not defined currently at which point)
The investigation showed that the issue is connected with the Optimization level (MxCube updated STM32CubeIDE project files) just only for the one single source file: "stm32n6xx_hal_rcc_ex.c". If optimization level is set to "-O0" for the mentioned file -- HardFault_Handler() is observed. By changing it to the "-O3" -- the application works successfully.
Could you please explain this "hidden" dependency, and what is the reason of this?
