I want my application to decide if the next boot will be on internal flash or qspi external flash.
Is it possible to my application to write the FOPT value?
Although I am not clear about the condition under which you update the code and boot from different source, I think it is okay to change value in the 0x40D and launch software Reset in your application code. You can copy the page from 0x400 to an array, then execute page erase to erase the page from 0x400 in your application code, then modify the array corresponding 0x40d, then program the array to the page from 0x400. afterwards, you can execute software reset by setting the SYSRESETREQ bit in AIRCR register. For detailed inf, pls refer to user guide of Cortex-M4. After software reset, the K8x will reset based on new FOPT.
Hope it can help you
My main doubt now is on how to make my application in order to run on qspi.
I am working on MCUXPRESSO.
The initial vectors area, Flash config and BCA should stay on internal flash?
Retrieving data ...