User Tools

Site Tools


esp:esp32:partitions

Differences

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

Link to this comparison view

Next revision
Previous revision
esp:esp32:partitions [2025/02/08 09:14] – created - external edit 127.0.0.1esp:esp32:partitions [2026/09/12 10:28] (current) – oscar
Line 1: Line 1:
-====== Partitions ====== +# Partitions 
-===== Partition table ===== +## Partition table 
-A file called **partitions.csv** is located in the root of the esp-idf project folder. +A file called **partitions.csv** is located in the root of the esp-idf project folder. With content similar to: 
-With content similar to: +```
-<code>+
 # Name,   Type,  SubType, Offset,   Size, Flags # Name,   Type,  SubType, Offset,   Size, Flags
 nvs,      data,  nvs,     0x9000,   0x4000, nvs,      data,  nvs,     0x9000,   0x4000,
Line 12: Line 11:
 config,   data,  phy,     0x250000, 0x4000, config,   data,  phy,     0x250000, 0x4000,
 logging,  data,  phy,     0x254000, 0x145000, logging,  data,  phy,     0x254000, 0x145000,
-</code> +``` 
-===== Updating a partition table =====+## Updating a partition table 
 +### Switch to custom partitions 
 +You must tell ESP-IDF to stop using the default layout and look at your new CSV file instead. In **idf.py menuconfig** navigate to Partition Table.Change Partition Table Type from "Single factory app" to Custom partition CSV file. Ensure the Custom partition CSV filename setting is set to partitions.csv. Press S to save and Q to quit. 
 +### Build partition table
 Edit the contents of the partitions.csv file and run the following commands: Edit the contents of the partitions.csv file and run the following commands:
-<code>+```
 idf.py menuconfig idf.py menuconfig
 idf.py partition-table idf.py partition-table
 idf.py build idf.py build
-idf.py -p /dev/ttyUSB0 flash+``` 
 +### Write Partition Table to ESP32 
 +Flash the partition table by: 
 +```
 idf.py -p /dev/ttyUSB0 partition-table-flash idf.py -p /dev/ttyUSB0 partition-table-flash
-</code> +``` 
-After that do a full flash or flash the individual partitions to their new locations +Or you can do a full flash which will also write the table. 
-<code>+```
 idf.py -p /dev/ttyUSB0 flash idf.py -p /dev/ttyUSB0 flash
-</code> +``` 
- +### Read Partition Table from ESP32 
-===== Erase a partition area ===== +Read the Partition Table Flashed on a Connected ESP32If you want to pull the partition table off a physical ESP32 board to see what is currently flashed on it, you can use the target partition-table-dump. 
-  esptool_py/esptool/esptool.py --port /dev/ttyUSB0 erase_region 0x254000 0x145000 +``` 
- +idf.py -p [PORT] partition-table-dump 
-===== Full Flash ===== +``` 
-  idf.py -p /dev/ttyACM0 flash +It invokes esptool.py in the background to read the binary partition data directly from the chip's flash memory (always located at offset 0x8000 or 0x9000 depending on your SDK configuration) and prints the structure to your terminal.   
-  python -m esptool --chip esp32c3 -p /dev/ttyACM0 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0xd000 build/ota_data_initial.bin 0x10000 build/LCR-Meter.bin 0x250000 default.config +## Erase a partition area 
- +``` 
-===== Write Application to partition ===== +esptool --port /dev/ttyUSB0 erase_region 0x254000 0x145000 
-  python -m esptool --chip esp32c3 -p /dev/ttyACM0 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x10000 build/ESR-Meter.bin +``` 
 +## Full Flash 
 +``` 
 +idf.py -p /dev/ttyACM0 flash 
 +python -m esptool --chip esp32c3 -p /dev/ttyACM0 -b 460800 --before default-reset --after hard-reset write-flash --flash-mode dio --flash-size 4MB --flash-freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0xd000 build/ota_data_initial.bin 0x10000 build/LCR-Meter.bin 0x250000 default.config 
 +``` 
 +### Write Application to partition 
 +``` 
 +python -m esptool --chip esp32c3 -p /dev/ttyACM0 -b 460800 --before default_reset --after hard-reset write_flash --flash-mode dio --flash-size 4MB --flash-freq 80m 0x10000 build/ESR-Meter.bin 
 +``` 
 +### Read from partition 
 +``` 
 +esptool --port /dev/ttyACM0  write-flash --flash-mode qio  0x250000 default.config 
 +``` 
 +### Write Config to partition  
 +``` 
 +esptool --port /dev/ttyACM0  write-flash --flash-mode qio  0x250000 default.config 
 +``` 
 +###  Read CONFIG from partition 
 +``` 
 +esptool --port /dev/ttyACM0 -b 460800 --before default-reset --chip esp32c3  read-flash 0x250000 4096 downloaded.config 
 +```
  
-===== Read/Write config partition ===== 
-=== Write Config to partition === 
-  esptool.py --port /dev/ttyACM0  write_flash --flash_mode qio  0x250000 default.config 
-=== Read CONFIG from partition === 
-  esptool.py --port /dev/ttyACM0 -b 460800 --before default_reset --chip esp32c3  read_flash 0x250000 4096 downloaded.config 
  
  
esp/esp32/partitions.1739006050.txt.gz · Last modified: by 127.0.0.1