Hi @dani-tse ,
Thank you so much for your interest in our products and for using our community.
1. Why it worked with MCUBootUtility
MCUBootUtility generates and inserts the required FlexSPI NOR boot header (FDCB, IVT, Boot Data, ....) at the beginning of the flash image. This allows the ROM to correctly initialize the external flash and boot your application.
2. Why it worked in RAM but not in Flash
When you link the project to RAM, the debugger simply loads your code into on‑chip SRAM and runs it.
For this mode, FlexSPI NOR initialize by the ROM is not required, so your application code can run even without a valid flash boot header.
However, when the image is linked to Flash, the ROM must read a valid FDCB/IVT header first.
If the header is missing or incorrect, the ROM cannot initialize the flash and will enter Serial Downloader mode.
3. Recommended fastest method to enable XIP flash debugging on RT1020
The quickest and most reliable approach is to import an existing RT1020 SDK XIP demo and modify it.
If you are using a different flash device, adjust the flexspi_nor_config_t accordingly.
Please pay special attention to the LUT tables, since incorrect LUT settings are one of the most common causes of XIP boot failures.
Wish it helps you
Best Regards
MayLiu