cancel
Showing results for 
Search instead for 
Did you mean: 

How to erase EEPROM in an STM32L0-series part USING STM32CubeProgrammer?

DNick.1
Associate II

The release notes for v2.2.0 say that feature is in there, but I can't seem to find it.

I tried the "Full Chip Erase" feature & it cleared everything EXCEPT the EEPROM.

14 REPLIES 14

I don't know the answer, but my brief and painful encounter with Cubeprogrammer taught me, that its "ergonomy" is driven by this amateurish "I can invent an UI too" approach instead of solid industry standard menus. Do you for example know how to read out memory data? Thus, switch to some "EEPROM view" may be hidden at any surprising place maybe as a context menu. So try what these Java-world youngsters normally do: clicking wildly to various even improbable places using both mouse buttons alternatively.

Or try the manual.

JW

DNick.1
Associate II

Clicking about at random may be more effective than trying the manual. A search for the keyword "EEPROM" in the in-app user's manual (v2.4.0) yielded no results.

ST Tech Support -- please advise?

LMI2
Lead

This forum is one good example what happens when someone tries to reinvent the wheel. Square wheels are not very good.

DNick.1
Associate II

Some additional comments:

[I referenced some images below, which were visible in the editor window while composing, but disappeared once the content was posted. <sigh> ]

Using the old ST-LINK utility it was possible to erase the EEPROM using the Flash Memory Mapping window, shown below:

Note the entry at the bottom of the list is labeled "Data Memory (Bank1)" and is 1 KB in size. This is the EEPROM in the part.

However, the same function in STM32CubeProgrammer doesn't show that "Data Memory" selection. This should not require use of an external loader, since the EEPROM is inside the MCU.

  

Would it be possible to submit a feature request to show the EEPROM as a selection in STM32CubeProgrammer similar to what was in ST-Link? It could be at the bottom of the "Erase flash memory" tab list, or better yet, add a tab labeled "Erase EEPROM" which would appear any time the connected target MCU contains EEPROM in its memory map.

ST suggests I use the external loader feature to do this, but that doesn't sound right since this EEPROM is internal to the MCU. Anyone done this successfully using an external loader?

EdFeten
Associate

DNick.1,

I just ran into the same issue as you. I know it has been 3.5 years since your post, but maybe my reply will help others.

You can use the command line version of STM32 Cube Programmer. On my Windows 10 computer, the command line version of the tool is in folder: C:\ST\STM32CubeProgrammer\bin

The name of the executable file is: STM32_Programmer_CLI.exe

You need to get to the DOS prompt and then navigate the the folder where STM32_Programmer_CLI.exe is.

The part that I am working with is the STM32L053R8. It has 2kbyte of eeprom.

To erase the eeprom on the chip from the command line send this command:

"STM32_Programmer_CLI.exe -c port=SWD -e ed1"

I did this with the ST-LINK/V2 programmer/debugger. It worked. 

Hope this helps somebody out there.

Ed

Hello @EdFeten,

Thank you for your feedback and help.

You can also use the STM32CubeProgrammer GUI to erase the internal EEPROM. Simply navigate to the 'Erasing & programming' menu, select the EEPROM bank, and then click on the 'Erase selected sectors' button.

Maryem_0-1701849311464.png

Maryem.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @Maryem ,

Thanks for chiming in.

I think the key information here is, that in CubeProgrammer, EEPROM in 'L0 is treated as another FLASH sector. This is not at all obvious, so this should be hinted somehow: maybe putting it as first, rather than last, item in that list of sectors.

I now also looked at STLink Utility, and lo and behold, it's similar:

waclawekjan_0-1701867196636.png

I then looked into STLink's User Manual, UM0892. Textual search for "eeprom" found it only once, in description of the command-line utility. However, there's also this:

waclawekjan_1-1701867287059.png

So that would need to have 'L0 added, and also the word "eeprom" so that it can be searched for.

On the other hand, in the CubeProgrammer manual (UM2237 rev23), where again textual search for 'eeprom' finds it only in the CLI description (I guess  that's why @EdFeten knows about it and recommended it), the relevant Memory erasing subchapter of Internal flash memory programming chapter has no mention of "eeprom", "flash data memory", nothing. So that would need to be fixed, too.

JW

 

 

OMG!!

Thanks so much! *** me, I did not scroll all the way to the bottom of the "Erase selected sectors" screen. This is much more convenient than doing from the command line.

Thanks for your help,

Ed

Hello @waclawek.jan,

Thank you for bringing this to our attention.

I have submitted an internal ticket addressing your request.

Internal ticket number: 168154 (This is an internal tracking number and is not accessible or usable by customers).

 

Maryem


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.