Other Parts Discussed in Thread: C2000WARE
Hi ,
This code snippet I have taken from this example path : C:\ti\c2000\C2000Ware_4_02_00_00\device_support\f2837xd\examples\dual\flash_programming\cpu01
Buffer[0] = 'A';
for(i=0, u32Index = Bzero_SectorJ_start;
(u32Index <= Bzero_SectorJ_End) &&
(oReturnCheck == Fapi_Status_Success); i+= 1, u32Index+= 1)
{ // Issue program command
oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index,
Buffer,1,0,0,Fapi_DataOnly);
// Wait until the Flash program operation is over
while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
if(oReturnCheck != Fapi_Status_Success)
{
Example_Error(oReturnCheck);
}
// Read FMSTAT register contents to know the status of FSM after
// program command to see if there are any program operation related errors
oFlashStatus = Fapi_getFsmStatus();
if(oFlashStatus != 0)
{
// Check Flash API documentation for possible errors
Example_Error(oReturnCheck);
}
// Verify the programmed values
oReturnCheck = Fapi_doVerify((uint32 *)u32Index,
0, (uint32*)(Buffer),
&oFlashStatusWord);
if(oReturnCheck != Fapi_Status_Success)
{
Example_Error(oReturnCheck);
}
}
My Query :
1. The Data 'A' is flashed in all addresses of Sector J, and I am able to read even I do power off to ON of the microcontroller.
2. This line of statement Fapi_doVerify((uint32 *)u32Index,0, (uint32*)(Buffer),&oFlashStatusWord); I have passed arguments by doing trail and error method, so when I have passed those arguments as 0 and (uint32*)(Buffer) then I have got Fapi_Status_Pass and the data 'A' was also programmed in flash.
I want to know the calculation or analysis, that how this has been happened, even I have followed with Flash API document( https://www.ti.com/lit/ug/spnu629a/spnu629a.pdf?ts=1681972192498&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FTMS320F28379D ), but still I am unable to understand it.
3. Fapi_StatusType Fapi_doVerify( uint32 *pu32StartAddress,uint32 u32Length, uint32 *pu32CheckValueBuffer, Fapi_FlashStatusWordType *poFlashStatusWord) what this uint32 u32Length, uint32 *pu32CheckValueBuffer it means, please give me some examples for writing single word/ multiple word in flash address.
Thanks,
Sid C