TMS570LC4357: Fapi_BlockErase function occasionally fails when erasing multiple sectors in Bank0.

Part Number: TMS570LC4357

Tool/software:

HI Teams:

    

I'm using the TMS570LC43XX development board. In the Hercules_Ethernet_Bootloader project provided by the TI official website, I found that after the system calls the lwIPInit function and then calls the Fapi_BlockErase function, the system occasionally enters the prefetchEntry exception during the first startup after programming the program.

There is no problem when erasing and writing the following address range:
ipAddr = lwIPInit(0, emacAddress, 0, 0, 0, IPADDR_USE_DHCP);
Fapi_BlockErase(0x40000, 0x20000);
Fapi_BlockErase(0x60000, 0x20000);
Fapi_BlockErase(0x80000, 0x40000);
However, the following code occasionally causes an exception:
ipAddr = lwIPInit(0, emacAddress, 0, 0, 0, IPADDR_USE_DHCP);
Fapi_BlockErase(0x40000, 0x200000 - 0x40000);

In addition, I have found that when an exception occurs during the first startup, there may be no exception during the second startup. Once the startup occurs without an exception, there will be no exceptions in multiple consecutive startups thereafter.

In addition, I've found that there will be no problems if I call the flash erase and write operations before lwIPInit, as shown below:

Fapi_BlockErase(0x40000, 0x200000 - 0x40000);
ipAddr = lwIPInit(0, emacAddress, 0, 0, 0, IPADDR_USE_DHCP);

In addition, we only encountered problems when erasing Bank0, and no issues were found when erasing Bank1.

 thank you. Hercules_Ethernet_Bootloader_err.zip