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'm trying to integrate the TI FEE driver into my OS based TI Hercules (TMS570LS0232) project, but am facing some issues. If I use the Halcogen project as-is, I can initialize/write to/read from from the emulated EEPROM.
However, when I pulled the generated ti_fee* files into my OS-based project, EEPROM functionality broke -- there is no error returned by the TI_FEE* APIs, however, the emulated EEPROM reads all Fs.
Some things I tried/differences I noticed between my OS based project and the halcogen project:
A few questions:
I've run out of ideas as to how to debug further/what else I can look at. If you have any suggestions/can provide any guidance, it will be extremely helpful. Thank you!
Hi Anthony,
Thank you for your prompt reply.
For testing purposes, I'm doing all my TI_FEE calls at the top of main() (which is invoked from _c_int00()) before any OS initialization is taking place so I'm not sure if user/privileged mode has come into play just yet (I'm using FreeRTOS) .
Also, as a data point, I compared the CPSR bits in the working and non-working case. In both cases the ARM operation mode was "System".
One thing I did notice, in non-working case, an error was reported:
FMdlStat 0x00001010 Module Status Register [Memory Mapped]
-------------
Bit 4:
Command Status
Once the FSM starts any failure will set this bit. When set, this bit informs the host that the program, erase, or validate sector command failed and the command was stopped. This bit is cleared by the Clear Status command. For some errors, this will be the only indication of an FSM error because the cause does not fall within the other error bit types.
-------------
What registers can I look at to get more details about this error?
Thank you very much.
I tried a number of things - and finally found the issue to be the way the FAPI library was included in the linker file.
Initially, I was linking it as follows under SECTIONS:
flashAPI :
{
Fapi_UserDefinedFunctions.obj (.text)
--library = F021_API_CortexR4_BE.lib
} > FLASH0
Later, I changed this to a library include at the top of the file as follows:
--library="F021_API_CortexR4_BE.lib"
After I made this change, I could successfully init/write/read to the EEPROM from my OS app. Could you explain why this may have fixed it?
Also, what is the required delay after the the TI FEE calls? It's not entirely clear from the delay function:
void delay(void)
{
unsigned int dummycnt=0x0000FFU;
do
{
dummycnt--;
}
while(dummycnt>0);
}
// Initialize emulated EEPROM driver
TI_Fee_Init();
do
{
TI_Fee_MainFunction();
delay(); // <------------------ what should this delay be?
feeStatus=TI_Fee_GetStatus(0);
}
while(feeStatus!= IDLE);
Thank you!
Ash,
Ash K said:Later, I changed this to a library include at the top of the file as follows:
--library="F021_API_CortexR4_BE.lib"
After I made this change, I could successfully init/write/read to the EEPROM from my OS app. Could you explain why this may have fixed it?
Not sure. But if it really changed something you should be able to see what it changed by looking at the .map file and comparing between two builds?
Hi Anthony,
Will do, thanks.
Could you also please tell me know what the delay requirements between TI_Fee_MainFunction() and TI_FEE_GetStatus() are:
TI_Fee_MainFunction();
delay();
Status=TI_Fee_GetStatus(0 );
Thanks
Hi Ash,
Delay function is not required anymore. You can remove it from the code.