I have a project using a Bluepill in which I want to use about 10Kb to emulate an EEPROM, I have about 60% of flash in use, so the plan is to have it next to that (while inspecting the used flash up to now by the program I should be able to insert this EEPROM starting from 0x0800A000). I also want the data to be writable in chunks of 1Kb without disturbing whats written on the other chunks (For example, write from 0x0800A000 to 0x0800A400, without changing 0x0800A400 to 0x0800A800, and so on). From what I understand this should be possible since the sector size of the STM32F103 is 1Kb.
In my code I have the following code to test where the data is being written to (i then check if that is the case by reading the flash manually using the STM32CubeProgrammer software):
Code: Select all
void setup() {
eeprom_buffered_write_byte(0, 250);
eeprom_buffered_write_byte(1, 250);
eeprom_buffer_flush();
I have created a file named build_opt.h with the following:
Code: Select all
-FLASH_BASE_ADDRESS=0x0800A000
It's my first time using build_opt, i don't know if I am doing something wrong or if I am missing another define that I should overwrite.
Also, if I happen to resolve that, i don't know how to make the EEPROM buffer a fix size (1Kb in this case), and choose programatically where that should be located in flash.