cancel
Showing results for 
Search instead for 
Did you mean: 

EEPROM emulator corrupts STM32G431KBU6 program

WSpar.1
Associate III

Hi all,

We deployed a lot of devices that have a STM32G431KBU6 controller.
It basically has a foot switch to turn on/off a 12v DC motor and a rotary switch to control the speed.

We use EEPROM emulator to save the speed setting.
If speed setting is different from the stored value and there is no new speed change detected within a minute we store the new value. (to safe unnecessary writes)

Clients mostly only set the speed setting once when they first use the product.

So EEPROM emulated write is almost never done only EEPROM emulated read on start up of the device

Somehow support receives a lot of complains about non responding devices. Only reprogram the device helps. But this is a temporarily fix.

Sometimes clients tell us they had a power outage before these issues appear.

We can not reproduce the issue, maybe because our mains power is very clean?

Can power glitches (12v power jack) cause flash program corruption?
  

 

 

 

 

 

31 REPLIES 31
WSpar.1
Associate III

So to summarize:

* Device is reported bricked and doesn't respond to a software on/off switch.
* Client admit that they turn off the device every day via unplugging mains power instead of using the software on/off
* My EE_init() error handling is not sufficient but should turn on a bright red led, the client said he never seen that led turned on
* So I make a dump from 0x08000000 to end of flash
* I do a entire chip erase
* Reprogram the dump 
* Everything starts working again

In the errata (link) of the stm32g431kbu6 I discover the following:
Capture33rr33.PNG

So maybe this is my issue and the FLASH_ECCR is in corrupted state and located before 0x08000000?

 

Question is when ECCR fail is your code run and hang or MCU dont start legal. 

Place red LED on when code start and for example off after EEinit.