2019-11-13 09:23 PM
Hello everyone,
I am doing EEPROM EMULATION On STM32F103RB Series which has 128kb flash. I am able to erase and write the contents into flash. But when my code size exceeds 64KB, the content is not being written properly into the flash. Can anyone tell me why such happens and what is the solution so as to solve the issue???
Solved! Go to Solution.
2019-11-14 12:53 AM
You need to observe the size of block your STM32 model erases in one erase step. I don't use STM32F1, so you need to look it up in RM0008.
Maybe you want to set it to the highest possible part of the FLASH, to leave way for potential future code extension?
JW
2019-11-13 10:11 PM
Perhaps because the EEPROM emulation uses the last 64k sector, while the first is used for your code. Check your map file.
Using the first sector also would destroy the code.
> Can anyone tell me why such happens and what is the solution so as to solve the issue???
Use real EEPROM, or a variant with more Flash.
2019-11-13 10:20 PM
Ok thank you Sir, I am new to flash programming. I am saving my data into flash from address "0x0800FC00" . If I change the starting address from "0x0800FC00" to
"0x0800FD00" , will it solve the issue??
2019-11-14 12:53 AM
You need to observe the size of block your STM32 model erases in one erase step. I don't use STM32F1, so you need to look it up in RM0008.
Maybe you want to set it to the highest possible part of the FLASH, to leave way for potential future code extension?
JW
2019-11-14 02:04 AM
And perhaps need to synchronize the EEPROM emulation settings with the linker file.
I don't know F103FB either, buf if the size required for your code is smaller, you could perhaps free more blocks (sectors) at higher addresses for the emulation.
2019-11-14 02:10 AM
@Ozone @Community member Thanks a lot for your support. I shifted the starting address to the end page of the main memory and that solved the issue. Previously the code size exceeded 64k and at the same time I was trying to save data on flash . But using end page ( 0x0801 FC00 - 0x0801 FFFF) solved the issue. Thanks a lot :)