Browse Source

switch to new partition scheme

allow for OTA update
Andrew Tridgell 3 years ago
parent
commit
0d6e8bd6c3
2 changed files with 9 additions and 2 deletions
  1. 3 2
      RemoteIDModule/Makefile
  2. 6 0
      RemoteIDModule/partitions.csv

+ 3 - 2
RemoteIDModule/Makefile

@@ -8,6 +8,7 @@ ESPTOOL=$(ESP32_TOOLS)/esptool.py
 ESP32_FQBN=esp32:esp32:$(CHIP)
 SERDEV := $(wildcard /dev/serial/by-id/usb-Espressif_*)
 ARDUINO_CLI=../bin/arduino-cli
+APP_PARTITION_SIZE=2031616
 
 # ensure python tools are in $PATH
 export PATH := $(HOME)/.local/bin:$(PATH)
@@ -41,9 +42,9 @@ ArduRemoteID-%.bin: *.cpp *.ino *.h
 	@echo "Building $* on $(CHIP)"
 	@BUILD_FLAGS="-DBOARD_$*"
 	@rm -rf build build-$*
-	@$(ARDUINO_CLI) compile -b esp32:esp32:$(CHIP) --export-binaries --build-property build.extra_flags=-DBOARD_$* .
+	@$(ARDUINO_CLI) compile -b esp32:esp32:$(CHIP) --export-binaries --build-property build.extra_flags=-DBOARD_$* --build-property upload.maximum_size=$(APP_PARTITION_SIZE)  .
 	@echo "Merging $*"
-	@python3 $(ESPTOOL) --chip $(CHIP) merge_bin -o ArduRemoteID-$*.bin --flash_size 4MB 0xe000 $(ESP32_TOOLS)/partitions/boot_app0.bin 0x0 build/esp32.esp32.$(CHIP)/RemoteIDModule.ino.bootloader.bin 0x10000 build/esp32.esp32.$(CHIP)/RemoteIDModule.ino.bin 0x8000 build/esp32.esp32.$(CHIP)/RemoteIDModule.ino.partitions.bin
+	@python3 $(ESPTOOL) --chip $(CHIP) merge_bin -o ArduRemoteID-$*.bin --flash_size 4MB 0x0 build/esp32.esp32.$(CHIP)/RemoteIDModule.ino.bootloader.bin 0x8000 build/esp32.esp32.$(CHIP)/RemoteIDModule.ino.partitions.bin 0xe000 $(ESP32_TOOLS)/partitions/boot_app0.bin 0x10000 build/esp32.esp32.$(CHIP)/RemoteIDModule.ino.bin
 	@mv build build-$*
 
 boards:

+ 6 - 0
RemoteIDModule/partitions.csv

@@ -0,0 +1,6 @@
+# Name,   Type, SubType, Offset,  Size, Flags
+nvs,      data, nvs,     0x9000,  0x5000,
+otadata,  data, ota,     0xe000,  0x2000,
+app0,     app,  ota_0,   0x10000, 0x1f0000,
+app1,     app,  ota_1,   0x200000, 0x1f0000,
+param,    0x46, 0,       0x3f0000, 0x4000,