EEPROM emulation on STM32F030 (all developed using CUBE & ATOLLIC)

If you like it, share it

The reference manual for eeprom emulation on STM32F0 is AN4061.

For low-cost purposes, an external EEPROM can be replaced by an on-chip Flash, with a specific software algorithm.
The emulation is achieved by employing at least two pages in the Flash.
The EEPROM emulation code swaps data between the pages as they become filled, in a manner that is transparent to the user.

Refer to the: AN4061

This eeprom example use the STM32F091 eeprom example with a lot of changes.
For example; we change the eeprom.h file because the granularity of flash on STM32F030 is 1K, also we add the printf function, etc.
We tested this example but not in deep so take attention to test your sw in deep.

All sw was generated using CUBE and the project is for ATOLLIC TrueSTUDIO for STM32.

After you have programmed your NUCLEO-STM32F030R8 connect it to your PC and use a terminal emulator (we suggest TeraTerm).
The virtual com setup are shown below.

After you are open TeraTerm reset the board (press the black button) and you must see something like belown.

For create an error on eeprom storage, change one value in the write eeprom function shown below (main.c – from line 136).

 EE_WriteVariable(0x5555, 0x45); // E
 EE_WriteVariable(0x5575, 0x4D); // M
 EE_WriteVariable(0x5595, 0x43); // C
 EE_WriteVariable(0x55B5, 0x55); // U
 EE_WriteVariable(0x55D5, 0x2E); // .
 EE_WriteVariable(0x55F5, 0x45); // E
 EE_WriteVariable(0x5155, 0x55); // U

For example change 0x45 with 0x4D and see what happen.

Go on TOP

How to get the SW for this project

Please send us an email and ask us the password for: NUF030eeprom
Please specify also your country and your city, this are only for our personal statistics.

Get the SW clicking here, but remember to ask us the password for open it.

Note: the project contain also the file for CUBE-MX

Thanks to CUBE-MX is very easy transfer this example on other STM32 mcu.

Go on TOP

How to use the SW

Unzip the example in a folder that you want, we suppose c:\0
Go in the folder:
and double click on the file:

Go on TOP

Extra informations

Go on TOP