Other Parts Discussed in Thread: HALCOGEN
Hi,
The TI FEE driver seems to not be able to write to the flash after a software reset.
We are using the TI FEE driver provided with HalcoGen v4.06 and using F021 Flash API v2.01.01. The FEE is setup in Halcogen for 1 block of 64 bytes, 2 virtual sectors.
Our bootloader uses the FEE to backup data from the RAM before the PBIST selftest and memoryInit is run. This takes place during startup (_c_int00() ) in our bootloader. The data is then read from FEE back into RAM before the real application is started by the bootloader.
If a fatal error occurs during the execution of our application, we write the error info to a no_init section of the RAM and cause a software reset (systemREG1->SYSECR |= 0x00008000).
The bootloader then starts up and runs the following after reset:
void _c_int00(void)
{
SL_Init_R4Registers();
SL_Init_StackPointers();
ApplyErrata();
// Initialize System - Clock, Flash settings with Efuse self check
systemInit();
// Workaround for Errata PBIST#4
errata_PBIST_4();
// Init the FEE driver
TI_Fee_Init();
do
{
TI_Fee_MainFunction();
Delay();
Status=TI_Fee_GetStatus(0 );
}
while((Status != IDLE));
// Backup the RAM to the FEE
TI_Fee_WriteAsync( 1 , (uint8*) u32_pRamBackupDataStartAddress);
do
{
TI_Fee_MainFunction();
Delay();
Status=TI_Fee_GetStatus(0 );
}
while((Status != IDLE));
////////////// Run Selftests Including PBIST ////////////////
///////////// Do memoryInit for RAM and Peripherals ///////////////////
// Init the FEE driver again because memoryInit erased all RAM
TI_Fee_Init();
do
{
TI_Fee_MainFunction();
Delay();
Status=TI_Fee_GetStatus(0 );
}
while((Status != IDLE));
// Restore the RAM from the FEE
TI_Fee_Read( 1, 0, (uint8*) u08_pDataBufferToRead, 64);
do
{
TI_Fee_MainFunction();
Delay();
Status=TI_Fee_GetStatus(0 );
}
while((Status != IDLE));
///////////////////////////// Start Application /////////////////////////////////////////
When I do a cold start, or start via the debugger, I can see that the FEE is written correctly (by viewing the flash7 bank in the debugger). But if I cause a software reset, the RAM data is NOT written to the FEE. I also tried not using the TI FEE driver and just writing to the FLASH7 bank using the F021 Library - this also gave issues ((FAPI_GET_FSM_STATUS != Fapi_Status_Success) is always false) when doing a software reset from the application.
Is there something I can do to prepare the flash driver properly to the same state as when a External reset/ Debuuger Reset / Poweron reset was the cause of reset? We really must backup the RAM data after a SWRST so that we can diagnose the cause in our application AFTER the PBIST and memoryInit was done in the bootloader.
Regards,
Chris