Is it possible to write to Flash during runtime for TMS570LS3137 processors? I think it is available in "Flash API" but I couldn't find how and what to use.
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.
Is it possible to write to Flash during runtime for TMS570LS3137 processors? I think it is available in "Flash API" but I couldn't find how and what to use.
Hi Ktmn,
Is it possible to write to Flash during runtime for TMS570LS3137 processors?
Yes, you can do that with the "F021 Flash API" library.
I think it is available in "Flash API" but I couldn't find how and what to use.
Please refer the "F021 Flash API" library reference guide and understand the different API's.
F021 Flash API Reference Guide (v2.01.00) (Rev. H) (ti.com)
I created one simple example and tested, here it is:
--
Thanks & regards,
Jagadish.
Thank you very much for your answer and example.
When I edit your example for Flash, it works fine for Bank1 and Bank7, but when I try to write to Bank0 it doesn't show up in the "Fapi_setActiveFlashBank(Fapi_FlashBank0)" function and it doesn't continue.
I don't have this problem in Bank1 and Bank7.
What could be the reason for this?
Thanks again for your reply.
Hi Ktmn,
When I edit your example for Flash, it works fine for Bank1 and Bank7, but when I try to write to Bank0 it doesn't show up in the "Fapi_setActiveFlashBank(Fapi_FlashBank0)" function and it doesn't continue.
This is expected behavior:
Please refer above highlighted line from FAPI reference guide. "The F021 Flash API library cannot be executed from the same bank as the active bank
selected for the API commands to operate on".
That means 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.
To do this, please refer below thread:
--
Thanks & regards,
Jagadish.
You are quite right. Thank you very much again.
I have kept you very busy, but I have one last question. Again in your example, the mode for ECC is "Fapi_AutoEccGeneration".
As far as I understand, ECC is produced for the given data thanks to this mode.
But how can I read this ECC or have I misunderstood. If the ECC is generated, how do we find the address of this ECC?
Thank You Again.
Hi Ktmn,
As far as I understand, ECC is produced for the given data thanks to this mode.
Yes, this programming mode will generate the ECC for corresponding data and it writes the ECC to the corresponding ECC section.
But how can I read this ECC or have I misunderstood. If the ECC is generated, how do we find the address of this ECC?
Please refer ECC sections in TRM
And also refer FMC chapter in TRM
--
Thanks & regards,
Jagadish.
Hi Jagadish,
Thank you very much for your reply.
The function generates ECC and when I look at the address corresponding to ECC I only see a question mark (?????????).
So I'm not sure exactly where it is written. For example, when writing ECC to RAM, only that ECC field appeared as a question mark (?????????), but in "Flash Data Space ECC" all addresses appear as question marks (???????) Flash ECC is Enable.
How can I read this or be sure?
Thanks & Regards.
Hi Jagadish,
We solved the previous problem and now I can read the ECC, but now the ECC values entered in the last parameter of the "Fapi_issueProgrammingCommand" function and the ECC values calculated in the "Fapi_AutoEcc_Generation" and "Fapi_calculateEcc" function give different results for the same data and address.
May I know why? And which one should I trust?
-Fapi_AutoEcc_Generation?
-Fapi_calculateEcc?
Thanks & Regards.
I solved thje problem. the problem is about my algorithm.
Good to hear that you solved the problem by yourself.