On the previous page you customized the kernel and filesystem with buildroot's menuconfig tool. The ESP-IDF has a similar menuconfig that lets you adjust parameters for the targeted ESP chip, such as flash size and partition table. Just like how you recompiled the file system and kernel, you can recompile the bootloader, partition table and network adapter .bin files using the following steps.
Partition Table
The partition table in an ESP-IDF project determines the file structure on the ESP32 chip. In the Docker container, the partition table file is located in /app/build/esp-hosted/esp_hosted_ng/esp_driver/network_adapter/partition_table.esp32s3
The default partition table is setup as follows:
## Label |
type |
ST |
Offset |
Length |
nvs, |
data, |
nvs, |
0x0000a000, |
0x00005000 |
phy_init, |
data, |
phy, |
0x0000f000, |
0x00001000 |
factory, |
app, |
factory, |
0x00010000, |
0x000f0000 |
linux, |
0x40, |
0x0, |
0x00100000, |
0x00300000 |
rootfs, |
0x40, |
0x1, |
0x00400000, |
0x00400000 |
You can edit the partition table directly in the Docker container by going to the Files tab and navigating to the file location. Right-click on the partition table file and you can edit it in the text editor that opens at the bottom of the screen.
The changes to the partition table only take effect after recompiling the ESP-IDF project. These steps are outlined next.
ESP-IDF menuconfig
To recompile the ESP-IDF generated .bin files, you'll run the ESP-IDF steps from the Dockerfile. In the Terminal tab in your Docker container, run these commands:
cd esp-hosted/esp_hosted_ng/esp/esp_driver && cmake . cd esp-idf && . ./export.sh cd ../network_adapter && idf.py set-target esp32s3 cp sdkconfig.defaults.esp32s3 sdkconfig
Then enter the menuconfig tool with:
idf.py menuconfig
You can change the flash size to match your target board by navigating to Serial flasher config - flash size. There you can select the flash size on your board. In the case of the Metro ESP32-S3, its 16MB.
When you're finished, save your configuration as sdkconfig (the default option) and then exit menuconfig.
Next you'll build your project with:
idf.py build
Finally you'll copy your generated .bin files to the /releases folder in the Docker container:
cd /app/build cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/bootloader/bootloader.bin release cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/partition_table/partition-table.bin release cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/network_adapter.bin release
And copy the newly generated .bin files to your local filesystem, just as you did earlier in the guide.
docker cp CONTAINER-NAME:/app/build/release/ bin_files
Now you can load your new .bin files onto your ESP32-S3 using esptool.
Text editor powered by tinymce.