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.

Using FRAM as Program Memory?

Other Parts Discussed in Thread: MSP430FR5969

Hi everyone!

I have found several resources saying that I can run programs from the MSP430fr5969 FRAM but I'm relatively new to MSP coding and I'm not sure how to do this.

If anyone has any pointers please let me know.

Thank you! 

-Mike

  • Hi Michael,

    On the FR5969 device, you have FRAM instead of flash as your nonvolatile memory. So FRAM is where your code is stored when you program your part - you don't have to treat it any differently. So this is already what your code is running from if you just load any of the code examples. You can see the device's memory map in the datasheet and see that the main code area is FRAM, and you should be able to also look at the .map file generated when you build your project, and you'll see that there is code being stored in the FRAM area.

    Regards,

    Katie

  • Hi Katie,

    Thanks for the clarification on code memory. The problem I'm having is with the .bss section being too small for my code. I assume that this section is being put in SRAM since when I compile for the msp430fr5969 the .bss is 2KB but when I compile for the msp430exp5438 the .bss is 16 KB. Coincidentally, both of these are the same size as the SRAM. 

    Latency is not a big factor in my code, so is there any way I can move the .bss section to FRAM? 

    Thanks,

    -Mike

  • I assume you are using CCS.

    In the linker file (something like lnk_msp430fr5969.cmd), you can "partition" your memory for code/data placement. You first have a section MEMORY where all the blocks are defined with the name of the block, its location and its size. An example: FRAM : origin = 0x4400, length = 0x1000.

    Then you have a section SECTIONS where you actually give the name of the sections that you will use in the main and selec in which block it is placed. Example: .bss : {} > RAM. This places the .bss (global/static vars) into RAM. 

    Following the logic, you just have to replace RAM by FRAM to place your variables in FRAM.

  • Hey Mohamed,

    I'm actually using msp-gcc in Cygwin. I do not have a linker cmd file but I do have a generated .map file with similar code partition sections.

    -Mike

  • I can't really help you then. I suggest you to look in the doc of msp-gcc. There should be some information about data and code placement.

  • Michael Bartling said:
    I'm actually using msp-gcc in Cygwin.

    Which one? There are three different MSPGCC projects. (I only know the oldest MSPGCC3)

    Michael Bartling said:
    I do not have a linker cmd file

    You have. However, other than CCS, MSPGCC does not copy the linker script into the project (after all, MSPGCC does not have a project management IDE at all). It uses the ones installed with the compiler. If you want to change them, you'll have to make a local copy and explicitely specify the location and name of the altered copy in the makefile linker options.

    The MAP file only tells you what ahs been put where. Not where it could have been put. :)

  • Currently, I am using msp-gcc4.7x.

    So I went ahead and copied msp430.x,  memory.x, and periph.x into my local directory. Next I updated memory.x so that ROM (Actually FRAM in my case) to wx (read/write + execute permissions) as well as changed the REGION_ALIAS for REGION_DATA from RAM to ROM. Finally, I updated my make file to explicitly include msp430.x in the linker cmd ( LD_FLAGS += -T msp430.x). 

    This seems to have resolved my initial problem.

    Thanks everyone!

**Attention** This is a public forum