4

I'm using arduino-cli to program an ESP32-S2. If I compile my sketch using the default partition scheme

> arduino-cli compile -b esp32:esp32:esp32s2 sketch

a lot of space is allocated for SPIFFS and OTA, which I don't use.

Sketch uses 646558 bytes (49%) of program storage space. Maximum is 1310720 bytes.Global variables use 39540 bytes (12%) of dynamic memory, leaving 288140 bytes for local variables. Maximum is 327680 bytes.

Thus. I'd like to use thehuge_app scheme, as defined in the boards.txt:

esp32s2.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)esp32s2.menu.PartitionScheme.huge_app.build.partitions=huge_appesp32s2.menu.PartitionScheme.huge_app.upload.maximum_size=3145728

However, selecting it doesn't have any effect:

> arduino-cli compile -b esp32:esp32:esp32s2 sketch --build-property build.partitions=huge_appSketch uses 646558 bytes (49%) of program storage space. Maximum is 1310720 bytes.Global variables use 39540 bytes (12%) of dynamic memory, leaving 288140 bytes for local variables. Maximum is 327680 bytes.

Is my command line incorrect? Why is arduino-cli not using the specified partition scheme?

dda's user avatar
dda
1,5951 gold badge12 silver badges18 bronze badges
askedJun 8, 2023 at 12:12
larsb's user avatar
3
  • 1
    according to platform.txt it isbuild.custom_partitions the value is the selected partitioning from boards.txtCommentedJun 8, 2023 at 13:50
  • Thanks for your suggestion, I've checked platform.txt and foundcustom_partitions as well. Unfortunately, it didn't help:arduino-cli compile sketch --build-property build.custom_partitions=huge_app results inSketch uses 646558 bytes (49%) of program storage space. Maximum is 1310720 bytes.CommentedJun 8, 2023 at 14:11
  • Are you uploading the bin file by arduino-cli?CommentedJul 25, 2023 at 23:06

2 Answers2

2

So, it turns out I have to add another build property:

> arduino-cli compile --build-property build.partitions=huge_app --build-property upload.maximum_size=3145728 sketch

where theupload.maximum.size is from theboards.txt file. Indeed, a maze of twisty little files, all alike.

answeredJun 8, 2023 at 14:37
larsb's user avatar
0
2

An alternative solution is to append menu options to the fully qualified board name (FQBN), with the first separated by another colon (:) and the remainder separated with commas.

e.g.arduino-cli compile -b esp32:esp32:esp32s3:PartitionScheme=huge_app,DebugLevel=verbose

The ordering doesn't matter, just match the menu section names (as key) to the subsection names (as value).

Find the entries inboards.txt from arduino-esp32, or with something like

arduino-cli board details --fqbn=esp32:esp32:esp32s3 --config-file C:\Users\tyeth\.arduinoIDE\arduino-cli.yaml

(you can add board manager urls as args but config file is easier and often already there).

--additional-urls="https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json,https://adafruit.github.io/arduino-board-index/package_adafruit_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json"

The other bit that threw me in the past was if using a custom build of arduino-lib-builder for esp then your FQBN beginsespressif: notesp32:

answeredJul 23 at 22:23
Tyeth's user avatar

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.