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.

MSP430 Code Segment

Other Parts Discussed in Thread: MSP430FR5969

Hi,

   I am using Ti's MSP430 - FR5969. It has 2kB SRAM and 64kB FRAM. I am question is,

  -> Where the Code Segment will Store, in SRAM or FRAM.

 -> If I am allocating Buffer as global, it will allocate in SRAM or FRAM.

Why I asked this Question means, I want to use buffer's which may in range 500 Bytes to 2 KBytes. But This is having only 2KB SRAM.  

  • The code should be stored in FRAM.

    Your other run-time data can be allocated to either FRAM or SRAM. Placement can be defined using the linker command file (.cmd for CCS, .xcl in IAR). You can carve the memory into whatever regions you need and allocate sections to these regions.

  • Is my understanding is correct according to your answer, The global buffer can be stored in FRAM. But accessing the buffer can be done in SRAM. So i can allocate the five buffers with 500 bytes. But not one 2k buffer . It will create problem while accessing that buffer in SRAM.

  • The FRAM memory is a special kind of memory. It retains its content after a power off and you can write to it just like plain RAM. This mean that you can use it both to store your code and constant data (i.e. things you normally would place in read-only memory like FLAHS) as well as your normal data (which traditionally were placed in RAM).

    In other words, you can place all your buffers and your code in FRAM memory.

    From the perspective of the program, there is no difference between accessing SRAM and FRAM. (There is a difference, though, in accessing the lower 64K compared to the memory above 64K, but that has nothing to do with FRAM vs. SRAM.)

        -- Anders Lindgren, IAR Systems

  • 1.How can I store buffers in FRAM.

    2. What is the Recommended max Buffer can be allocated in MSP430FR5969

  • Pinky Patel said:
    1.How can I store buffers in FRAM.

    You just need to make sure that the segment containing your variables is allocated into an FRAM region in your linker command file.

    Pinky Patel said:
    2. What is the Recommended max Buffer can be allocated in MSP430FR5969

    On the MSP430FR5969 device, FRAM extends from 0x04400 to 0x13FFF (63 KiB)

    You can use as much storage as you want minus the space required for the interrupt vector table and the size of your code.

    If you are asking about largest single contiguous buffer, then that would be 47 KiB - (code + vector) for a buffer starting at 0x4400. You can create a 16 KiB buffer (0x10000 to 0x13FFF) in upper memory if you use the large data model.

    So the answer is it depends on how big your code it and how you manage your linker settings (memory map).

  • Thanks Brian,

        Where can I get the Linker command File. Right now, I have created my own project file. How can I attach Linker Command file(.cmd) in my project file to configure the buffer in FRAM.

  • Can any one reply to this post

  • I am not a CCS user, but you should be able to find the default .cmd file for your device in the CCS installation somewhere. Then you just need to make a copy into your project directory and import it into your project settings.

  • There is another difference between SRAM and FRAM: SRAM can be accessed with 24MHz, while FRAM requires waitstates on higher MCLK frequencies.

    So it is good to put things into SRAM that are accessed often (like the stack) while buffers are fine in FRAM. I’m not sure how DMA copes with FRAM waitstates.

  • Pinky Patel said:
    Where can I get the Linker command File

    The linker command file is already on the root of your project with a name which points to your device name (+ .cmd). You can change the name but have then to change also the name in the project properties.

**Attention** This is a public forum