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.

TMS320F28388D: Failed to read flash memory

Part Number: TMS320F28388D


Tool/software:

Hello ,

We are using Flash sector12 to store the calibration information. We are referring  Flash API guide for writing the data into Flash and reading the data from Flash memory. 

The Read data from Flash API is not available in the user guide. However, we are experiencing an issue while reading the data from flash memory.

Specifically, when CALIB_DATA_SIZE is set to 128 or 256, the data is read correctly as expected. On the other hand, when CALIB_DATA_SIZE is set to more than 2048, the initial few locations are copied correctly, but later locations contain garbage data.

Code used to read flash memory and copy it into RAM:

#define CALIB_DATA_SIZE 128
#define CALIB_RAM_CONFIG_ADDRESS 0x0000E000

void LoadConfigFromFlash(void)
{
    uint32 i = 0;
    // Initialize Read Buffer
    uint16 Calib_Read_Buffer[CALIB_DATA_SIZE] = {0};

    uint16 *Calib_Pointer;

    Calib_Pointer = (uint16 *) (CALIB_SECTOR_START_ADDR);

    // Transfer contents of flash sector to Read Buffer
    for(i=0;i<CALIB_DATA_SIZE;i++)
    {
        Calib_Read_Buffer[i] = *(Calib_Pointer++);
    }

    // Copy data to RAM
    memcpy((void *)CALIB_RAM_CONFIG_ADDRESS, Calib_Read_Buffer, CALIB_DATA_SIZE);
}

Is there a standard API available to read sector data from flash memory or could you please provide an example code for Read the data from Flash memory?

  • Hi Vikram,

    Is there anything else being stored in RAM that might be overwriting the data copied from flash memory? Have you considered storing the data that needs to be copied from Flash to RAM in a specific section in the linker cmd file? Please see this link for more information.

    Kind regards,

    Skyler