Probably a dumb question, but how is the ESP8266 memory laid out, particularly in an OTA setup? My naive impression is that the code/data downloaded over the air ends up being initially stored in the external serial flash chip typically located on the 8266 module. Does the processor execute instructions from that memory (presumably with the aid of the CPU data/instruction cache)? It's also my understanding that the external serial flash chip is at least one order of magnitude slower than the internal CPU instruction memory, so any implementation must depend on good cache design to obtain any decent performance.

Is any of my code able to reside in the main CPU instruction memory along-side the OTA code, or is that memory completely dedicated to OTA functionality?

Where does 'my code' reside when I use the serial port to download code?

Thanks,