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 have been trying to custom EEPROM Emulation by using TMS570LC4357 and its Flash Bank 7. I've read several documents that TI provides about Fapi such as F021 Reference Manual and Advanced F021 Flash API Erase/Program Usage
But I don't clearly understand what is the difference oMode parameters of Fapi_issueProgrammingCommand function in Fapi. And I couldn't find a document clearly explained it. Can you help me about what is the difference between Fapi_DataOnly and Fapi_AutoEccCalculation and what are the observations that must be obtain when I switch between these two modes. It is not necessary right now but if you have knowledge about it you can also explain the others oModes like Fapi_EccOnly and Fapi_DataAndEcc. Pardon me if there is already a document which I didn't notice for it
Best Regards
Hi Franklin,
FAPI Programming Modes :
1. Fapi_AutoEccGeneration :
This will program the supplied data portion in Flash along with automatically generated ECC. That means "Fapi_issueProgrammingCommand" API will internally calculates the ECC for the supplied data and programs this ECC into the corresponding locations along with the data we supplied.
2. Fapi_DataOnly :
This mode will only program the data portion in Flash at the address specified. That means "Fapi_issueProgrammingCommand" API will not calculates any ECC for your data and it just programs the data.
3. Fapi_EccOnly :
This mode will only program the ECC portion in Flash at the address specified. That means "Fapi_issueProgrammingCommand" API will take only ECC part and programs the corresponding ECC at specified address and no data will get programmed in this mode.
4. Fapi_DataAndEcc :
This will program both the supplied data and ECC in Flash at the address specified. That means unlike "Fapi_AutoEccGeneration" mode where we supplied data and ECC was calculated internally in the "Fapi_issueProgrammingCommand" API but here we need to give both data and corresponding ECC manually to the function and this function will programs them into the specified addresss.
Among all the modes, the most preferable mode is "Fapi_AutoEccGeneration", because in this mode the ECC will be calculated internally and get programs into the specified mode. That is the reason in most of the cases customers use this mode only.
--
Thanks & regards,
Jagadish.
Hello Jagadish, thank you for your reply
I want to be able to write the data to EEPROM Bank 7 in byte for every available address. For example I want to write 0x45 into the address 0xF02000000 and then write 0x46 into 0xF02000001. When I try to implement a scenario like this with AutoEccCalculation mode, I can only write with 64-bit wide, for instance when I write 0x45 into 0xF02000000, the next data that I want to write can be written 0xF02000008. But when I switch the mode as a Fapi_DataOnly I can access and write every address in Bank 7. I don't understand why it is happening. Can you assist me for it?
Hi Franklin,
I could see the behavior you mentioned on my side as well.
Give me some more time to analyze and provide you an update.
--
Thanks & regards,
Jagadish.
Hi Franklin,
It is due to the ECC, as we know that there will be a 8bit ECC for every 64-bit data right. That is the reason we were unable to write the byte by byte access in this device.
And i tested same scenario in the TMS570LS3137, there i didn't get any problem because the ECC in this device will not be enabled by default.
And even though you can access byte by byte write "Fapi_DataOnly" in this mode also will be a problem. Your data will get corrupted, because the ECC in this device will always be in enabled state only and we can't disable it. So even we write data using "Fapi_DataOnly" mode our data bits will get flipped because ECC region will have all FF's right that is not match with our data what we are writing. So, this might lead to the single bit errors and our data will get corrupted.
--
Thanks & regards,
Jagadish.
Hi Jagadish, thank you for your reply.
I understand what you are mentioning and I also had estimated this problem came from ECC calculation. In my custom EEPROM Emulation I'm trying to improve a generic driver which valids both TMS570LC4357 and TMS570LS3137, so I have to overcome this problem. Is there any workaround to solve this problem? I see the function in Fapi which is Fapi_DisableAutoEccCalculation but when I try to add this function in my code, It couldn't help me as a solution for this problem. I really need to solve this problem in some way because my customer is using both MCU in his products. If there is a way to turn off ECC calculation in TMS570LC4357 (maybe assembly level) I really need to know how.
Thanks & Regards
I see the function in Fapi which is Fapi_DisableAutoEccCalculation but when I try to add this function in my code, It couldn't help me as a solution for this problem. I really need to solve this problem in some way because my customer is using both MCU in his products. If there is a way to turn off ECC calculation in TMS570LC4357 (maybe assembly level) I really need to know how.
It is not possible to disable the ECC in the TMS570LC4357 and it will be always in enabled state only.