cancel
Showing results for 
Search instead for 
Did you mean: 

How to recover the factory state of STM32L051C8T6

MBudi.1
Associate II

Now, I am developing low power LoRa node using STM32L051C8T6.

We can upload the script on the new chip of STM32L051C8T6, and get low current consumption of less than 10 microAmp.

However, for the used chip of STM32L051C8T6, we can upload the same script, and

running well, but the current consumption is about 4 mA, much higher than the new chip.

the used chip of STM32L051C8T6 mean that the chip is in the same batch production, but we have been used for many time uploading the script during development.

I have been full erase the chip, but no result.

Is there any means to recover the factory state of STM32L051C8 so we can consider it as a new chip ?

6 REPLIES 6
MM..1
Chief III

For measure low power mode you require unconnect power after programming and leave stlink disconnected

MBudi.1
Associate II

Yes, the STLink is disconnected from the board. We use the same boards, the same script and the same time. Previously, I have uploaded the low power arduino script, and it was working. The current consumption was less than 5 microAmp. During development, I have uploaded many script, but I found that the current consumption was much higher (~4 miliAmp). I have uploaded the previous working script, but still the current consumption is high.

I have uploaded the script to a new fresh board, and the current consumption back to a normal low power at 5 microAmp.

I have been a long time to develop a low power device using STM32L series.

I use the same board, the same script, the same batch production and using the same arduino IDE version, but get different results.

Yes, the STLink is disconnected, no after this you need disconnect power too.

STLink setup registers for debuging in low power modes and this isnt reset by flash , reset or any operation except complete power off MCU.

MBudi.1
Associate II

The problem is not due to the STLink. After programming, I remove the STLink, power off the MCU, then connect to external power supply. I have many boards of STM32L051C8T6.

How you check if your code (script) is in low power mode? 4mA seems as code in run when on your board isnt other activated current sink. Good is toggle an unused pin in code after stop and measure ...

Uwe Bonnes
Principal III

Factory state is recovered by a mass-erase and reset of option bytes to factory default. However factory defaults are not documented in a consistent way, and the programmer does not have a "one-klick" option byte default restore, as requested since years "Can StCubeProgrammer reset option bytes to factory default". However I think your problem is more in soft- and hardware.