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.
Hi,
I asked a related question about one month ago. The thread can be found at:
https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/938274
This thread was did not solve my problem. I still got the prefetch entry. I did the changes that mentioned in the above thread.
I looked at IFSR. İt is 0x409, addressing ECC error. The fault address is 0xC. I enabled and disabled ECC and tried running, got prefetch entry again.
The interesting thing is, when I debug and put breakpoint to Fapi function in disassembly window and step one by one, the code is working. Also, when I tried to write another bank, the code working. However, I cannot write/erase in same bank. Also, I checked in disassembly window, Fapi functions run from RAM. Is there any idea for solution.
Osman,
Thanks in advance.
Hello,
1. Two status should be checked after issuing Fapi_issueProgrammingCommand(..) API:
while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
while(FAPI_GET_FSM_STATUS != Fapi_Status_Success);
2. When copying the Flash API related functions to SRAM, please copy the const to SRAM as well.
Hello,
Sorry for the late reply.
1. When Fapi_issueProgrammingCommand(..) running, code cannot move this function. Stucked to prefetchEntry. Thus, there is no after of this function. The problem is in this function.
2. Yes, I did that.
Is there any idea to proceed. I can share the code pieces if you want.
Osman,
Thanks in advance.
Hello Osman,
Does your code check the FAPI status after enabling the bank and sectors?
(void)Fapi_setActiveFlashBank((Fapi_FlashBankType)Bank);
(void)Fapi_enableMainBankSectors(0xFFFF);
while( FAPI_CHECK_FSM_READY_BUSY != Fapi_Status_FsmReady );
while( FAPI_GET_FSM_STATUS != Fapi_Status_Success );
If FSM is still busy when you call Fapi_issueProgrammingCommand(), you may get error.
When you step into the Flash API in disassembly window, please check if the branch address (in BL instruction) is valid, and if push and pop are called to handle the return address.
In CCS/RM46L852: jump to prefetchEntry when used Fapi_issueProgrammingCommand it was found that the functions which call the FAPI functions also need to run from RAM, to avoid getting prefetch aborts.osmanorgut said:Also, I checked in disassembly window, Fapi functions run from RAM. Is there any idea for solution.
That was also observed in the referenced thread.osmanorgut said:The interesting thing is, when I debug and put breakpoint to Fapi function in disassembly window and step one by one, the code is working.