cancel
Showing results for 
Search instead for 
Did you mean: 

FLASH memory map

Ala
Senior

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

0693W00000Lwh0dQAB.jpg 

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)

0693W00000Lwh0sQAB.jpg 

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

0693W00000Lwh12QAB.jpg 

12 REPLIES 12
Huh? Code is stored in flash.
If you feel a post has answered your question, please click "Accept as Solution".

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?

Yes…
If you feel a post has answered your question, please click "Accept as Solution".