Hi,
Regarding your question, I think it is complicated, we have to discuss case by case
As you know that the LPC54016 does not have on-chip flash, all the code and constant data must be put on external spifi flash.
case 1:
If you define constant data like const uint32_t array[10]={1,2,3,4,5,6,7,8,9,10}; The array will be put into external spifi flash when you download code to flash, you can read the array no matter whether you run the code in internal RAM or XIP.
Case 2: Assume you want to write external spifi flash in application code, if you run the code in on-chip RAM(you download code to spifi flash, copy the code to on-chip RAM, and run in on-chip RAM), it is okay to erase/program spifi flash as the example code spifi_polling_transfer. If you run the code in external spifi flash(XIP mode), it is impossible to erase/program spifi flash.
Hope it can help you
BR
XiangJun Rong