I am working on a TMS320F28377D processor. I modified the dual flash application example to implement flash erase/write on CPU1-2.
The application on both processors have watchdog enabled and service it in between flash operations.
The application on CPU1 erases multiple flash sectors(C, H, I, J), then writes them with data from USB. The IPC flag is then set to allow CPU2 do the same.
On startup CPU2 waits for IPC flag to be set. Then erases multiple sectors (C, H, I, J) , Sets IPC flag for CPU1 and goes into infinite loop.
After CPU2 sets IPC flag, CPU1 erases one flash sector (A) and goes into infinite while loop without servicing watchdog. This triggers system reboot and operation restarts.
Runing this application standalone causes multiple sectors to be erased and programmed programmed between bootups.
Most of the time operation is normal as expected. However sometimes during the erase operation the system hangs and reboots when watchdogs expire.
The troubling thing is that between crash and reboot multiple GPIOs that were set-up as outputs change their state(some previously low GPIOS go high and some that were high are driven low.)
This behaviour can be seen in the image below. Some GPIO lines are set during code operation to visualise what happens when.
The full timeline waveform at the top of the image shows multiple operations between reboots.
When yellow line goes low the operation starts, when it goes high the CPU1 goes to infinite while loop and stops servicing watchdog. When line goes low the procesor was reset and restarted.
The two complete operation-reboot cycles can be seen and one failed.
The zoomed in portion of the screenshot shows the GPIO lines changing their state. None of these changes are executed in the code.
The blue and yellow GPIOs are set high before flash erase and the remaining toggle happens when system crash.
I made sure that flash that is erased is not assigned to system resources in the command linker file.
The FAPI functions are loaded and run from RAMLS3-4.
running this for some time and triggering on GPIOS that should not be written to, shows that this crash and GPIO glitch happens during flash Erase.
Sometimes the one in the middle of application, sometimes in the end of application.
Any ideas of what might cause this would help a lot.
Thanks Ugnius.