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, CONTROLSUITE

Hi,


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

  • Hi Asha,

    You can define it in linker command file. We had many application notes to show how to set a sector FLASH as persistent to store data or emulate EEPROM, you can refer to application notes (SPRAB69) and the chapter 4 of SPRU514I about Linker Command File.
  • Hi,
    Our objective is to save some bytes (32 to 64) so that it can be retrieved on power up. These are some tunable parameters.
    So that instead of manually copying from the debugger and saving it to the user.h file, it can be saved and retrieved from some place in flash.

    I have also look at the application note APRB69 and SPRU5141

    I have looked at the 2 links on the forum:
    1. e2e.ti.com/.../55179
    2. processors.wiki.ti.com/.../FAQs
    section 4.4
    Downloaded "EEPROM Emulation With the TMS320F28xxx (sprab69) and the associated code (zip) and looked at the code but confused at the
    Choice : F2801x, F2801, F2802, etc but none for F28027F

    I tried to follow the code in C:\ti\controlSUITE\libs\utilities\flash_api\2802x\v201a\example_ccsv5\ Example_Flash2802x_API.c

    My question is which sector to select:

    #if (FLASH_F28027 || FLASH_F28025 || FLASH_F28023)
    SECTOR Sector[4] = {
    (Uint16 *)0x3F6000,(Uint16 *)0x3F7FFF,
    (Uint16 *)0x3F4000,(Uint16 *)0x3F5FFF,
    (Uint16 *)0x3F2000,(Uint16 *)0x3F3FFF,
    (Uint16 *)0x3F0000,(Uint16 *)0x3F1FFF,
    };

    So question looking at the map file below I have couple of questions:
    1. If I only have 64K of Flash, how does proj_panther.out run from flash? Not sure I follow this because its size if 70KB.
    2. It seems that I can only use FLASHB_D or D_FLASHA to emulate eeprom but part of both are being used as shown below in the map file. Is this true?
    3. Is there another option?

    Any help/suggestion would be very much appreciated.
    Thanks,
    Asha
    =========================================================

    I am looking at my build map file, proj_panther.map and the size of proj_panther.out and proj_panther.obj

    proj_panther.out = 70KB while proj_panther.out is 415KB
    =========================================================
    the proj_panther.map shows

    OUTPUT FILE NAME: <proj_panther.out>
    ENTRY POINT SYMBOL: "code_start" address: 003f7ff6


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    PAGE 0:
    P_RAML0 00008000 00000980 00000668 00000318 RWIX
    OTP 003d7800 00000400 00000000 00000400 RWIX
    FLASHB_D 003f0000 00006000 00003f26 000020da RWIX
    D_FLASHA 003f6000 00001f80 00000086 00001efa RWIX
    CSM_RSVD 003f7f80 00000076 00000000 00000076 RWIX
    BEGIN 003f7ff6 00000002 00000002 00000000 RWIX
    CSM_PWL_P0 003f7ff8 00000008 00000000 00000008 RWIX
    IQTABLES 003fe000 00000b50 00000000 00000b50 RWIX
    IQTABLES2 003feb50 0000008c 00000000 0000008c RWIX
    IQTABLES3 003febdc 000000aa 00000000 000000aa RWIX
    ROM 003ff27c 00000d44 00000000 00000d44 RWIX
    RESET 003fffc0 00000002 00000000 00000002 RWIX
    VECTORS 003fffc2 0000003e 00000000 0000003e RWIX

    PAGE 1:
    RAMM0_M1 00000000 00000600 0000055f 000000a1 RWIX
    D_RAML0 00008980 00000680 00000000 00000680 RWIX
  • Hi,
    I could not find spru5141
    Thanks,
    Asha
  • This is the document in question: www.ti.com/.../spru514l.pdf

    Sean
  • Hi Sean,
    I had eventually found and scanned thru chapter 4.
    I just want to confirm the following that on reboot, the array test_persistent[] holds values from run time on power up:
    If in my F28027F.cmd file, I add "myPersistent :> D_RAML0 Page=1"
    and then in my *.c file, I add
    "unit16_t test_persistent[4];
    #pragma DATA_SECTION(test_persistent, "myPersistent");"

    and then test_persistent[] array is updated on run time. On power up, the test_persistent[] array has retained the value from the run time?

    Thank you very much,
    Asha
  • Asha,

    You have to reserve 1 flash sector to store tunable parameters and find a way to store all other code /data in remaining flash sectors.

    Regards,
    Manoj
  • Since this is old thread. If I don't see any activity for next 3 days. I shall be closing this thread.