Hi, the flash I use is S26KS256S. I use the upper half of the flash memory space for the second bootloader (0x60000000~0x60040000) and the remaining space for my applications.
I referred to the AN12604 manual, transplanted the "polling_transfer" example in the SDK "SDK_2_14_0_EVKB-IMXRT1050", transplanted the hyperflash operation related functions into my software and placed it in SRAM.
When I used debug to check the action of the second bootloader operating hyperflash, I discovered a strange phenomenon.
1) If I use free run, the program will crash when executing flexspi_nor_flash_erase_sector; after pausing debugging, the program will get stuck in the MCUboot.

------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------
2)If I add a breakpoint in the flexspi_nor_flash_erase_sector function, the flash erase operation can be completed successfully and the program can continue execution.

------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------

How to solve this problem?
Is hyperflash can erase/program it self? Are there any examples that I can refer to?