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.

TMS320F2800137: flash not retaining after controller turn off

Part Number: TMS320F2800137

Tool/software:

i am using f2800137 board , i need to save some of variable values to flash, i am using flash api library functions to save values to flash memory of the device, i  took one example code related to flash functions

( flashapi_ex1_programming ), i imported this file from the examples and changed the file as per my requirements. i just added two arrays   ram_buffer_16( holds 16 bit ) & ram_buffer_8 ( holds 8 bit ).

in main.c file firstly i called  init_eeporm() function [ my own function ], below steps are done in that function.

step 1 : i initialized elements in  both arrays to zero.

step 2 : next i used      Flash_initModule(FLASH0CTRL_BASE, FLASH0ECC_BASE, 2);     api for flash module initialization.

step 3 :  then i called eeprom_read_all() function

             this function used to read the data's stored in flash, first it copy the datas from flash sectors and stored in  ram_buffer_16( holds 16 bit ) array.

              and then it copy data from  ram_buffer_16( holds 16 bit ) array to ram_buffer_8 ( holds 8 bit ) bit array.

   

eeprom_read_all()  

void eeprom_read_all(void)
{
uint16 *base_pointer = (uint16*) Bzero_Sector120_start;
uint16 count = 0X0, count1 = 0;
for (count = 0; count < 0X200; count++)
{
ram_data_buffer_16[count] = *(base_pointer + count);
}

for (count = 0,count1 = 0; count < (0X200 * 2U); count += 2,count1 += 1)
{
ram_data_buffer_8[count] = ram_data_buffer_16[count1] & 0XFF;
ram_data_buffer_8[count + 1u] = ((ram_data_buffer_16[count1] >> 8U)
& 0XFF);
}
}

after reading operation is complete i erased the flash sector.

erase_sector()   

FUNCTION DEFANITION :

void Erase_Sector(void)
{
Fapi_StatusType oReturnCheck;
Fapi_FlashStatusType oFlashStatus;
Fapi_FlashStatusWordType oFlashStatusWord;
ClearFSMStatus();

// Enable program/erase protection for select sectors where this example is
// located
// CMDWEPROTA is applicable for sectors 0-31
// Bits 0-11 of CMDWEPROTB is applicable for sectors 32-127, each bit represents
// a group of 8 sectors, e.g bit 0 represents sectors 32-39, bit 1 represents
// sectors 40-47, etc
Fapi_setupBankSectorEnable(FLASH_WRAPPER_PROGRAM_BASE + FLASH_O_CMDWEPROTA,
0x13FFFF00);
Fapi_setupBankSectorEnable(FLASH_WRAPPER_PROGRAM_BASE + FLASH_O_CMDWEPROTB,
0x00000080);

//
// Erase the sector that is programmed in the above example
// Erase Sector 0
//
oReturnCheck = Fapi_issueAsyncCommandWithAddress(
Fapi_EraseSector, (uint32*) Bzero_Sector120_start);
//
// Wait until FSM is done with erase sector operation
//
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady)
{
}

if (oReturnCheck != Fapi_Status_Success)
{
//
// Check Flash API documentation for possible errors
//
Example_Error(oReturnCheck);
}

//
// Read FMSTAT register contents to know the status of FSM after
// erase command to see if there are any erase operation related errors
//
oFlashStatus = Fapi_getFsmStatus();
if (oFlashStatus != 3)
{
//
// Check Flash API documentation for FMSTAT and debug accordingly
// Fapi_getFsmStatus() function gives the FMSTAT register contents.
// Check to see if any of the EV bit, ESUSP bit, CSTAT bit or
// VOLTSTAT bit is set (Refer to API documentation for more details).
//
FMSTAT_Fail();
}

//
// Verify that Sector0 is erased
//
oReturnCheck = Fapi_doBlankCheck((uint32*) Bzero_Sector120_start,
Sector2KB_u32length,
&oFlashStatusWord);
if (oReturnCheck != Fapi_Status_Success)
{
//
// Check Flash API documentation for error info
//
Example_Error(oReturnCheck);
}
}

in next step i write some data"s to flash ( to 8bit ram array )

from 8 bit array it will store to ram_16_bit array    and  that 16 bit ram array pass through  programusingautoECC()

Defanition of eeprom_write_all() attached below.

