Hi,
Wondering if someone can please help me.
I am writing to Bank 7 on the RM48L950 device. I have followed the F021 V2.00.01 API exactly to the letter, however after issuing an ERASE SECTOR command and waiting for the FSM to become ready I get status bits = 0x0180 from the Fapi_getFsmStatus();
The two bits in question are "Busy" (bit 8) and "Erase Active" (bit 7). Technically this is correct, but Fapi_CheckFsmForReady() should stay busy if the register Busy bit is set.
If I re-check the Fapi_getFsmStatus() a second later the bits are cleared and status = 0.
Can anyone suggest how to ensure the Fapi_CheckFsmForReady() should be used, and why it is not busy when the registers are busy.
For completeness my code is posted below.
Thanks
Stomp
Lint16 s16RM4_FLASH__SectorErase(Luint32 u32Bank, Luint32 u32Flash_Start_Address, Luint32 u32Size_In_Bytes, Luint32 u32Freq_In_MHz) { Lint16 s16Status; Luint32 u32Status; Fapi_StatusType stReturn1; Fapi_StatusType stReturn1A; Fapi_StatusType stReturn2; Fapi_StatusType stReturn3; //set our status up early s16Status = C_LCCM135__RETURN_TYPE__ERROR_GENERIC; stReturn1 = Fapi_initializeAPI((Fapi_FmcRegistersType *)0xfff87000, u32Freq_In_MHz); if(stReturn1 != Fapi_Status_Success) { //error s16Status = s16RM4_FLASH__F021ErorCode(stReturn1); }//if(stReturn1 != Fapi_Status_Success) else { //good to continue stReturn1A = Fapi_initializeFlashBanks(u32Freq_In_MHz); if(stReturn1A != Fapi_Status_Success) { //error s16Status = s16RM4_FLASH__F021ErorCode(stReturn1A); }//if(stReturn1A != Fapi_Status_Success) else { stReturn2 = Fapi_setActiveFlashBank((Fapi_FlashBankType)u32Bank); if(stReturn2 != Fapi_Status_Success) { //error s16Status = s16RM4_FLASH__F021ErorCode(stReturn2); }//if(stReturn2 != Fapi_Status_Success) else { //determine which sectors to enable if(u32Bank == 7) { /*This function sets up the sectors in the EEPROM banks that are available for erase and programming operations. This function must be called with the EEPROM bank (Flash Bank 7) as the active bank. Additionally, the function must be called once before performing program and sector erase operations and always before a bank erase operation. Each bit refers to a single sector with Sector 0 is bit 0 in u32SectorEnables_31_0 to Sector 31 is bit 31 in u32SectorEnables_31_0 and Sector 32 is bit 0 in u32SectorEnables_63_32 to Sector 63 is bit 31 in u32SectorEnables_63_32*/ Fapi_enableEepromBankSectors(0xFFFFFFFF, 0xFFFFFFFF); } else { /*This function sets up the sectors in the non-EEPROM banks that are available for erase and programming operations. This function must be called with the bank intended for the erase or program operation as the active bank. Additionally, the function must be called once before performing program and sector erase operations and always before a bank erase operation. Each bit refers to a single sector where Sector 0 is bit 0 to Sector 15 is bit 15 in u16SectorEnables.*/ Fapi_enableMainBankSectors(0xFFFF); } //wait ready before we issue the programming command while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy) { } //success stReturn3 = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, (Luint32 *)u32Flash_Start_Address); while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy) { //allowed to execute other code here } u32Status = Fapi_getFsmStatus(); if(u32Status != 0) { //the device has simply failed s16Status = C_LCCM135__RETURN_TYPE__ERROR_DUT_FAILED; }//if(u32Status != 0) else { s16Status = s16RM4_FLASH__EraseCheck(u32Flash_Start_Address, u32Size_In_Bytes); }//else if(u32Status != 0) }//else if(stReturn2 != Fapi_Status_Success) }//else if(stReturn1A != Fapi_Status_Success) }//else if(stReturn1 != Fapi_Status_Success) //return with the status return s16Status; }