This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Allocate 10K of memory in Flash to Store Data

Other Parts Discussed in Thread: MSP430F2370

Hello,

I am working with MSP430F2370 Flash programming. I want to allocate 10k of memory for storing data into flash. But i am not able to get that from which address i should start allocating memory as my program is also stored in flash only. So how to manage this to store data in flash.

Controller: MSP430F2370

Flash Size - 32KB

Any help...

  • YOu can tell the linker to not use a certain area in flash for program code. THis is done by altering the linker command script. Details are found in the linke rdocumentation.

    YOu may also define a large const array. The linekr will then put it somewhere into flash. Probably initializing it to zero, if you don't initialize it to something else. However, sicne the linekr will align it on a word boundary but flash sectiosn are 512 byte sized, you'll need to make the array 11k, so be sure that you will 10k of complete 512 byte segments withint the reserved range.
    The array name is the pointer to the first element of the array, and with a bit of poitne rarithmetic you can adjust this value so it points to the beginning of the first 512 byte flash segment inside the reserved array area. This is plain C.

    Writing to this area isn't trivial. See the forum for how to write to program flash.

**Attention** This is a public forum