Add scripts

This commit is contained in:
Thomas Farstrike
2026-02-28 22:37:41 +01:00
parent 894c9aea75
commit ab29a39a80
2 changed files with 56 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# Partition table for Fri3D Camp 2024 Badge with ESP-IDF OTA support using 16MB flash
#
# Also present in flash:
# 0x0 images/bootloader.bin
# 0x8000 images/partition-table.bin
#
# Notes:
# - app partitions should be aligned at 0x10000 (64k block)
# - otadata size should be 0x2000
#
# Name, Type, SubType, Offset, Size, Flags
otadata, data, ota, 0x9000, 0x2000,
nvs, data, nvs, 0xb000, 0x5000,
ota_0,app,ota_0,0x20000,0x400000
ota_1,app,ota_1,0x420000,0x400000
launcher, app, ota_2, 0x820000, 0x100000,
retro-core, app, ota_3, 0x930000, 0xd0000
prboom-go, app, ota_4, 0xa00000, 0xe0000,
vfs, data, fat, 0xae0000, 0x520000
1 # Partition table for Fri3D Camp 2024 Badge with ESP-IDF OTA support using 16MB flash
2 #
3 # Also present in flash:
4 # 0x0 images/bootloader.bin
5 # 0x8000 images/partition-table.bin
6 #
7 # Notes:
8 # - app partitions should be aligned at 0x10000 (64k block)
9 # - otadata size should be 0x2000
10 #
11 # Name Type SubType Offset Size Flags
12 otadata data ota 0x9000 0x2000
13 nvs data nvs 0xb000 0x5000
14 ota_0 app ota_0 0x20000 0x400000
15 ota_1 app ota_1 0x420000 0x400000
16 launcher app ota_2 0x820000 0x100000
17 retro-core app ota_3 0x930000 0xd0000
18 prboom-go app ota_4 0xa00000 0xe0000
19 vfs data fat 0xae0000 0x520000
+37
View File
@@ -0,0 +1,37 @@
# Experimental quick and dirty script to assemble an ESP32 firmware image based on a partition table, internal_filesystem directory, bootloader, and ESP32 "app" binary
mydir=$(readlink -f "$0")
mydir=$(dirname "$mydir")
# This needs python and the esptool
python3 lvgl_micropython/lib/esp-idf/components/partition_table/gen_esp32part.py --flash-size 16MB partitions_with_retro-go.csv > partitions_with_retro-go_16mb.bin
#python3 lvgl_micropython/lib/esp-idf/components/partition_table/gen_esp32part.py --flash-size 4MB partitions_4mb.csv > partitions_4mb.bin
#python3 lvgl_micropython/lib/esp-idf/components/partition_table/gen_esp32part.py --flash-size 8MB partitions_8mb.csv > partitions_8mb.bin
if [ $? -ne 0 ]; then
echo "ERROR: Converting partition csv to bin failed!"
exit 1
fi
"$mydir"/../scripts/mklittlefs.sh
prboom="~/projects/MicroPythonOS/claude/retro-go/prboom-go/build/prboom-go.bin"
launcher="~/projects/MicroPythonOS/claude/retro-go/launcher/build/launcher.bin"
core="~/projects/MicroPythonOS/claude/retro-go/retro-core/build/retro-core.bin"
#ls -al "$launcher" "$core" "$prboom"
#outdir=lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC-SPIRAM/
#~/.espressif/python_env/*/bin/python -m esptool --chip esp32 merge_bin --fill-flash-size=16MB --output image_esp32.bin 0x1000 "$outdir"/bootloader/bootloader.bin 0x8000 partitions_with_retro-go.bin 0x20000 "$outdir"/micropython.bin 0x820000 "$launcher" 0x930000 "$core" 0xa00000 "$prboom" # 0xae0000 "$mydir"/../internalsd_zips_removed_gb_romart.bin $@
outdir=lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/
rm image_esp32s3.bin
#~/.espressif/python_env/*/bin/python -m esptool --chip esp32s3 merge_bin --fill-flash-size=4MB --output image_esp32s3.bin 0x0 "$outdir"/bootloader/bootloader.bin 0x8000 partitions_for_qemu.bin 0x20000 "$outdir"/micropython.bin # 0x820000 "$launcher" 0x930000 "$core" 0xa00000 "$prboom" # 0xae0000 "$mydir"/../internalsd_zips_removed_gb_romart.bin $@
#~/.espressif/python_env/*/bin/python -m esptool --chip esp32s3 merge_bin --fill-flash-size=8MB --output image_esp32s3.bin 0x0 "$outdir"/bootloader/bootloader.bin 0x8000 partitions_for_qemu.bin 0x20000 "$outdir"/micropython.bin 0x3A0000 "$mydir"/../internal_filesystem.bin $@
~/.espressif/python_env/*/bin/python -m esptool --chip esp32s3 merge_bin --fill-flash-size=16MB --output image_esp32s3.bin 0x0 "$outdir"/bootloader/bootloader.bin 0x8000 partitions_with_retro-go_16mb.bin 0x20000 "$outdir"/micropython.bin 0x820000 "$launcher" 0x930000 "$core" 0xa00000 "$prboom" 0xae0000 "$mydir"/../internal_filesystem.bin $@
# Building an image based on an Arduino IDE build also works, although I only tried arduino-esp32 v2.x and not to v3.x
#outdir=~/.cache/arduino/sketches/4012C161135E5B60169BDFEA7F67E0C6
#sketch=Test_Read_Flash.ino
#outdir=~/.cache/arduino/sketches/DF69B76A41013B091A4C9C10734C1710
#sketch=Test_Download_File.ino
#~/.espressif/python_env/*/bin/python -m esptool --chip esp32s3 merge_bin --fill-flash-size=16MB --output image_esp32s3.bin 0x0 "$outdir"/"$sketch".bootloader.bin 0x8000 "$outdir"/"$sketch".partitions.bin 0x10000 "$outdir"/"$sketch".bin