build partition table allocation should not cause overflow

timboesp
Posts: 18
Joined: Fri Apr 26, 2019 6:24 pm

build partition table allocation should not cause overflow

Postby timboesp » Tue Apr 11, 2023 10:00 pm

Hi, please help me with this issue. I'm a big fan of esp-idf and espressif's ESP32 SoC's.

I've been building and running my "Receiver-v1" project fine until now after a few minor changes that I'm aware of I'm getting
an "overflow" error, see below.

See my partition table below where the factory app factory partition is 0x14030, however the error suggests that the smallest partition is only 0x100000 bytes. But it isn't. What's up with this?

Please advise how I can help you help me. Thanks

Note: I have changed some of the paths to hide real info. Thanks

Code: Select all

.....
Bootloader binary size 0x6400 bytes. 0xc00 bytes (11%) free.
[4/6] Generating binary image from built executable
esptool.py v3.3.3-dev
Creating esp32 image...
Merged 25 ELF sections
Successfully created esp32 image.
Generated /home/timboesp/workspace/Receiver-v1/build/receiverv1.bin
[5/6] cd /home/timboesp/workspace/Receiver-v1/build/esp-idf/esptool_py && /home/timboesp/.esp...table/partition-table.bin /home/timboesp/workspace/Receiver-v1/build/receiverv1.bin
FAILED: esp-idf/esptool_py/CMakeFiles/app_check_size 
cd /home/timboesp/workspace/Receiver-v1/build/esp-idf/esptool_py && /home/timboesp/.espressif/python_env/idf4.4_py3.8_env/bin/python /home/timboesp/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/timboesp/workspace/Receiver-v1/build/partition_table/partition-table.bin /home/timboesp/workspace/Receiver-v1/build/receiverv1.bin
Error: app partition is too small for binary receiverv1.bin size 0x10ce40:
  - Part 'factory' 0/0 @ 0x10000 size 0x100000 (overflow 0xce40)
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Here is my partition table found at ~/workspace/Receiver-v1/partition_table/partitionTable.csv

Code: Select all

# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,16K,
OTA Data,data,ota,0xd000,8K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,0x140300,
ota 0,app,ota_0,0x160000,0x140300,
ota 1,app,ota_1,0x2b0000,0x140300,
esp-idf release/v4.4
vscode
ubuntu 20.04

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: build partition table allocation should not cause overflow

Postby MicroController » Tue Apr 11, 2023 11:42 pm

Did you set up/enable use of your custom partition table in menuconfig?
If you did, check if the entry is still there. ESP-IDF throws away your configuration (sdkconfig &c.) sometimes (e.g. when setting a "new" target.)

timboesp
Posts: 18
Joined: Fri Apr 26, 2019 6:24 pm

Re: build partition table allocation should not cause overflow

Postby timboesp » Wed Apr 12, 2023 8:18 pm

Yes that was it. My flash size, which was 8M got dropped to 2M too.
thx

timboesp
Posts: 18
Joined: Fri Apr 26, 2019 6:24 pm

Re: build partition table allocation should not cause overflow

Postby timboesp » Thu Apr 13, 2023 8:53 pm

@MicroController

I realized that I was looking at the wrong partition table. I have an ESP32 with 4M flash. and my binary, if I understand right is 1073120 bytes.

What is the issue. I seem to have enough memory for this 4MB flash ESP32??

I don't get the error message: "E (653) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed." ???

Where does 8192k come from?

Thank you for your help.


Here my actual partition table in effect:

Code: Select all

# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs,      data, nvs,     0x9000,  0x4000,
OTA Data,  data, ota, 0xd000, 0x2000,
phy_init, data, phy,     0xf000,  0x1000,

# partition table for 4MB
factory,  app,  factory, 0x10000, 0x140300,
ota 0,  app,  ota_0, , 0x140300,
ota 1,  app,  ota_1, , 0x140300,

