Let me describe the problem once again, now from a perspective of some new observations.
My MCU is configured (with fuses) to boot from SNOR flash.
From MCU Express I'm running an application based on flexspi_nor_polling_transfer example.
When I power on the MCU with flash empty (after chip erase) the application can't access flash, vendor id is 0xff and it hangs (as described in my initial post). The same happens when I power on with some random data written to flash.
As I understand, this is because the boot ROM is trying to boot from flash and it initializes flash/flexspi with configuration block in flash - which is not valid. This puts flash/flexspi in a sort of invalid state, causing issues when I run my application.
I found I can "fix" it by performing any flash operation from the GUITool - apparently it somehow resets/reconfigures the system so that my application can work with the flash correctly. Until next power cycle.
The issue does not happen when I write to flash a valid binary with a valid configuration block at 0x400.
My question now is what does the driver used by the GUITool do so that flash/flexspi is ok after its use? I would like to do the same from my application so that it can reliably access flash in all circumstances.
I hope this is clear now. :smileyhappy:
Thanks.