EEPROM Freezing on stm32l4r5zit6p
Posted: Fri May 14, 2021 9:10 pm
I've been having problems with the mcu freezing when reading or writing to EEPROM. When it happens it is reproducible on a very simple sketch. Once it is able to read and write successfully it seems to stay working between firmware updates and reboots. It seems like erasing the flash can sometimes cause it to start freezing or start working. A few boards I flashed multiple times and switched them on and off a few times to get it to not freeze. Any ideas on troubleshooting steps to take?
When debugging I get this back trace. This is using platformio with stm32duino 1.9.0 but I also tested it with 2.0.0 using the above sketch.
Code: Select all
#include <EEPROM.h>
void setup() {
uint32_t val;
EEPROM.get(0 ,val);
}
void loop() {
}
Code: Select all
#0 WWDG_IRQHandler () at /build/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l4r5xx.s:116
#1 <signal handler called>
#2 0x08003d02 in memcpy ()
#3 0x080036d2 in eeprom_buffer_fill () at /build/framework-arduinoststm32/libraries/SrcWrapper/src/stm32/stm32_eeprom.c:198
#4 0x080036e4 in eeprom_read_byte (pos=pos@entry=0) at /build/framework-arduinoststm32/libraries/SrcWrapper/src/stm32/stm32_eeprom.c:154
#5 0x08003a64 in EERef::operator* (this=<optimized out>) at /build/framework-arduinoststm32/libraries/EEPROM/src/EEPROM.h:159
#6 EERef::operator unsigned char (this=<optimized out>) at /build/framework-arduinoststm32/libraries/EEPROM/src/EEPROM.h:46
#7 EEPROMClass::get<unsigned long long> (t=@0x2009ffd0: 576534179064315910, idx=0, this=<optimized out>) at /build/framework-arduinoststm32/libraries/EEPROM/src/EEPROM.h:231
#8 setup () at src/main.cpp:37
#9 0x0800093a in main () at /build/framework-arduinoststm32/cores/arduino/main.cpp:52
#10 0x0800097a in Reset_Handler () at /build/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l4r5xx.s:98