How is ESP flash memory laid out/used

Exactly what I was looking for, thanks @nliviu!

Couple of things that still confuse me:

  1. Why is there ‘spare memory’ by default on ESP32? Here you mention in that post the maximum fs_* size is MGOS_ROOT_FS_SIZE=458752. Why would this not be the default?
  2. What is the impact of adjusting these variables on OTA-able firmware? I’ve reduced APP_SLOT_SIZE and increased MGOS_ROOT_FS_SIZE in increments of 4096 and built new firmware, but I’m not able to OTA
* Done waiting for 100-continue
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Server: Mongoose/6.18
< Content-Type: text/plain
< Connection: close
< 
-1 File is too big

* we are done reading and this is set to close, stop send
* Closing connection 0