cancel
Showing results for 
Search instead for 
Did you mean: 

Is that possible to write into external flash when the code is excuted from external flash?

SS.6
Associate

Hi all, I would like to know whether the write access to external flash is possible when the code execution is from external flash? When I tried to write on external flash HAL function returns driver busy, since it's been used in memory mapped mode for XIP.  

3 REPLIES 3

No, generally external NOR devices don't permit erase/write and read operation to occur concurrently.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rowant
Associate

Not if the code to do the writing is on the external flash. Memory mapped mode is read only. To write, you could have some blocking code on your internal flash that disables memory mapped mode, performs the write and then re-enables memory mapped mode before returning.

SS.6
Associate

Thanks Clive.

Can we switch to indirect mode to write the data into external flash(not in the code region), then switch back to memory mapped mode. If it is possible, from where the code will be executed if switch to indirect mode.

Rowant,

Thanks for the reply. Means my actual application will be stalled, jump to internal flash to write the data into external flash.