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.
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.
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.
Unzip the example in a folder that you want, we suppose c:\0
Go in the folder:
and double click on the file:
- More info concerning CUBE and ATOLLIC are here.
- More infrmations concerning CUBE are here.
- How to update the ST-LINK FW under Windows