Tool/software: Code Composer Studio
Hi team,
We are presently working on F021 flash memory for the device “TMS570LC43X”. We are using “F021_API_CortexR4_BE_L2FMC_V3D16.lib” library file.
Presently, we are facing an issue in programing. That is , the data is wrongly written after programming. Please see below for further details.
We are writing the data using the array “unsigned char Data[32] = {'A', 'B', 'C' , 'D', 'A', 'B' ,'C', 'D', 'A' ,'B', 'C', 'D' ,'A', 'B', 'C','A', 'B', 'C' ,'A', 'B', 'C' ,'A', 'B', 'C' ,'A', 'B', 'C', 'A', 'B', 'C','A','D'};”.
But after programming the data is writing as “41420344” instead of “41424344”. We could able to read this erroneous date after system/software reset only. If there is no reset, the memory location is filled with “FFFFFFFF”.
Note: we are executing the code from Bank0 and programming Bank1 at address 0x0022 0000(Sector 1). I think as it is writing to a different Bank (Bank1), it is not mandatory to execute the code from RAM.
The programming and initialize function are
#include “f021.h”
unsigned char Data[32] = {'A', 'B', 'C' , 'D', 'A', 'B' ,'C', 'D', 'A' ,'B', 'C', 'D' ,'A', 'B', 'C','A', 'B', 'C' ,'A', 'B', 'C' ,'A', 'B', 'C' ,'A', 'B', 'C', 'A', 'B', 'C','A','D'};
void main()
{
long Address_2[1]={0x00220000};
Fapi_initializeFlashBanks(150); //HCLK clock is 150MHz.
Fapi_StatusType return_chcek;
Fapi_setActiveFlashBank(1);
Fapi_enableMainBankSectors(0xFFFF);
while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
while( FAPI_GET_FSM_STATUS!= Fapi_Status_Success );
if(FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmReady)
{
return_chcek = Fapi_issueProgrammingCommand((long *)0x00220000,Data,sizeof(Data),0,0,Fapi_DataOnly);
while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
while(FAPI_GET_FSM_STATUS!= Fapi_Status_Success);
}
While(1)
{
/*Do Nothing.*
}
}
Could you please help us to solve the issue.
Thanks in Advance
Pramith P