void eeprom_write_all(void)
{
Fapi_StatusType oReturnCheck;
//
// Initialize the Flash API by providing the Flash register base address
// and operating frequency(in MHz).
// This function is required to initialize the Flash API based on System
// frequency before any other Flash API operation can be performed.
// This function must also be called whenever System frequency or RWAIT is
// changed.
//
oReturnCheck = Fapi_initializeAPI(FlashTech_CPU0_BASE_ADDRESS,
DEVICE_SYSCLK_FREQ / 1000000U);

if (oReturnCheck != Fapi_Status_Success)
{
//
// Check Flash API documentation for possible errors
//
Example_Error(oReturnCheck);
}

//
// Initialize the Flash banks and FMC for erase and program operations.
// Fapi_setActiveFlashBank() function sets the Flash banks and FMC for
// further Flash operations to be performed on the banks.
//
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);

if (oReturnCheck != Fapi_Status_Success)
{
//
// Check Flash API documentation for possible errors
//
Example_Error(oReturnCheck);
}

// Saving 8 bit array into 16 bit array.
uint16 i = 0u;
for (i = 0u; i < WORDS_IN_FLASH_BUFFER; i++)
{
ram_data_buffer_16[i] = (ram_data_buffer_8[i * 2U] & 0XFF)
| ((ram_data_buffer_8[(i * 2U) + 1U] << 8U) & 0XFF00);
}

//
// Program the sector using AutoECC option
//
// eeprom_write_auto_ecc(ram_data_buffer_16);
ProgramUsingAutoECC(ram_data_buffer_16);
}

from the o/p of the program we can see that flash memory stores data.

even after the power off, the flash retains the data.

later i integrated the same code to my application code , the flash reads and write operations works perfectly but the

supply is off , and then turn on the flash not retains the data.

for reference i attached the linker command file of my application code:

MEMORY
{
BEGIN : origin = 0x00080000, length = 0x00000002
BOOT_RSVD : origin = 0x00000002, length = 0x00000126

RAMM0 : origin = 0x00000128, length = 0x000002D8
RAMM1 : origin = 0x00000400, length = 0x000003F8
// RAMM1_RSVD : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

RAMLS0 : origin = 0x00008000, length = 0x00002000
RAMLS1 : origin = 0x0000A000, length = 0x00001FF8
// RAMLS1_RSVD : origin = 0x0000BFF8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

RESET : origin = 0x003FFFC0, length = 0x00000002

/* Flash sectors */
FLASH_BANK0_SEC_0_7 : origin = 0x080002, length = 0x1FFE /* on-chip Flash */
FLASH_BANK0_SEC_8_15 : origin = 0x082000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_16_23 : origin = 0x084000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_24_31 : origin = 0x086000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_32_39 : origin = 0x088000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_40_47 : origin = 0x08A000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_48_55 : origin = 0x08C000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_56_63 : origin = 0x08E000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_64_71 : origin = 0x090000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_72_79 : origin = 0x092000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_80_87 : origin = 0x094000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_88_95 : origin = 0x096000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_96_103 : origin = 0x098000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_104_111 : origin = 0x09A000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_112_119 : origin = 0x09C000, length = 0x2000 /* on-chip Flash */
FLASH_BANK0_SEC_120_127 : origin = 0x09E000, length = 0x1FF0 /* on-chip Flash */

// FLASH_BANK0_SEC_127_RSVD : origin = 0x0A0FF0, length = 0x0010 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
}

