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.

MSP430FR5994: Writing to the FRAM memory (Using UniFlash or other tool) by CLI/script

Part Number: MSP430FR5994
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Hello,

Firstly I will show how we currently handling and then what we need to improve.

Currently we using CCS in order to program MCUs.

Our program has few running modes that can by set. Currently we just using hard-coded #defines (eg Params.h header file) in order to set a configuration, which is compiled to the binary *.out file.

We want to separate the programming of the MCUs to be independent from the CCS.

UniFlash is good practice for that, but using this way we need an *.out file for each configuration :/.

So we need to separate the programming of the MCU firmware from it parameters programming.

The UniFlash GUI at the "Memory" section, allow to write data to specific memory address byte(s). This can be useful in order to set the device parameters, that by setting a persistent variable (which will represent the a parameter), checking its memory address at the linker map file, and write to that location using the UniFlash memory util.

This is good but requiring manually using the UniFlash GUI.

How can we automate with UniFlash (or other tool) in order to program specific memory address? 

Using CLI / scripting 

Thanks

  • Hi Ron,

    Are you using .out files or .bin files?

    The .out files should have the address information and not out need assign a specific address.

    If you are loading the .bin files, then you can set the address after the loaded files.

    Some additional instructions can be found in below documents:

    https://software-dl.ti.com/ccs/esd/uniflash/docs/v9_2/uniflash_quick_start_guide.html 

    B.R.

    Sal

  • Hi Sal

    Sorry for the delay, we're out of the office for a few days.

    We are using .out files.

    May you have a simple script example that set some memory address to some value?

     

  • Hi Ron,

    I think the this might be process with CLI automatically.

    Follow the guidance to generate the CLI package,

    Then set it with what you done with UNIFLASH GUI, I think all basic operation for download firmware is also supported by CLI.

    B.R.

    Sal

  • Well, I have checked this.

    As I observed, there is no option to write data to a specific memory address with UniFlash, neither via the GUI nor the CLI.

    By using the Memory Utility at the UniFlash GUI, I can read memory content, but I didn't see any option to write some value into a memory location.

    It will be good to get advice on how to simply write some value to specific memory address.

    Or send to the TI UniFlash developing team about this feature.

  • Hi Ron,

    You can file a request in Tools forum.

    As far as I check, it does not directly support this kind of operation.

    While, we can prepare a specifc files which only contains the address which need handle, then it will only program the address it contains. Such as Hex files or TXT files.

    B.R.

    Sal

  • May you guide me how to write such file of hex/txt?

    I know how to write binary data with the content that I need.

    But,

    What should be the structure of the hex file?

    How to set the address to which need to be write?

  • Used ChatGPT to learn about .out files .hex files, and .ti-txt files.

    Used the TI-TXT format to achieve the result in a very simple way.

    The TI-TXT format is:

    @<address>
    <byte1> <byte2> ... <byteN>
    q

    This is a full example of how to write to a specific address (0x26c6 in the example) two uint16_t (four bytes):
    Using a TI-TXT format file.
    Using UniFlash to program the MCU.
    Value of 1 to the field1, value of 2 to field2.

    struct Example1
    
    {
       uint16_t field1;
       uint16_t field2;
    } placer;

    'placer' placed at address 0x27C6.

    .TI-TXT file:

    @27C6
    01 00 02 00
    q

    Programming it with UniFlash will set the address of:
    0x27C6 to 0x01
    0x27C7 to 0x00
    0x27C8 to 0x02
    0x27C9 to 0x00

    .

    Thanks.

**Attention** This is a public forum