cancel
Showing results for 
Search instead for 
Did you mean: 

Issue on optimization level -O3 STM32WLE5CCU - Exception handler occures

kyf
Associate II

Hello there.

 

I've been developing a project with STM32WLE5CCU with LoraWAN included. I've used ST's utilities like LMhandler, UTILITIES_timer, and SEQUENCER to handle tasks and different functions.

I've encountered a strange behavior though. When I change the optimization level to O3 there are times where code asserts to an error and the error handler is called to reset the device.

I've done some search regarding the state of the registers in the MCU and I've found out that BFSR.IMPRECISERR register was set.

kyf_0-1719232526253.png

 

 

 

 

....
STM32WL5x_CM4/SCB/CFSR_UFSR_BFSR_MMFSR/MMARVALID:0x0
STM32WL5x_CM4/SCB/CFSR_UFSR_BFSR_MMFSR/IBUSERR:0x0
STM32WL5x_CM4/SCB/CFSR_UFSR_BFSR_MMFSR/PRECISERR:0x0
STM32WL5x_CM4/SCB/CFSR_UFSR_BFSR_MMFSR/IMPRECISERR:0x1
STM32WL5x_CM4/SCB/CFSR_UFSR_BFSR_MMFSR/UNSTKERR:0x0
STM32WL5x_CM4/SCB/CFSR_UFSR_BFSR_MMFSR/STKERR:0x0
STM32WL5x_CM4/SCB/CFSR_UFSR_BFSR_MMFSR/LSPERR:0x0
STM32WL5x_CM4/SCB/CFSR_UFSR_BFSR_MMFSR/BFARVALID:0x0
...

 

 

 

 

I've exported all registers right when the error occurred.

This is the attached file name: exported registers regarding Hardfault exception.txt

 

- I could not figure out the triggering conditions of this fault. Time that this fault occurred was not the same all the times.

- This issue does not happen in -Os (size) optimization

 

Can anyone point me out where to look at in order to fix this ?!

 

Kind regards,

kyf

 

 

0 REPLIES 0