Werner
I did some investigations:
1. When I run the code from QSPI flash commanded resets and WDOG-3 timeouts cause the processor to restart and the rest cause is correctly identified. Therefore I don't believe that the power supply to the processor generally needs to be removed during a reset. This seems to be inverse to what you find on your HW (?)
2. I added an output that is toggled a number of times as soon as the processor starts running code so I can reliably see whether it starts or not. Also I have a logic analyser monitoring the QSPI lines to see activity there.
3. When I move the program to internal RAM instead of leaving it in QSPI flash there are no QSPI accesses when it is operating. The flexSPI LUT is changed and the RAM is re-organised, but otherwise the program runs as before, apart from the fact that it doesn't restart when a reset is commanded or when the watchdog fires - a reset takes place since outputs that were active (eg. driving the LED) become inputs.
In this state I see neither any QSPI Flash accesses nor that the program starts (it doesn't toggle the output as it does as soon as it starts). I cannot connect to the chip with the debugger in this state.
This suggests the following to me:
- a reset certainly took place
- the ROM loader didn't try to access the QSPI
- the ROM loader is not in ISP mode since the USB doesn't enumerate and also, if it were to be in this mode, I would be able to connect the debugger to the chip and see it running.
- the ROM loader must be either in a different mode (that I don't know since I can normally connect the debugger in all modes) or has crashed, leaving the processor in a state that can't be connected to.
What I don't know is whether the fact that the application changes the FlexSPI LUT setup or changes the FlexRAM (the two main differences) causes the problem - I will need to try to find a way of running from RAM without changing one of the two each time (or maybe reinstalling the states before a commanded reset is issued)
Although I don't have a final conclusion yet the intermediate results are pointing to quite a serious restriction since I have never experienced such processor behavior before. If the application's own configuration when running can effectively put the ROM loader "out of action" so the processor cannot run again without a power cycle and can't even recover from a watchdog reset one is forced to add external HW to save the situation and simple warm resets are impossible to do (adding implications for boot loader strategies and such).
I have quite a bad feeling at the moment that there is a serious bug in the chip itself and think that NXP needs to do similar tests - in fact the firmware here [https://community.nxp.com/thread/524690#comment-1270214 ] can be loaded to a standard board and shows how the reset/watchdog of the chip can be effectively completely taken out of action!!
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT]