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.

RM48L952, accessing Flash bank 1

Other Parts Discussed in Thread: CODECOMPOSER

I'm trying to use the Flash utilities, based on the spna106 pdf file. The erase/write/read to the Flash bank 7 works OK, as far as I can tell :

oReturnCheck = Fapi_checkFsmForReady();
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank7);
oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseBank, (uint32 *) 0xF0200000);
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
oReturnCheck = Fapi_issueProgrammingCommand((uint32 *) 0xF0200000, au8DataBuffer, 0x3, 0, 0, Fapi_DataOnly);
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
oReturnCheck = Fapi_getFsmStatus();

 

 But when I try to do the same for Bank 1

 

 

oReturnCheck = Fapi_checkFsmForReady();
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank1);
oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseBank, (uint32 *) 0x00180000); //erase all bank 1
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
oReturnCheck = Fapi_issueProgrammingCommand((uint32 *) 0x00180000, au8DataBuffer, 0x3, 0, 0, Fapi_DataOnly);
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
oReturnCheck = Fapi_getFsmStatus();

 

 It fails to program any data, although no apparent errors from the Fapi routines.

 

 I assume this is something to do with access privledges. When reading from 0x00180000 it triggers a dabort trap.

 

 Code composer seems to give 0xBAD0 data in this memory zone, even though it is supposed to be erased.

 

 Any ideas which steps I need to do, or check ?                  Thanks Phil

  • Phil,

    I would suggest you first check if Flash ECC check/correction is enabled in you boot up functions. After erasing, the Flash data content do not match with ECC any more. If ECC correction is enabled, any read will end in data abort. One simple way to check it is to change to instruction at address 0x0 to "b #-8". After reset, you will see PC is "locked" to address 0x0. Everything on the device is at default condition. By default, Flash ECC is disabled. You can use CCS to view the flash content you programmed.

    Thanks and regards,

    Zhaohong

  • OK, I think I've found that just changing flashWREG->FEDACCTRL1 was OK if I also did a
    manual system reset with Code Composer, but the stage I needed was
    to call the assembler function    _coreDisableFlashEcc_();   after all the system init tests.
    This stopped the dabort, and allowed CodeComposer to see the bank1 memory.

    I will "grasp the nettle" of using the ECC properly in a later part of the project.

     

    Thanks