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.
Hello everyone,
I need to delete and add data from flash memory via bootloader. I'm trying it with F021 ( 2.01.01) Flash API codes (Fapi_setActiveFlashBank(Fapi_FlashBank0)), but the code doesn't compile every time and I encounter a few errors:
1-) "push registers and link register on to stack" in dabort.asm
2-) "check if bit 3 is set, this indicates uncorrectable ECC error on B0TCM" in dabort.asm
3-) "prefetchEntry" in sys_intvecs.asm
I cannot compile any flash api code such as deleting flash memory data, adding data or activating flash bank.
How can I fix?
Thank you for your help.
Greetings
Fatih
Hi Fatih,
We have several CAN bootloader examples in below link based on F021 flash library only.
Can you please refer the example related to the TMS570LS04x device?
--
Thanks & regards,
Jagadish.
Hi Jagadish,
I reviewed the TMS570LS04x sample and found that my configurations were correct.
I edit my codes according to the Flash Api 2.01.01 reference guide, but I still get the same errors.
My codes are correct and my configurations look correct. I couldn't understand why I was getting errors.
Thanks & regards,
Fatih
Hi Fatih,
Can you please provide a simplest project with the issue you are facing?
I would like to verify and debug the project at my end.
--
Thanks & regards,
Jagadish.
Hi Jagadish,
Unfortunately, I am not authorized to share the project.
I was seeing 3 errors before, but now I updated my code and I'm only getting the "b prefetchEntry" error.
I'm telling you the functions I use;
Fapi_initializeFlashBanks();
Fapi_setActiveFlashBank();
Fapi_enableMainBankSectors();
Fapi_issueProgrammingCommand();
No matter how much data I want to send, only 8 bytes of data are sent and then I get the "b prefetchEntry" error.
Then I added "_disable_interrupt_();" to my code, but the result still did not change.
Can you give me a simple example that prints data stored in RAM to Bank0?
Thanks & regards,
Fatih
I have instruction fault address and instruction fault status for CP15. But I don't know where to use them.
AN UPDATE ON THE PROBLEM:
I came across the following article in the F021 Flash API Version 2.01.01 Reference Guide;
"NOTE: The F021 Flash API library cannot be executed from the same bank as the active bank selected for the API commands to operate on. On single bank devices, the F021 Flash API must be executed from RAM."
I am trying to write the data stored in RAM to BANK0 with the Flash API in BANK0.
Could this be why I'm getting the PrefetchEntry error?
I've seen threads about running the Flash API from RAM, but I don't fully understand it. So can you share me an example project on this subject?
Thanks & regards,
Fatih
Hi Fatih,
I am trying to write the data stored in RAM to BANK0 with the Flash API in BANK0.
Could this be why I'm getting the PrefetchEntry error?
It doesn't mean you should not write from the RAM to BANK0.
It means that:
if FAPI library was stored in Flash Bank-0 then you are not supposed to perform FAPI commands on Bank-0.
If you really want to do this operation, then you should copy the all the Flash APIs from flash bank-0 to the RAM. Once you copy the Flash APIs to the RAM then you can erase and write to the sectors in Flash Bank-0.
Refer my below thread to understand more details:
--
Thanks & regards,
Jagadish.
Hi Jagadish,
I solved my problem by using another function.
Thanks & regards,
Fatih