I'm a beginner working on driving a LED driver chip via I2C with the RT1061. It runs fine in ram debug mode (LED lights up), but when using flexspi_flash_nor_debug, the hardware initialization fails both in IAR simulation or flashing with jflash. I can read the flash contents, so the code is loaded. I've checked extensively but can't find the cause. Could you please help? Thanks.
I'm using flexspi1, with code partially transplanted from the hello world example.
The keil program in the attachment zip. Thank you so much.