cancel
Showing results for 
Search instead for 
Did you mean: 

Why Nucleo L053R8 crashes after 7~11 minutes of execution?

elyes
Associate

I'm using STM32CubeMX 5.2.0

MCU: STM32L053R8Tx

Firmware: STM32Cube FW_L0 V1.11.2

Toolchain/IDE: MDK-ARM V5

Tested with 3 different boards, even with a default code (as generated by CubeMX) in debug mode, and also with a simple UART transmitter program (transmits a message every few seconds to check if the program is still alive) without the debugger.

4 REPLIES 4
T J
Lead

can you pause the code and see where it is ?

check the call stack after a crash.

generally in a hardfault because you have filled a buffer beyond the ram space, or you have tried to write a read only register...

check what happens when the transmitter buffer become filled, where does the next byte go ? at the beginning ?

also check if the chip is getting hot, this would also stop it working after a short period.

Make sure the stack size is large enough, in Keil that would be in startup.s

Make sure you have a Hard Fault Handler that outputs useful information to the UART.

Check any other while(1) or spin loops it might get stuck in. ie Error_Handler()

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Ozone
Lead II

> ...even with a default code (as generated by CubeMX) in debug mode, and also with a simple UART transmitter program ...

Your trust in Cube generated code is not really substantiated.

The long period tends to point to either a incorrect memory access like an array index overflow. or an interrupt - related race condition.

Perhaps nested interrupts that overflow the stack. Cube does a lot of stupid callbacks in interrupt context.

@elyes​ ,

did you find the cause of crash?

JW