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.

LAUNCHXL-F28027F: How to set a part of flash to be persistent

Part Number: LAUNCHXL-F28027F
Other Parts Discussed in Thread: BOOSTXL-DRV8305EVM

Hi,

LAUNCHXL-F28027F + BOOSTXL-DRV8305EVM,

Is there an example on how to make a portion of the 64k flash as persistent?

I have gone thru the forums but I did not get a clear answer.

 Any help/suggestions would be very much appreciated.

Thanks,

Asha

  • Asha,

    Your question is vague. What do you mean by persistent? Do you mean you want keep updating calibration value / some other parameters to be repeatedly updated in flash?

    Regards,

    Manoj

  • Hi Manoj,
    I mean I would like to save some parameters (32 to 64 bytes) so that these can be retrieved on power up. We are adding additional motor sensor parameters to our project that people will tune and that is why I am investigating this.

    Thanks,
    Asha
  • Hi Manoj,

    I think I have it working by modifying the F28027F.cmd file and my project file:

    In F28027F.com file I added

            "                   .......

                 vib_buf_data       : > D_RAML0      PAGE = 1

                  graph_data   : > D_RAML0      PAGE = 1

                  myPersistent      : > D_RAML0    PAGE = 1 ------------ I added this "

    Then in my proj source file I added

                   uint16_t test_persistent[4];

                   #pragma DATA_SECTION(test_persistent, "myPersistent");

    In my main() I added the below code and it seems to retain the values after restarting of my debugger:

         

                if(test_persistent[0] == 0)

                {

                       test_persistent[0] = 2;

                       test_persistent[1] = 1;

                       test_persistent[2] = 3;

                       test_persistent[3] = 4;

                }

               else if(test_persistent[0] == 2)

                {

                      test_persistent[0] = 5;

                      test_persistent[1] = 7;

                      test_persistent[2] = 8;

                      test_persistent[3] = 9;

               }

    But how can I guarantee that the test_persistent[] will always hold the latest data? Can I assign a specific Flash memory?

    Thanks,

    Asha

     

      

  • This is a duplicate thread. I shall be closing this thread.
    -Manoj