EEPROM fails after writing 255 times

User avatar
Posts: 7683
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia

Re: EEPROM fails after writing 255 times

Post by RogerClark » Sat Jun 03, 2017 11:02 pm

This is a common problem, with most MCUs which only have Flash for data storage.

There are a number of different strategies to work around the limitations of Flash memory, i.e you need to erase the whole page, just to write one byte, and have limited erase cycles.

I'm sure there is code for this for other MCUs that you could adapt. e.g the Nordic nRF51 / nRF52 SDK has library that somehow achieves it.

Also, as previously stated, the bootloader sits at 0x800000, then the sketch ( which is variable size) sits above this ( generally at 0x8002000).
So most people just use pages of flash from the end of the available space, and a lot if people assume the F103C8 has 128k even though it is sold as 64K.
Or just buy a Maple mini which is guaranteed to have 128k

Posts: 6
Joined: Thu Jun 01, 2017 10:43 am

Re: EEPROM fails after writing 255 times

Post by cron-dk » Sun Jun 04, 2017 7:45 am

Ok, I think i figured it out... found this good implementation guide on emulated flash: ... 165693.pdf

Thanks for all the input :)

Best regards,

Post Reply