# partition table for 8MB
# factory,  app,  factory, 0x10000, 0x285B55,
# ota 0,  app,  ota_0, , 0x285B55,
# ota 1,  app,  ota_1, , 0x285B55,
Here's my build and error:

Code: Select all

....
Generated /home/<>Receiver-v1/build/receiverv1.bin
[1282/1283] cd /home/<>Receiver-v1/build/esp-idf/esptool_py && /home/<>/.espressif/python_env/idf4.4_py3.8_env/bin/python .../<>Receiver-v1/build/partition_table/partition-table.bin /home/<>Receiver-v1/build/receiverv1.bin
receiverv1.bin binary size 0x105fe0 bytes. Smallest app partition is 0x140300 bytes. 0x3a320 bytes (18%) free.
[1282/1283] cd /home/<>/esp/esp-idf/components/esptool_py && /usr/bin/cmake -D IDF_PATH="/home/<>/esp/esp-idf" -D SERIAL_TOOL="/home/<>/.espressi...args" -D WORKING_DIRECTORY="/home/<>Receiver-v1/build" -P /home/<>/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool.py esp32 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 8MB 0x1000 bootloader/bootloader.bin 0x10000 receiverv1.bin 0x8000 partition_table/partition-table.bin 0xd000 ota_data_initial.bin
esptool.py v3.3.3-dev
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-D0WDQ6 (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: a4:cf:12:44:ba:c8
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00010000 to 0x00115fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000d000 to 0x0000efff...
Compressed 25600 bytes to 16092...
Writing at 0x00001000... (100 %)
Wrote 25600 bytes (16092 compressed) at 0x00001000 in 0.7 seconds (effective 299.4 kbit/s)...
Hash of data verified.
Compressed 1073120 bytes to 627445...
Writing at 0x00010000... (2 %)
Writing at 0x0001b12b... (5 %)
Writing at 0x000287f9... (7 %)
Writing at 0x000334b5... (10 %)
Writing at 0x00049d4b... (12 %)
Writing at 0x0004f929... (15 %)
Writing at 0x000569da... (17 %)
Writing at 0x0005cbbe... (20 %)
Writing at 0x00062874... (23 %)
Writing at 0x00069b0d... (25 %)
Writing at 0x0006ffc0... (28 %)
Writing at 0x00075b82... (30 %)
Writing at 0x0007bae7... (33 %)
Writing at 0x000814fe... (35 %)
Writing at 0x00086e45... (38 %)
Writing at 0x0008c609... (41 %)
Writing at 0x0009209e... (43 %)
Writing at 0x000981ae... (46 %)
Writing at 0x0009dc3f... (48 %)
Writing at 0x000a3386... (51 %)
Writing at 0x000a98cc... (53 %)
Writing at 0x000af3e9... (56 %)
Writing at 0x000b4eff... (58 %)
Writing at 0x000ba272... (61 %)
Writing at 0x000bf55d... (64 %)
Writing at 0x000c4969... (66 %)
Writing at 0x000c9e36... (69 %)
Writing at 0x000cf52f... (71 %)
Writing at 0x000d4e28... (74 %)
Writing at 0x000dae5a... (76 %)
Writing at 0x000e0848... (79 %)
Writing at 0x000e6241... (82 %)
Writing at 0x000ebf7e... (84 %)
Writing at 0x000f28b8... (87 %)
Writing at 0x000fb084... (89 %)
Writing at 0x00103840... (92 %)
Writing at 0x0010951c... (94 %)
Writing at 0x0010f0e3... (97 %)
Writing at 0x00114313... (100 %)
Wrote 1073120 bytes (627445 compressed) at 0x00010000 in 15.0 seconds (effective 572.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 145...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (145 compressed) at 0x00008000 in 0.0 seconds (effective 549.3 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 31...
Writing at 0x0000d000... (100 %)
Wrote 8192 bytes (31 compressed) at 0x0000d000 in 0.1 seconds (effective 760.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
Executing action: monitor
Serial port /dev/ttyUSB0
Connecting.....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Running idf_monitor in directory /home/<>Receiver-v1
Executing "/home/<>/.espressif/python_env/idf4.4_py3.8_env/bin/python /home/<>/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix xtensa-esp32-elf- --target esp32 --revision 0 /home/<>/>Receiver-v1/build/receiverv1.elf -m '/home/<>/.espressif/python_env/idf4.4_py3.8_env/bin/python' '/home/<>/esp/esp-idf/tools/idf.py'"...
--- idf_monitor on /dev/ttyUSB0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6628
load:0x40078000,len:15060
load:0x40080400,len:3816
0x40080400: _init at ??:?

entry 0x40080698
I (27) boot: ESP-IDF v4.4.4-340-g4c7d97e2bd-dirty 2nd stage bootloader
I (27) boot: compile time 11:23:50
I (28) boot: chip revision: v1.0
I (32) boot.esp32: SPI Speed      : 40MHz
I (36) boot.esp32: SPI Mode       : DIO
I (41) boot.esp32: SPI Flash Size : 8MB
I (45) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (54) boot: ## Label            Usage          Type ST Offset   Length
I (62) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (69) boot:  1 OTA Data         OTA data         01 00 0000d000 00002000
I (77) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  3 factory          factory app      00 00 00010000 00140300
I (91) boot:  4 ota 0            OTA app          00 10 00160000 00140300
I (99) boot:  5 ota 1            OTA app          00 11 002b0000 00140300
I (106) boot: End of partition table
I (111) boot: Defaulting to factory image
I (115) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=36e74h (224884) map
I (205) esp_image: segment 1: paddr=00046e9c vaddr=3ffb0000 size=030e8h ( 12520) load
I (210) esp_image: segment 2: paddr=00049f8c vaddr=40080000 size=0608ch ( 24716) load
I (221) esp_image: segment 3: paddr=00050020 vaddr=400d0020 size=b6220h (746016) map
I (491) esp_image: segment 4: paddr=00106248 vaddr=4008608c size=0fd74h ( 64884) load
I (529) boot: Loaded app from partition at offset 0x10000
I (529) boot: Disabling RNG early entropy source...
I (541) cpu_start: Pro cpu up.
I (541) cpu_start: Starting app cpu, entry point is 0x4008138c
0x4008138c: call_start_cpu1 at /home/<>/esp/esp-idf/components/esp_system/port/cpu_start.c:148

I (0) cpu_start: App cpu up.
I (557) cpu_start: Pro cpu start user code
I (557) cpu_start: cpu freq: 160000000
I (557) cpu_start: Application information:
I (562) cpu_start: Project name:     receiverv1
I (567) cpu_start: App version:      8cba0f3-dirty
I (573) cpu_start: Compile time:     Apr 13 2023 15:37:42
I (579) cpu_start: ELF file SHA256:  b030105197ba5135...
I (585) cpu_start: ESP-IDF:          v4.4.4-340-g4c7d97e2bd-dirty
I (592) cpu_start: Min chip rev:     v0.0
I (596) cpu_start: Max chip rev:     v3.99
I (601) cpu_start: Chip rev:         v1.0
I (606) heap_init: Initializing. RAM available for dynamic allocation:
I (613) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (619) heap_init: At 3FFB7620 len 000289E0 (162 KiB): DRAM
I (625) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (632) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (638) heap_init: At 40095E00 len 0000A200 (40 KiB): IRAM
I (646) spi_flash: detected chip: winbond
I (649) spi_flash: flash io: dio
E (653) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed.

assert failed: do_core_init startup.c:328 (flash_ret == ESP_OK)
....

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: build partition table allocation should not cause overflow

Postby MicroController » Thu Apr 13, 2023 9:11 pm

Check menuconfig -> Serial flasher config -> Flash size

timboesp
Posts: 18
Joined: Fri Apr 26, 2019 6:24 pm

Re: build partition table allocation should not cause overflow

Postby timboesp » Fri Apr 14, 2023 3:24 am

Thanks again!

Who is online

Users browsing this forum: No registered users and 81 guests