arduino-esp32 icon indicating copy to clipboard operation
arduino-esp32 copied to clipboard

Custom Partition in Board Configuration do not take FLASH Mode Size into account

Open thelastoutpostworkshop opened this issue 1 year ago • 6 comments

Board

ESP32S3 Dev Module (ESP32)

Device Description

ESP32S3-WROOM-1 Development Board

Hardware Configuration

Problem occurs with no GPIO used

Version

v3.0.1

IDE Name

Arduino IDE and VS Code Extension for Arduino

Operating System

Windows 10

Flash frequency

QIO 80Mhz

PSRAM enabled

yes

Upload speed

921600

Description

I use a custom partition 4MB, no OTA, provided in the example documentation : https://github.com/espressif/arduino-esp32/blob/575a415719d875f88460ec1461408597744f7053/docs/en/tutorials/partition_table.rst#L2

Compiler report a max of 16MB for Flash, which is configured as 4MB in the board configuration in the Arduino IDE.

Le croquis utilise 5258829 octets (31%) de l'espace de stockage de programmes. Le maximum est de 16777216 octets. Les variables globales utilisent 27712 octets (8%) de mémoire dynamique, ce qui laisse 299968 octets pour les variables locales. Le maximum est de 327680 octets.

Sketch

The problem occur with an empty sketch
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Debug Message

There is no debug message, compiler report wrong flash size.

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.

thelastoutpostworkshop avatar Jun 11 '24 21:06 thelastoutpostworkshop

My custom partition in partitions.csv:

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     36K,     20K,
factory,  app,  factory, 64K,     4000K,

thelastoutpostworkshop avatar Jun 11 '24 21:06 thelastoutpostworkshop

The IDE has no way to read your custom partition scheme before running the build and take the partition size into account. That is why you select a larger partition from the menu, so you do not get bothered by "firmware will not fit".

me-no-dev avatar Jun 12 '24 05:06 me-no-dev

But the esptool read it correctly : esptool.exe" --chip esp32s3 elf2image --flash_mode dio --flash_freq 80m --flash_size 4MB and will not tell me if my code do not fit

thelastoutpostworkshop avatar Jun 12 '24 10:06 thelastoutpostworkshop

esptool has no way to relay that info back to the IDE

me-no-dev avatar Jun 12 '24 11:06 me-no-dev

I understand. I think my only option, to make sure the code fit on the ESP32, is to create the new partition table as a new file in the tools/partitions folder and edit the boards.txt.

thelastoutpostworkshop avatar Jun 12 '24 21:06 thelastoutpostworkshop

I found the solution, in boads.txt, I just have to specify the max upload size for the custom partition, 4MB in my case: esp32s3.menu.PartitionScheme.custom.upload.maximum_size=4096000

thelastoutpostworkshop avatar Jun 12 '24 23:06 thelastoutpostworkshop

Hello, I am closing this ticket as asnwered. If needed, you can reopen it.

VojtechBartoska avatar Sep 16 '24 11:09 VojtechBartoska