SECTIONS
{
codestart : > BEGIN

.text : >> FLASH_BANK0_SEC_8_15 | FLASH_BANK0_SEC_16_23 | FLASH_BANK0_SEC_24_31 | FLASH_BANK0_SEC_40_47 | FLASH_BANK0_SEC_48_55, ALIGN(8)

.cinit : > FLASH_BANK0_SEC_0_7, ALIGN(8)
.switch : > FLASH_BANK0_SEC_0_7, ALIGN(8)

.reset : > RESET, TYPE = DSECT /* not used, */

.stack : > RAMM1

#if defined(__TI_EABI__)
.bss : > RAMLS0
.bss:output : > RAMLS0
.init_array : >> FLASH_BANK0_SEC_0_7, ALIGN(8)
.const : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
.data : > RAMLS0 | RAMLS1
.sysmem : > RAMLS0
.bss:cio : > RAMLS0
#else
.pinit : >> FLASH_BANK0_SEC_0_7, ALIGN(8)
.ebss : > RAMLS0
.econst : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
.esysmem : > RAMLS0
.cio : > RAMLS0
#endif

#if defined(__TI_EABI__)
.TI.ramfunc : LOAD = FLASH_BANK0_SEC_0_7,
RUN = RAMLS0,
LOAD_START(RamfuncsLoadStart),
LOAD_SIZE(RamfuncsLoadSize),
LOAD_END(RamfuncsLoadEnd),
RUN_START(RamfuncsRunStart),
RUN_SIZE(RamfuncsRunSize),
RUN_END(RamfuncsRunEnd),
ALIGN(8)
#else
.TI.ramfunc : LOAD = FLASH_BANK0_SEC_0_7,
RUN = RAMLS0,
LOAD_START(_RamfuncsLoadStart),
LOAD_SIZE(_RamfuncsLoadSize),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
RUN_SIZE(_RamfuncsRunSize),
RUN_END(_RamfuncsRunEnd),
ALIGN(8)
#endif

/* Allocate IQ math areas: */
IQmath : > FLASH_BANK0_SEC_32_39, ALIGN(8)
IQmathTables : > FLASH_BANK0_SEC_32_39, ALIGN(8)
}

  • after turn of the flash sector shows all 1's -- 0xFFFF

  • Hi Arundev,

    later i integrated the same code to my application code , the flash reads and write operations works perfectly but the

    How are you verifying this? I see the screenshot of data being written properly in the example, but I'd like to verify that flash is actually being written as expected in your application. 

    Are you erasing flash at any point in the initialization of your application?

    Kind regards,

    Skyler

  • above screenshot shows the debugging window of the example code( code is in running condition). i write value to flash. here i removed the  Erase_sector() function  in the init_eeprom() function. defanition of init_eeprom() attached below.

    now i stop the program and disconnect the controller from supply, and connect to supply again, and debug the code to see the flash memory.

    note: the program is not on run state, the resume button is still green , i attached the file below, the data wrote to flash in previous case is still there.

    now we can take the case of my application code, i want to store the value 20 to the particular section in flash memory. i write that value to flash memory, below i attached the debug window of the application code, code is in running condition,

    note: the flash sector stored the value 20 at the correct location( check array & memory browser ), write operation completed.

    write opeartion  control flow ,  from    8bit_ram_buffer --> 16_bit_ram_buffer --> flash memory 

    now if i stop the code,disconnect the controller from supply and connect again & debug the code to see flash retains data or not,

    note : code is not in running condition. here the flash not reatining data after the board is disconnected from the supply, i attached the 

    image below.

  • function definition of init_eeprom() in  application code. 

    call this function from application initialization function.

    definition of eeprom_write() is

    void eeprom_write_all(void)
    {
    write_all_counter++;
    Fapi_StatusType oReturnCheck;
    //
    // Initialize the Flash API by providing the Flash register base address
    // and operating frequency(in MHz).
    // This function is required to initialize the Flash API based on System
    // frequency before any other Flash API operation can be performed.
    // This function must also be called whenever System frequency or RWAIT is
    // changed.
    //
    oReturnCheck = Fapi_initializeAPI(FlashTech_CPU0_BASE_ADDRESS,
    DEVICE_SYSCLK_FREQ1 / 1000000U);

    if (oReturnCheck != Fapi_Status_Success)
    {
    //
    // Check Flash API documentation for possible errors
    //
    Example_Error(oReturnCheck);
    }

    //
    // Initialize the Flash banks and FMC for erase and program operations.
    // Fapi_setActiveFlashBank() function sets the Flash banks and FMC for
    // further Flash operations to be performed on the banks.
    //
    oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);

    if (oReturnCheck != Fapi_Status_Success)
    {
    //
    // Check Flash API documentation for possible errors
    //
    Example_Error(oReturnCheck);
    }

    // Saving 8 bit array into 16 bit array.
    uint16 i = 0u;
    for (i = 0u; i < WORDS_IN_FLASH_BUFFER; i++)
    {
    ram_data_buffer_16[i] = (ram_data_buffer_8[i * 2U] & 0XFF)
    | ((ram_data_buffer_8[(i * 2U) + 1U] << 8U) & 0XFF00);
    }
    //ram_data_buffer_16[1] = 99;
    //
    // Program the sector using AutoECC option
    //
    // eeprom_write_auto_ecc(ram_data_buffer_16);
    ProgramUsingAutoECC(ram_data_buffer_16);
    }

    this eeprom_write() called from flash update function.

    static inline status_t
    flash_update (void)
    {
    eeprom_write_all();
    return pass;
    }

    flash_update() fun will called when eeprom state change from eeprom_idle  to eeprom write.

  • Hi Arundev,

    From your screenshots, I don't see the value 20 being written anywhere in flash. I see 0xBFC0 and 0x0EE9. Can you show the value being written and pause the execution of the program when you show it in the memory browser?

    Kind regards,

    Skyler

  • here the data type is float, i used some offset values with the value 20,actually 20 will be stored as ((20+ offset_value)* multiplicatin_factor), based on the offset value and multiplication factor corresponding value stored in flash that values are 0xBFC0 & 0X0EE9( combined value is 32 bit) , any way what's the value, it should retain there in flash, right?

  • Hi Arundev,

    Yes, it should. I believe the reason that you are seeing this in your application and not in the example is due to the example being stored in RAM and your application being stored in flash. By default, the CCS On-Chip Flash tool erases the entirety of flash every time you load an application to flash. 

    After power cycling the device and reconnecting, are you re-loading the application to flash? If you re-load the program after the power-cycle, the flash will be erased in preparation to load the program to flash. Try following the steps highlighted in the Manual Launch section to reconnect to the device. After you connect to the Core in Step 4, verify that the content is still in flash. Instead of "Load Program", select "Load Symbols" and select the .out file associated with the application file. You should see the application executing as expected and the data should still be retained in flash.

    To modify the behavior of the CCS On-Chip Flash tool, connect to the core and select Tools -> On-Chip Flash -> Erase Settings, and select "Necessary Sectors Only (for Program Load).

    Kind regards,

    Skyler

  • no, my example code was in flash , example and application both are in flash

  • as you said  "By default, the CCS On-Chip Flash tool erases the entirety of flash every time you load an application to flash. " if this is true how i see the example code retains data, example code in flash ( not in ram )

  • this is the linker command of my example code...

    MEMORY
    {
    BEGIN : origin = 0x00080000, length = 0x00000002
    BOOT_RSVD : origin = 0x00000002, length = 0x00000126

    RAMM0 : origin = 0x00000128, length = 0x000002D8
    RAMM1 : origin = 0x00000400, length = 0x000003F8
    // RAMM1_RSVD : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

    RAMLS0 : origin = 0x00008000, length = 0x00002000
    RAMLS1 : origin = 0x0000A000, length = 0x00001FF8
    // RAMLS1_RSVD : origin = 0x0000BFF8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

    RESET : origin = 0x003FFFC0, length = 0x00000002

    /* Flash sectors */
    FLASH_BANK0_SEC_0_7 : origin = 0x080002, length = 0x1FFE /* on-chip Flash */
    FLASH_BANK0_SEC_8_15 : origin = 0x082000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_16_23 : origin = 0x084000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_24_31 : origin = 0x086000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_32_39 : origin = 0x088000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_40_47 : origin = 0x08A000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_48_55 : origin = 0x08C000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_56_63 : origin = 0x08E000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_64_71 : origin = 0x090000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_72_79 : origin = 0x092000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_80_87 : origin = 0x094000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_88_95 : origin = 0x096000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_96_103 : origin = 0x098000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_104_111 : origin = 0x09A000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_112_119 : origin = 0x09C000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_120_127 : origin = 0x09E000, length = 0x1FF0 /* on-chip Flash */

    // FLASH_BANK0_SEC_127_RSVD : origin = 0x0A0FF0, length = 0x0010 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

    }


    SECTIONS
    {
    codestart : > BEGIN

    .text : >> FLASH_BANK0_SEC_8_15 | FLASH_BANK0_SEC_16_23 | FLASH_BANK0_SEC_24_31, ALIGN(8)

    .cinit : > FLASH_BANK0_SEC_40_47, ALIGN(8)
    .switch : > FLASH_BANK0_SEC_40_47, ALIGN(8)

    .reset : > RESET, TYPE = DSECT /* not used, */

    .stack : > RAMM1

    #if defined(__TI_EABI__)
    .bss : > RAMLS0
    .bss:output : > RAMLS0
    .init_array : >> FLASH_BANK0_SEC_40_47, ALIGN(8)
    .const : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
    .data : > RAMLS0
    .sysmem : > RAMLS0
    .bss:cio : > RAMLS0
    #else
    .pinit : >> FLASH_BANK0_SEC_40_47, ALIGN(8)
    .ebss : > RAMLS0
    .econst : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
    .esysmem : > RAMLS0
    .cio : > RAMLS0
    #endif

    #if defined(__TI_EABI__)
    GROUP
    {
    .TI.ramfunc
    { -l FAPI_F280013x_EABI_v2.00.10.lib}

    } LOAD = FLASH_BANK0_SEC_40_47,
    RUN = RAMLS0,
    LOAD_START(RamfuncsLoadStart),
    LOAD_SIZE(RamfuncsLoadSize),
    LOAD_END(RamfuncsLoadEnd),
    RUN_START(RamfuncsRunStart),
    RUN_SIZE(RamfuncsRunSize),
    RUN_END(RamfuncsRunEnd),
    ALIGN(8)
    #else
    GROUP
    {
    .TI.ramfunc
    { -l FAPI_F280013x_EABI_v2.00.10.lib}

    } LOAD = FLASH_BANK0_SEC_40_47,
    RUN = RAMLS0,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    ALIGN(8)
    #endif

    /* Allocate IQ math areas: */
    IQmath : > FLASH_BANK0_SEC_32_39, ALIGN(8)
    IQmathTables : > FLASH_BANK0_SEC_32_39, ALIGN(8)

    DataBufferSection : > RAMLS1, ALIGN(2)
    }

    this is the linker command of my application code

    MEMORY
    {
    BEGIN : origin = 0x00080000, length = 0x00000002
    BOOT_RSVD : origin = 0x00000002, length = 0x00000126

    RAMM0 : origin = 0x00000128, length = 0x000002D8
    RAMM1 : origin = 0x00000400, length = 0x000003F8
    // RAMM1_RSVD : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

    RAMLS0 : origin = 0x00008000, length = 0x00002000
    RAMLS1 : origin = 0x0000A000, length = 0x00001FF8
    // RAMLS1_RSVD : origin = 0x0000BFF8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

    RESET : origin = 0x003FFFC0, length = 0x00000002

    /* Flash sectors */
    FLASH_BANK0_SEC_0_7 : origin = 0x080002, length = 0x1FFE /* on-chip Flash */
    FLASH_BANK0_SEC_8_15 : origin = 0x082000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_16_23 : origin = 0x084000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_24_31 : origin = 0x086000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_32_39 : origin = 0x088000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_40_47 : origin = 0x08A000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_48_55 : origin = 0x08C000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_56_63 : origin = 0x08E000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_64_71 : origin = 0x090000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_72_79 : origin = 0x092000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_80_87 : origin = 0x094000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_88_95 : origin = 0x096000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_96_103 : origin = 0x098000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_104_111 : origin = 0x09A000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_112_119 : origin = 0x09C000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_120_127 : origin = 0x09E000, length = 0x1FF0 /* on-chip Flash */

    // FLASH_BANK0_SEC_127_RSVD : origin = 0x0A0FF0, length = 0x0010 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    }

    SECTIONS
    {
    codestart : > BEGIN

    .text : >> FLASH_BANK0_SEC_8_15 | FLASH_BANK0_SEC_16_23 | FLASH_BANK0_SEC_24_31 | FLASH_BANK0_SEC_40_47 | FLASH_BANK0_SEC_48_55, ALIGN(8)

    .cinit : > FLASH_BANK0_SEC_0_7, ALIGN(8)
    .switch : > FLASH_BANK0_SEC_0_7, ALIGN(8)

    .reset : > RESET, TYPE = DSECT /* not used, */

    .stack : > RAMM1

    #if defined(__TI_EABI__)
    .bss : > RAMLS0
    .bss:output : > RAMLS0
    .init_array : >> FLASH_BANK0_SEC_0_7, ALIGN(8)
    .const : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
    .data : > RAMLS0 | RAMLS1
    .sysmem : > RAMLS0
    .bss:cio : > RAMLS0
    #else
    .pinit : >> FLASH_BANK0_SEC_0_7, ALIGN(8)
    .ebss : > RAMLS0
    .econst : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
    .esysmem : > RAMLS0
    .cio : > RAMLS0
    #endif

    #if defined(__TI_EABI__)
    .TI.ramfunc : LOAD = FLASH_BANK0_SEC_0_7,
    RUN = RAMLS0,
    LOAD_START(RamfuncsLoadStart),
    LOAD_SIZE(RamfuncsLoadSize),
    LOAD_END(RamfuncsLoadEnd),
    RUN_START(RamfuncsRunStart),
    RUN_SIZE(RamfuncsRunSize),
    RUN_END(RamfuncsRunEnd),
    ALIGN(8)
    #else
    .TI.ramfunc : LOAD = FLASH_BANK0_SEC_0_7,
    RUN = RAMLS0,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    ALIGN(8)
    #endif

    /* Allocate IQ math areas: */
    IQmath : > FLASH_BANK0_SEC_32_39, ALIGN(8)
    IQmathTables : > FLASH_BANK0_SEC_32_39, ALIGN(8)
    }

    some functions are related to fapi_library are not in my application linker command file, is this can cause the flash data retaining problem?

     

  • Hi Arundev,

    Please try including the FAPI library sections in the linker cmd file.

    Kind regards,
    Skyler