2022-04-03 03:35 AM
hello
I have a stm32f030c8t6 which I wish to save some data in its FLASH memory. I use Address Page30 which is 0x08007800 in memory map. it is in 7th Sector. I've developed my code and easily saved some data in that Address. recently I tried to add some lines to my code(note: it is just some lines, for example detect if a is key pressed) but as soon as I add these lines of code, the memory on Page30 Address corrupts!
here is the buffer I tried to save
int32_t flash_buffer_w[DATA_SIZE]={0,0,9999,0,2000,20,280,1200,7000,180,650,850,63,50,3,25,3};
and here is the memory map in debug mode
and here the memory when I added only lines of code(which by the way are executed in certain conditions and in startup these conditions are not happening)
what I have noticed is that: every time that I added one line of code, I monitored the memory. it seems like every time the written code proceeds to the Address which I wish to read and thus I get false saved data(maybe because this is the code data and not my saving data).
so my question is: how could this be possible? I mean I cared about the boundaries and didn't go beyond them. but how can the code violate into FLASH MEMORY Addresses?
here is the memory map in page 33 of stm32f030c8t6 datasheet
2022-04-03 10:12 PM
2022-04-03 10:20 PM
I know, but is Code stored in FLASH memory?
and if so, the only right job is to save data in very last Pages in order to hope not to interfere with the Code?
2022-04-03 10:28 PM