User Tools

Site Tools


esp:esp8266:open-sdk:flash-nonfota-firmware

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
esp:esp8266:open-sdk:flash-nonfota-firmware [2026/09/21 14:22] – oscaresp:esp8266:open-sdk:flash-nonfota-firmware [2026/09/21 14:52] (current) – [2. Crucial `esp-open-sdk` Compilation & Flashing Quirks] oscar
Line 10: Line 10:
   - **eagle.flash.bin** (Flashed at 0x00000): Contains code initialized straight into internal RAM—specifically IRAM (code required to execute with no flash latency, interrupt handlers) and DRAM (initialized global/static variables).   - **eagle.flash.bin** (Flashed at 0x00000): Contains code initialized straight into internal RAM—specifically IRAM (code required to execute with no flash latency, interrupt handlers) and DRAM (initialized global/static variables).
   - **eagle.irom0text.bin** (Flashed at offset 0x10000 or 0x20000): Contains main application code and SDK functions tagged with ICACHE_FLASH_ATTR. It remains in flash memory and is read dynamically via the Xtensa instruction cache (irom0).   - **eagle.irom0text.bin** (Flashed at offset 0x10000 or 0x20000): Contains main application code and SDK functions tagged with ICACHE_FLASH_ATTR. It remains in flash memory and is read dynamically via the Xtensa instruction cache (irom0).
-### Non-OTA Flash Map (Mapped as 4MB / 32Mbit) 
  
-In a traditional **Non-OTA** setup (referred to as `eagle.flash.bin` and `eagle.irom0text.bin` compiled via `esp-open-sdk`), the flash is mapped using **Flash Map 4** (or 6 depending on the exact SDK version configuration).+### Non-OTA Flash Maps: Map 4 vs. Map 6 
 + 
 +In a traditional **Non-OTA** setup the flash is mapped using **Flash Map 4** (or 6 depending on the exact SDK version configuration). In Espressif SDK nomenclature, **Flash Maps** correspond to numerical IDs (selected via `FLASH_SIZE` or `map` configuration during compile time). 
 + 
 +| Attribute | **Flash Map 4** | **Flash Map 6** | 
 +| --- | --- | --- | 
 +|Target Hardware|ESP-01 modules or older legacy ESP8266 boards with 512 KB flash chips|ESP-12E/F, NodeMCU, WeMos D1 Mini, and most modern ESP8266 development boards containing 4 MB flash| 
 +| **Physical Flash Size** | 512 KB (4 Mbit) | 4 MB (32 Mbit) | 
 +| **Max Code Space (`irom0`)** | ~364 KB – 428 KB | ~880 KB (Bounded by 1 MB MMU cache limit) | 
 +| **Storage Beyond 1 MB** | None | ~3 MB available for SPIFFS/LittleFS | 
 + 
 +#### 1. Flash Map 4 (512 KB Flash / 4 Mbit) 
 +**Layout Structure:** 
 +  * **`0x00000` – `0x0B000` (~44 KB):** `eagle.flash.bin` (IRAM + Data). 
 +  * **`0x10000` or `0x20000` – `0x7B000` (~364 KB to 428 KB):** `eagle.irom0text.bin` (Flash-cached application code). 
 +  * **`0x7B000` – `0x80000` (Last 20 KB):** System Parameter Area (RF calibration, Wi-Fi configuration saved by the SDK: `esp_init_data_default.bin` and `blank.bin`). 
 + 
 +#### 2. Flash Map 6 (4 MB Flash / 32 Mbit) 
 +**Layout Structure:** 
 +  * **`0x00000` – `0x0B000` (~44 KB):** `eagle.flash.bin` (IRAM + Data). 
 +  * **`0x20000` – `0xFC000` (~880 KB):** `eagle.irom0text.bin` (Flash-cached application code). 
 +  * **`0x100000` – `0x3FB000` (~3 MB):** Unmapped / Free user space (available for SPIFFS/LittleFS or user storage). 
 +  * **`0x3FC000` – `0x400000` (Last 16 KB):** System Parameter Area (`esp_init_data_default.bin` & `blank.bin`) positioned at the end of the 4 MB physical flash boundary.
  
 Because it is targeted as a 4 MB envelope, the default critical system parameters are pushed to the **very end of the first 4 MB segment**, not the physical end of the 16 MB chip. Because it is targeted as a 4 MB envelope, the default critical system parameters are pushed to the **very end of the first 4 MB segment**, not the physical end of the 16 MB chip.
- 
-| Offset Address | Size | Binary Target / Description | 
-| :--- | :--- | :--- | 
-| **`0x00000`** | ~40 KB | `eagle.flash.bin` (SDK Boot, initialized data, IRAM segments) | 
-| **`0x10000`** | Max 1 MB | `eagle.irom0text.bin` (Main application code executing from Flash) | 
-| **`0x11000`** to **`0x3FB000`** | ~3 MB | **Free User Space / Filesystem Space** | 
-| **`0x3FC000`** | 12 KB | `esp_init_data_default.bin` (System & RF Initialization parameters) | 
-| **`0x3FF000`** | 12 KB | `blank.bin` (System Parameter Save Area / Wi-Fi settings store) | 
-| *`0x400000` to `0xFFFFFF`* | *12 MB* | *Unmapped by SDK* (Raw access only via SPI flash API) | 
  
 --- ---
Line 40: Line 52:
  
 This forces the compiler to build the code assuming a single application image (Non-OTA) rather than splitting it into `user1.bin` and `user2.bin` layout profiles typical of an OTA environment. This forces the compiler to build the code assuming a single application image (Non-OTA) rather than splitting it into `user1.bin` and `user2.bin` layout profiles typical of an OTA environment.
- 
-  
  
 #### The `esptool.py` Flash Size Trick #### The `esptool.py` Flash Size Trick
  
 When flashing an `esp-open-sdk` firmware onto the WEMOS D1 Mini Pro, you must be careful with the `-fs` (flash size) parameter. If you set `-fs 16MB`, the Espressif system configuration files will be expected at the absolute end of the 16MB space (`0xFFC000`), which will cause a **boot loop** (`rf_cal_size` error) because the SDK logic is expecting them at the 4MB mark. When flashing an `esp-open-sdk` firmware onto the WEMOS D1 Mini Pro, you must be careful with the `-fs` (flash size) parameter. If you set `-fs 16MB`, the Espressif system configuration files will be expected at the absolute end of the 16MB space (`0xFFC000`), which will cause a **boot loop** (`rf_cal_size` error) because the SDK logic is expecting them at the 4MB mark.
- 
-  
  
 To successfully flash a Non-OTA open-sdk project on this board, force a 4MB size parameter during upload: To successfully flash a Non-OTA open-sdk project on this board, force a 4MB size parameter during upload:
  
 ```bash ```bash
- 
 esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash \ esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash \
- 
   -fm dio -fs 4MB \   -fm dio -fs 4MB \
- 
   0x00000 eagle.flash.bin \   0x00000 eagle.flash.bin \
- 
   0x10000 eagle.irom0text.bin \   0x10000 eagle.irom0text.bin \
- 
   0x3FC000 esp_init_data_default.bin \   0x3FC000 esp_init_data_default.bin \
- 
   0x3FF000 blank.bin   0x3FF000 blank.bin
- 
 ``` ```
  
esp/esp8266/open-sdk/flash-nonfota-firmware.1790000564.txt.gz · Last modified: by oscar