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.

Main memory for data storage?

Other Parts Discussed in Thread: MSP430F47186

I am using MSP430F47186.

I have question on Flash writing/reading data function.

I thought that I can only use "Information memory" for storing data.
However, as I was reading MSP430x4xx Family User's Guide (slau056i.pdf), I found at "6.2 Flash Memory Segmentation" the sentence that "...main and information memory sections. Code or data can be located in either section.".

Does this mean that I can use Main memory for data storage?

For example, my MSP430 works as a datalogger, consuming 60KB for the code out of the 120KB main memory size of MSP430F47186, another 60KB can be used for data logging. Is this right?

If possible, some application needing data storage area more than 192B (B-D segments of information memory) will become possible.

  • OKY,

    Yes, you can store data in the "CODE" section of the MSP430 FLASH.  The only difference between the INFO memory area and the "CODE" area is the page size and the fact the TI stores calibration values in the INFO memory area for most of the new micro controllers.  If you choose to do this you will need to set up the linker file to not place any code in your new FLASH "DATA" section so you don't accidentally erase an part of your application.

    Cheers,

    Darren

  • Thank you very much, Darren

    That is good information for me. 

    Thank you about the information on the difference and note on the linker file setting.

    Best regards

  • Keep in mind htat storing data in main flash above 64k requires the use of 20(32) bit data pointers (large date model), whihch has negative impact on code size and code speed (push/pop operations, including in ISRs, require 32 bit register save, data access instructions require extension word prefix)

  • Thank you very much for your advice, Jens-Michael Gross.

    I didn't recognize that I have to use 20 bit data pointers. That will make my code complicated.

    I will consider to use this storage method only when I have no other option.

    Best regards

  • OKY said:
    I will consider to use this storage method only when I have no other option.

    You may put your data in main flash below 64k., You don't need large data model then.

    Or, if access speed isn't an issue, you may use small data model, but put your (constant) data to upper flash by direct linker control, and write a hand-crafted read function that uses 20 bit assembly instructions (while interrupts are disabled) to access the upper memory. This way I used upper flash memory on an older mspgcc compiler that didn't support large data model at all.

  • Thank you very much for your further advice.

    So by putting data below 64KB address, I don't need large data model.

    Best regards

**Attention** This is a public forum