2023-10-30 10:12 AM - edited 2023-10-30 10:12 AM
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?
2023-12-12 07:33 AM
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:
So maybe this is my issue and the FLASH_ECCR is in corrupted state and located before 0x08000000?
2023-12-12 09:55 AM
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.