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 work with FRAM

Other Parts Discussed in Thread: MSP430FR5969

Hi all,

I would make a data logger using FRAM of my MSP430FR5969. I made some code in order to write 4 bytes (0,0,0,0) starting from address 0xD000 like an example of family FR59xx.

When I try to read these 4 bytes I get always 65535. Could it be a pointer problem? Or any other mistake?

Thanks in advance.

Fabio

  • Hi Fabio,

    Are you talking about reading data back after you have power cycled the part? How are you reading the data back - are you sending it out over an interface like UART, are you simply checking the stored value in code and set a pin or pins to indicate if the value matches the expected one, or are you using the debugger to read back the data by looking in the memory window?

    If you run a debug session in CCS or IAR where you reload the program into the part after you do your power cycle, your previously written FRAM data would be erased and you'd see 0xFFFF (0r 65535) because you reprogrammed your part. So you need to make sure to use an option for debugging without downloading new code, so that the previously written values are still there when you go to read them at the beginning of your code.

    Are you using CCS or IAR?

    Regards,

    Katie

  • Hi Katie,

    I use IAR and I set some breakpoints to debug and to check the stored value; I use also Memory window and I see 0xffff at the beginning of the program, as you say; during the cycle I can see values becoming 0,0,0,0....as I want and if I stop and restart debug they are again 0xffff. I want values remain still there also when I power off the device; how to set debug?

    I have another question: in sample code test address is set to 0xD000. Why this value? I did not find any information about it in User Guide or datasheet of my mcu.

    Thank you very much.

    Fabio

  • Fabio Marinosci said:
    I want values remain still there also when I power off the device; how to set debug?

    You can configure the debugger to not upload the firmware anew before starting the debug run. By default, it will always upload the most recent firmware before starting the debug (which erases your stored data).
    Don't forget to switch it back whenyou change the code.

    I don't use CCS myself, but maybe you can alternatively configure teh debugger to only erase the part where the code goes, when uploading the firmware. On Flash devices, this is significantly slower, but on FRAM it might even save some time.

  • Hi Fabio,

    I don't know your code modifications that you have made, but here are the steps I use with IAR for testing the msp430fr59xx_framwrite.c example (unmodified).

    1. Program the code in as normal, after running for a while pause the debug to see the values are being written at 0xD000. End the Debug Session.

    2. This time, select the debug without downloading option. Normally, to debug you select this green button for "Download and Debug"  . However, that would over-write the FRAM that you are trying to view because it would erase it. So you want to use this clear icon instead, for "Debug without Downloading".

    3. Now that you've selected Debug without Downloading and entered the debug session, you should be able to observe the values in 0xD000 are not 0xFFFF (have not been erased).

    I hope this helps!

    -Katie

  • Hi Katie,

    I followed your steps and it works fine; a last question: how many memory banks can I use to write data? The datasheet states:

    Ultra-Low-Power Ferroelectric RAM (FRAM)

    Up to 64KB Nonvolatile Memory

    Ultra-Low-Power Writes

    Fast Write at 125 ns Per Word (64KB in 4 ms)

    Unified Memory = Program + Data + Storage in One Single Space

    1015 Write Cycle Endurance

    Radiation Resistant and Nonmagnetic

    Can I use all 64KB (starting from 0xD000) or just a part of it? 

    Thanks,

    Fabio

  • Fabio Marinosci said:
    Up to 64KB Nonvolatile Memory

    Teh datasheet covers multipls MSPs with different memory map. See the datasheet chapter "short-form description - memory organization" for details.

    Fabio Marinosci said:
    Can I use all 64KB (starting from 0xD000) or just a part of it? 

    You shouldn't touch the area from 0xFE00 to 0xFFFF, as this is the interrupt vector table and JTAG fuse and BSL password area.

    Above 0x10000 is usable fram too, if your specific MSP has fram there. But be sure you don't use fram that is used by the linekr to place code and constants and init values. You might need to modify the linker script to prevent it from using fram you want to use for data storage.
    And keep in mind that you'll need 20 bit instructions (large data model) to access locations above 64k. You might be better off using large code model (letting the linker put code above 64k) and reserve fram below 64k for data storage. (ISRs, however, must be placed below 64k too, so leave enough space for them)

**Attention** This is a public forum