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.

MSP430FR5969 memory organization

Other Parts Discussed in Thread: MSP430FR5969
HI,
i'm using MSP430FR5969.
i would like to better understand how its 64KB  memory is organized.
From it's datasheet (http://www.ti.com/lit/ds/symlink/msp430fr5969.pdf - pg 23) :
Memory (FRAM) Total Size 64KB
interrupt vectors 00FFFFh–00FF80h 
code memory 013FFFh–004400h
In my , i need to write inside the FRAM two blocks of datas which size is 0x3100 Bytes (12544 Bytes)
How can i know where the code is stored, and where am i free to write within the FRAM?
i'm asking this because right now i'm just going by attempt.....much time consuming, and high error probability ( i've already blown 2 micro untill now) .... not good!
If i start writing the first block starting from the lowest address (0x4400) after 32 Byte the writing procedure doesn't work anymore. (why?!)
if i start writing the first block at 0xC000 it works fine ( but then i don't know where to start to write the second block, moreover it's very likely in next future i will need to write more data in memory other than this "2 data blocks")
the point is, that i would like to understand how can i choose the memory portion in which i can feel free to store/wirte data without problem.
any suggestion?
Thanks in advance for your kind reply
Best regards
Irene
  • Usually, the Linker can generate a Map List telling you how the memory are allocated. Turn-on that option, and examine the Map List.

  •  

    old_cow_yellow said:

    Usually, the Linker can generate a Map List telling you how the memory are allocated. Turn-on that option, and examine the Map List.

    HI,

    do you mean the window that shows you during the debug session the values stored in the memory?

    If yes I 'm already using that. This is how i can see when i'm actually storing data or not where i want.

    I would like to know if it possible to know , before the debugging phase, where the code will be stored and so where i will be able to store data

    thanks for your kind reply

    best regard

    irene

  • No, I assume you use a PC to run a "cross" Compiler/Assembler/Linker of some sort. That PC program usually have the option of generating a text file (or HTML file) on that PC to tell you how it intend to use the memory in your MSP chip. This is done without touching your MSP chip. You do not even need a MSP to do this.

    This file is usually referred as the "Link List", "Map List", "Link Map", "Map File", or something like that depending on which Compiler/Assembler/Linker you use.

  • Irene,

    OCY's reply will tell you where the linker placed all of the code/data of the program when it was done being linked.

    In addition, there is a thing called a linker command file (in CCS I think it has .cmd extension, in IAR it is the .xcl file) that tells the linker where to place everything. You can edit this file to customize the environment for your particular needs. Doing that you can reserve a chunk of FRAM space to use for your data storage.

    Read the linker user's guide for whichever toolchain you are using.

  • Irene, you shouldn’t directly pick a location where you store your data. You should tell the linker that you need this space, and the linker will pick the location and relocate all accesses in your code to match it. This way you won’t have problems if your program later changes (code grows etc.)
    However, it is not a trivial task.

     On the FR devices, the FRAM can be used for permanent code storage as well as for variable (writable) data. You can simply request a sufficiently large global array and tell the linker to put it into uninitialized data space, so it doesn’t get initialized at power-on (but rather keeps old contents). I don’t know the exact syntax, as I don’t use CCS or IAR, but IIRC it is as easy as putting a #pragma before the array definition. Then simply use it and be sure it won’t conflict with the storage position of your code.
    The drawback is that after recompiling the code, the linker may assign a different location. That’s good if your space requirements change, but a new version of the firmware will not be able to access the old data anymore.

    Alternatively, you can modify the linker script to reserve a certain area of FRAm for your storage, and tell teh compiler to put it there instead of normal variable space. How to do it depends on the toolchain. And the proper programming of the memory protection unit adds anothe rlevel of complexity. In this case, however, you know that your data is always at the same place and therefore will survive a firmware update (as long as you don't do a mass erase befor writign the new firmware).

**Attention** This is a public forum