Other Parts Discussed in Thread: RM48L952
Hi.
I'm using RM48L952ZWT.
I'm tring to write the sector 7. but, I failed.
It works good in RM48HDK board. but, My Rm48L952 board is not.
I post my source code. Could you check it?
I'm using CCS5.2.
#include "F021_FMC_LE.h"
Fapi_StatusType oReturnCheck = Fapi_Status_Success;
uint32 u32StartAddress = 0xF0200000U;
uint8 au8MainDataBuffer[16] = {0x78, 0x17, 0x19, 0x2E, 0x0A, 0xB9, 0x11, 0x70, 0x5F, 0xC1, 0x9C, 0xFD, 0x54, 0x51, 0xED, 0x86};
//uint32 u32Index;
/*
Add device specific initialization here, including, but not limited to:
pll initialization, setting up RWAIT/EWAIT value, etc.
Assumes, unless otherwise noted, device has 144bit wide Flash Banks.
*/
oReturnCheck = Fapi_writeEwaitValue(0x00040000);
oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS,80); /* Example code is assuming operating frequency of 160 MHz */
//oReturnCheck = Fapi_doMarginRead((uint32 *)u32StartAddress, (uint32 *)ReplyBuffer, 16, Fapi_NormalRead);
oReturnCheck = Fapi_doMarginReadByByte((uint8 *)u32StartAddress, (uint8 *)ReplyBuffer, 16, Fapi_NormalRead);
if (ReplyBuffer[0] == 0xFF)
{
if((oReturnCheck == Fapi_Status_Success) && (Fapi_checkFsmForReady() != Fapi_Status_FsmBusy))
{
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank7);
if(oReturnCheck == Fapi_Status_Success)
{
oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32StartAddress,au8MainDataBuffer,16,0,0,Fapi_AutoEccGeneration);
}
/* Wait for FSM to finish */
while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
/* Check the FSM Status to see if there were no errors */
if (Fapi_getFsmStatus() != 0)
{
/* Put Error handling code here */
}
}
}
oReturnCheck = Fapi_doMarginReadByByte((uint8 *)u32StartAddress, (uint8 *)ReplyBuffer, 16, Fapi_NormalRead);
Thank you.
Komeco/R&D dept
Seongjin Jeong