ZAP Memory Sections
There are various memory sections of which a programmer must be aware when writing a ZAP.
At the highest level there are three memory types:
MCU Internal Flash
- This is where the zap executable and read-only code resides
- ZentriOS also executes from this memory
MCU RAM
- This is where the zap thread's stack and global data structures reside
- ZentriOS also uses this for global data structures
- A ZAP may dynamically allocate additional RAM using malloc()
Extended Flash
- This is where zap bundles files (e.g. webpages, log files, etc) reside
- ZentriOS also uses this for sys/wifi_fw.bin and sys/safemode.bin needed for Wi-Fi functionality and fault recovery
The following diagram shows memory layout: