0

During the flash of the code on the target, I am storing data into flash memory at a specific adress and I update (sometimes) this data while the code is running.

The memory address I have chosen is kind of by default, only because it was free (no part of the code was stored there).

Problem:
I have made some update on the code and the compiler/linker stores now a part of the code on the same flash memory page, just next to the data I have stored on purpose, which cannot let me rewrite the data because I need fist a page erase for this..

I have just put my data at another free place and page and it's now ok but I would like to know how to "book" a page (or a flash memory area) and then tell to the compiler/linker to not use it to store the code (but still available for data).

Note: It's for a STM32F030K6T6 and I am using IAR.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
NinjaGreg
  • 11
  • 1
  • 3

1 Answers1

0

Use scatter file. Store the data in the section just after the vector table. Place cod after your data. The data will be always at the same address. Code will be located after it.

0___________
  • 60,014
  • 4
  • 34
  • 74