Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write_flash error with Development version #1337

Open
FranckFreiburger opened this issue Mar 21, 2024 · 15 comments
Open

write_flash error with Development version #1337

FranckFreiburger opened this issue Mar 21, 2024 · 15 comments

Comments

@FranckFreiburger
Copy link

FranckFreiburger commented Mar 21, 2024

Hello,

after changing from Stable version platform = espressif32
to Development version platform = https://github.com/platformio/platform-espressif32.git
I encounter the following error:

Uploading .pio\build\esp32dev_DEBUG\firmware.bin
usage: esptool write_flash [-h] [--erase-all]
                           [--flash_freq {keep,80m,60m,48m,40m,30m,26m,24m,20m,16m,15m,12m}]
                           [--flash_mode {keep,qio,qout,dio,dout}]
                           [--flash_size {detect,keep,256KB,512KB,1MB,2MB,2MB-c1,4MB,4MB-c1,8MB,16MB,32MB,64MB,128MB}]
                           [--spi-connection SPI_CONNECTION] [--no-progress]
                           [--verify] [--encrypt]
                           [--encrypt-files <address> <filename> [<address> <filename> ...]]
                           [--ignore-flash-encryption-efuse-setting] [--force]
                           [--compress | --no-compress]
                           <address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: Detected overlap at address: 0x8000 for file: C:\...\.pio\build\esp32dev_DEBUG\partitions.bin
*** [upload] Error 2

using the following partition file:

# Name,   Type, SubType,  Offset,   Size,  Flags
nvs      , data  , nvs   ,         , 0x3000
otadata  , data  , ota   ,         , 0x2000
phy_init , data  , phy   ,         , 0x1000
ota_0    , app   , ota_0 ,         , 1600K
storage  , data  , fat   , 0x2ff000, 1024K

platformio.ini:

[env:esp32dev]
platform = https://github.com/platformio/platform-espressif32.git
framework = espidf

board = esp32dev
board_build.flash_mode = qio
board_build.f_flash = 80000000L
upload_speed = 921600

monitor_speed = 115200
monitor_filters = direct, esp32_exception_decoder

board_build.partitions = default.csv
board_build.filesystem = fatfs
board_build.data_dir = data

build_type = release
build_flags = -DRELEASE -DNDEBUG 

[env:esp32dev_DEBUG]
extends = env:esp32dev
build_type = debug
build_flags = -D DEBUG


Thank you in advance for your help.

@valeros
Copy link
Member

valeros commented Mar 21, 2024

Hi @FranckFreiburger, it's strange, but I cannot reproduce the issue. Could you please open a new terminal window in the IDE, run the upload command in verbose mode pio run -t upload --verbose and share here the exact esptool command.

@FranckFreiburger
Copy link
Author

just note that I have have 2 configurations in my platformio.ini (see above)
the [env:esp32dev] uploads properly whereas [env:esp32dev_DEBUG] fails with the error

Here is the result of pio run -t upload --verbose:


.pio\build\esp32dev\firmware.elf  :

section                                                                                 size         addr

.rtc.text                                                                                  0   1074528256

.rtc.dummy                                                                                 0   1073217536

.rtc.force_fast                                                                            4   1073217536

.rtc_noinit                                                                                0   1342177280

.rtc.force_slow                                                                            0   1342177280

.rtc_fast_reserved                                                                         0   1073225728

.rtc_slow_reserved                                                                        24   1342185448

.iram0.vectors                                                                          1027   1074266112

.iram0.text                                                                            92863   1074267140

.dram0.data                                                                            14164   1073414144

.ext_ram_noinit                                                                            0   1065353216

.noinit                                                                                    0   1073428308

.ext_ram.bss                                                                               0   1065353216

.dram0.bss                                                                            154048   1073428312

.flash.appdesc                                                                           256   1061158944

.flash.rodata                                                                         156852   1061159200

.flash.rodata_noload                                                                   15054   1061316052

.flash.text                                                                           895887   1074593824

.iram0.text_end                                                                            1   1074360003

.iram0.data                                                                                0   1074360004

.iram0.bss                                                                                 0   1074360004

.dram0.heap_start                                                                          0   1073582360

.xt.prop                                                                              746232            0

.xt.lit                                                                                17912            0

.xtensa.info                                                                              56            0

.comment                                                                                 285            0

.xt.lit._ZN3nvs4Lock4initEv                                                                0            0

.xt.prop._ZN3nvs4Lock4initEv                                                              72            0

.xt.prop._ZN14intrusive_listI14NVSHandleEntryE5eraseENS1_8iteratorE                       84            0

.xt.lit._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE17clearAndFreeNodesEv           0            0

.xt.prop._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE17clearAndFreeNodesEv        108            0

.xt.prop._ZN19CompressedEnumTableIbLj1ELj256EE3setEjb                                     48            0

.xt.prop._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE9push_backEPS2_               60            0

.xt.prop._ZTVN3nvs15NVSHandleSimpleE                                                      12            0

.xt.lit._ZN3nvs12NVSPartitionD5Ev                                                          0            0

.xt.prop._ZN3nvs12NVSPartitionD5Ev                                                         0            0

.xt.prop._ZN3nvs12NVSPartitionD2Ev                                                        36            0

.xt.prop._ZN3nvs12NVSPartitionD0Ev                                                        36            0

.xt.prop._ZTVN3nvs12NVSPartitionE                                                         12            0

.xt.lit._ZN3nvs19NVSPartitionManagerD5Ev                                                   0            0

.xt.prop._ZN3nvs19NVSPartitionManagerD5Ev                                                  0            0

.xt.prop._ZN3nvs19NVSPartitionManagerD2Ev                                                 36            0

.xt.prop._ZN3nvs19NVSPartitionManagerD0Ev                                                 36            0

.xt.prop._ZN14intrusive_listIN3nvs12NVSPartitionEE5eraseENS2_8iteratorE                   84            0

.xt.prop._ZN14intrusive_listIN3nvs15NVSHandleSimpleEE5eraseENS2_8iteratorE                84            0

.xt.prop._ZTVN3nvs19NVSPartitionManagerE                                                  12            0

.xt.prop._ZN14intrusive_listIN3nvs8HashList13HashListBlockEE5eraseENS3_8iteratorE         84            0

.xt.lit._ZN3nvs4ItemC5EhNS_8ItemTypeEhPKch                                                 0            0

.xt.prop._ZN3nvs4ItemC5EhNS_8ItemTypeEhPKch                                                0            0

.xt.prop._ZN3nvs20isVariableLengthTypeENS_8ItemTypeE                                      48            0

.xt.prop._ZN3nvs4ItemC2EhNS_8ItemTypeEhPKch                                               60            0

.xt.prop._ZNK19CompressedEnumTableIN3nvs4Page10EntryStateELj2ELj126EE3getEjPS2_           48            0

.xt.prop._ZN19CompressedEnumTableIN3nvs4Page10EntryStateELj2ELj126EE3setEjS2_             48            0

.xt.lit._ZN14intrusive_listIN3nvs4PageEE5clearEv                                           0            0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE5clearEv                                         60            0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE9push_backEPS1_                                  60            0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE5eraseENS2_8iteratorE                            84            0

.xt.prop._ZTISt9exception                                                                 12            0

.xt.prop._ZTISt9bad_alloc                                                                 12            0

.xt.prop._ZTVN10__cxxabiv120__si_class_type_infoE                                         12            0

.xt.prop._ZTVSt9bad_alloc                                                                 12            0

.xt.prop._ZTVN10__cxxabiv117__class_type_infoE                                            12            0

.xt.lit._ZNK9__gnu_cxx24__concurrence_lock_error4whatEv                                    8            0

.xt.lit._ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv                                  8            0

.xt.lit._ZN9__gnu_cxx24__concurrence_lock_errorD5Ev                                        8            0

.xt.lit._ZN9__gnu_cxx26__concurrence_unlock_errorD5Ev                                      8            0

.xt.lit._ZN9__gnu_cxx7__mutex4lockEv                                                       8            0

.xt.lit._ZN9__gnu_cxx7__mutex6unlockEv                                                     8            0

.xt.prop._ZNK9__gnu_cxx24__concurrence_lock_error4whatEv                                  48            0

.xt.prop._ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv                                48            0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD5Ev                                      12            0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD5Ev                                    12            0

.xt.prop._ZN9__gnu_cxx7__mutex4lockEv                                                     48            0

.xt.prop._ZN9__gnu_cxx7__mutex6unlockEv                                                   48            0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD2Ev                                      36            0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD2Ev                                    36            0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD0Ev                                      36            0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD0Ev                                    36            0

.xt.prop._ZTIN9__gnu_cxx24__concurrence_lock_errorE                                       12            0

.xt.prop._ZTIN9__gnu_cxx26__concurrence_unlock_errorE                                     12            0

.xt.prop._ZTVN9__gnu_cxx24__concurrence_lock_errorE                                       12            0

.xt.prop._ZTVN9__gnu_cxx26__concurrence_unlock_errorE                                     12            0

.xt.prop._ZN12Flash_Access5flushEv                                                        36            0

.xt.prop._ZTV9Partition                                                                   12            0

.xt.prop._ZTV8WL_Flash                                                                    12            0

.debug_frame                                                                          174480            0

.debug_info                                                                          4922348            0

.debug_abbrev                                                                         536640            0

.debug_loc                                                                           1430313            0

.debug_aranges                                                                         71024            0

.debug_ranges                                                                         182848            0

.debug_line                                                                          3168989            0

.debug_str                                                                            633228            0

.debug_loclists                                                                        87235            0

.debug_line_str                                                                        19518            0

.debug_rnglists                                                                         3447            0

Total                                                                               13326523
<lambda>(["upload"], [".pio\build\esp32dev\firmware.bin"])
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
BeforeUpload(["upload"], [".pio\build\esp32dev\firmware.bin"])
Auto-detected: COM4
"C:\Users\USER\.platformio\penv\Scripts\python.exe" "C:\Users\USER\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32 --port "COM4" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 
4MB 0x1000 C:\...\my_project\.pio\build\esp32dev\bootloader.bin 0x8000 C:\...\my_project\.pio\build\esp32dev\partitions.bin 0xc000 C:\...\my_project\.pio\build\esp32dev\ota_data_initial.bin 0x10000 .pio\build\esp32dev\firmware.bin  
esptool.py v4.5.1
Serial port COM4
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: c8:f0:9e:9b:55:90
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000c000 to 0x0000dfff...
Flash will be erased from 0x00010000 to 0x0012bfff...
Compressed 25152 bytes to 15847...
Writing at 0x00001000... (100 %)
Wrote 25152 bytes (15847 compressed) at 0x00001000 in 0.7 seconds (effective 273.7 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 134...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (134 compressed) at 0x00008000 in 0.1 seconds (effective 331.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 31...
Writing at 0x0000c000... (100 %)
Wrote 8192 bytes (31 compressed) at 0x0000c000 in 0.1 seconds (effective 563.2 kbit/s)...
Hash of data verified.
Compressed 1161168 bytes to 802595...
Writing at 0x00010000... (2 %)
Writing at 0x00019c1c... (4 %)
Writing at 0x000244ae... (6 %)
Writing at 0x0002a0c2... (8 %)
Writing at 0x0002fcba... (10 %)
Writing at 0x0003afca... (12 %)
Writing at 0x00040543... (14 %)
Writing at 0x00045c6a... (16 %)
Writing at 0x0004b06e... (18 %)
Writing at 0x00050266... (20 %)
Writing at 0x00055ab6... (22 %)
Writing at 0x0005b14a... (24 %)
Writing at 0x000600c7... (26 %)
Writing at 0x00065430... (28 %)
Writing at 0x0006a890... (30 %)
Writing at 0x0006fd9b... (32 %)
Writing at 0x00075226... (34 %)
Writing at 0x0007a276... (36 %)
Writing at 0x0007fa4d... (38 %)
Writing at 0x00084b4b... (40 %)
Writing at 0x00089b22... (42 %)
Writing at 0x0008ef19... (44 %)
Writing at 0x00094646... (46 %)
Writing at 0x00099434... (48 %)
Writing at 0x0009e698... (51 %)
Writing at 0x000a35d9... (53 %)
Writing at 0x000a87e5... (55 %)
Writing at 0x000adc4e... (57 %)
Writing at 0x000b2b2e... (59 %)
Writing at 0x000b7b14... (61 %)
Writing at 0x000bd3dd... (63 %)
Writing at 0x000c2940... (65 %)
Writing at 0x000c7e08... (67 %)
Writing at 0x000ccfdd... (69 %)
Writing at 0x000d263a... (71 %)
Writing at 0x000d7946... (73 %)
Writing at 0x000dcf91... (75 %)
Writing at 0x000e2529... (77 %)
Writing at 0x000e7dad... (79 %)
Writing at 0x000edbdf... (81 %)
Writing at 0x000f3025... (83 %)
Writing at 0x000fba3d... (85 %)
Writing at 0x00103ce9... (87 %)
Writing at 0x00109fcc... (89 %)
Writing at 0x0010f80e... (91 %)
Writing at 0x0011568a... (93 %)
Writing at 0x0011ae0b... (95 %)
Writing at 0x00120c79... (97 %)
Writing at 0x001263e1... (100 %)
Wrote 1161168 bytes (802595 compressed) at 0x00010000 in 11.3 seconds (effective 822.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
===================================================== [SUCCESS] Took 23.18 seconds =====================================================

Processing esp32dev_DEBUG (extends: env:esp32dev; build_type: debug; build_flags: -D DEBUG; platform: https://github.com/platformio/platform-espressif32.git; framework: espidf; board: esp32dev; board_build.flash_mode: qio; board_build.f_flash: 80000000L; upload_speed: 921600; monitor_speed: 115200; monitor_filters: direct, esp32_exception_decoder; board_build.partitions: default.csv; board_build.filesystem: 
fatfs; board_build.data_dir: data; board_build.embed_files: src/bootstrap.js)
-----------------------------------------------------------------------------------------------------------------------------------------CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.5.0+sha.7e3b841) (git+https://github.com/platformio/platform-espressif32.git) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-espidf @ 3.50201.0 (5.2.1)
 - tool-cmake @ 3.16.4
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - tool-idf @ 1.0.1
 - tool-mconf @ 1.4060000.20190628 (406.0.0)
 - tool-mkfatfs @ 2.0.1
 - tool-mklittlefs @ 1.203.210628 (2.3)
 - tool-mkspiffs @ 2.230.0 (2.30)
 - tool-ninja @ 1.9.0
 - tool-riscv32-esp-elf-gdb @ 11.2.0+20220823
 - tool-xtensa-esp-elf-gdb @ 11.2.0+20230208
 - toolchain-esp32ulp @ 1.23500.220830 (2.35.0)
 - toolchain-xtensa-esp32 @ 12.2.0+20230208
Reading CMake configuration...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
<lambda>(["checkprogsize"], [".pio\build\esp32dev_DEBUG\firmware.elf"])
MethodWrapper(["checkprogsize"], [".pio\build\esp32dev_DEBUG\firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=====     ]  51.8% (used 169764 bytes from 327680 bytes)
Flash: [========  ]  82.7% (used 1355337 bytes from 1638400 bytes)
.pio\build\esp32dev_DEBUG\firmware.elf  :

section                                                                                                                       size       
  addr

.rtc.text                                                                                                                        0   1074528256

.rtc.dummy                                                                                                                       0   1073217536

.rtc.force_fast                                                                                                                  4   1073217536

.rtc_noinit                                                                                                                      0   1342177280

.rtc.force_slow                                                                                                                  0   1342177280

.rtc_fast_reserved                                                                                                               0   1073225728

.rtc_slow_reserved                                                                                                              24   1342185448

.iram0.vectors                                                                                                                1027   1074266112

.iram0.text                                                                                                                 105655   1074267140

.dram0.data                                                                                                                  15668   1073414144

.ext_ram_noinit                                                                                                                  0   1065353216

.noinit                                                                                                                          0   1073429812

.ext_ram.bss                                                                                                                     0   1065353216

.dram0.bss                                                                                                                  154096   1073429816

.flash.appdesc                                                                                                                 256   1061158944

.flash.rodata                                                                                                               214640   1061159200

.flash.rodata_noload                                                                                                         10550   1061373840

.flash.text                                                                                                                1018347   1074593824

.iram0.text_end                                                                                                                  1   1074372795

.iram0.data                                                                                                                      0   1074372796

.iram0.bss                                                                                                                       0   1074372796

.dram0.heap_start                                                                                                                0   1073583912

.xt.prop                                                                                                                    947256       
     0

.xt.lit                                                                                                                      22144       
     0

.xtensa.info                                                                                                                    56       
     0

.comment                                                                                                                       285       
     0

.xt.prop._ZN12Flash_Access5flushEv                                                                                              36       
     0

.xt.prop._ZTV12Flash_Access                                                                                                     12       
     0

.xt.prop._ZTV9Partition                                                                                                         12       
     0

.xt.prop._ZTV8WL_Flash                                                                                                          12       
     0

.xt.lit._ZN3nvs4LockC5Ev                                                                                                         8       
     0

.xt.lit._ZN3nvs4LockD5Ev                                                                                                         8       
     0

.xt.lit._ZN3nvs4Lock4initEv                                                                                                      8       
     0

.xt.prop._ZN3nvs4LockC5Ev                                                                                                       12       
     0

.xt.prop._ZN3nvs4LockD5Ev                                                                                                       12       
     0

.xt.prop._ZN3nvs4Lock4initEv                                                                                                    96       
     0

.xt.prop._ZN3nvs4LockC2Ev                                                                                                       36       
     0

.xt.prop._ZN3nvs4LockD2Ev                                                                                                       36       
     0

.xt.prop._ZN14NVSHandleEntryD2Ev                                                                                                36       
     0

.xt.prop._ZN14intrusive_listI14NVSHandleEntryE5eraseENS1_8iteratorE                                                             84       
     0

.xt.prop._ZN14intrusive_listI14NVSHandleEntryE9push_backEPS0_                                                                   60       
     0

.xt.prop._ZN3nvs9NVSHandle8set_itemIaEEiPKcT_                                                                                   36       
     0

.xt.prop._ZN3nvs9NVSHandle8set_itemIhEEiPKcT_                                                                                   36       
     0

.xt.prop._ZN3nvs9NVSHandle8set_itemItEEiPKcT_                                                                                   36       
     0

.xt.prop._ZN3nvs9NVSHandle8set_itemImEEiPKcT_                                                                                   36       
     0

.xt.prop._ZN3nvs9NVSHandle8get_itemIaEEiPKcRT_                                                                                  36       
     0

.xt.prop._ZN3nvs9NVSHandle8get_itemIhEEiPKcRT_                                                                                  36       
     0

.xt.prop._ZN3nvs9NVSHandle8get_itemItEEiPKcRT_                                                                                  36       
     0

.xt.prop._ZN3nvs9NVSHandle8get_itemImEEiPKcRT_                                                                                  36       
     0

.xt.lit._ZN3nvs4Item6getKeyEPcj                                                                                                  8       
     0

.xt.lit._ZNKSt14default_deleteIA_N3nvs4PageEEclIS1_EENSt9enable_ifIXsrSt14is_convertibleIPA_T_PS2_E5valueEvE4typeEPS7_           0       
     0

.xt.lit._ZNSt10unique_ptrIA_N3nvs4PageESt14default_deleteIS2_EED5Ev                                                              0       
     0

.xt.lit._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE17clearAndFreeNodesEv                                                 0       
     0

.xt.lit._ZN14intrusive_listIN3nvs7Storage13BlobIndexNodeEE17clearAndFreeNodesEv                                                  0       
     0

.xt.lit._ZN14intrusive_listIN3nvs7Storage12UsedPageNodeEE17clearAndFreeNodesEv                                                   0       
     0

.xt.prop._ZN3nvs4Item6getKeyEPcj                                                                                                72       
     0

.xt.prop._ZNKSt14default_deleteIA_N3nvs4PageEEclIS1_EENSt9enable_ifIXsrSt14is_convertibleIPA_T_PS2_E5valueEvE4typeEPS7_         72       
     0

.xt.prop._ZNSt10unique_ptrIA_N3nvs4PageESt14default_deleteIS2_EED5Ev                                                             0       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE17clearAndFreeNodesEv                                               60       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage13BlobIndexNodeEE17clearAndFreeNodesEv                                                60       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage12UsedPageNodeEE17clearAndFreeNodesEv                                                 60       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage13BlobIndexNodeEE9push_backEPS2_                                                      60       
     0

.xt.prop._ZN19CompressedEnumTableIbLj1ELj256EE3setEjb                                                                           60       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE9push_backEPS2_                                                     60       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage12UsedPageNodeEE9push_backEPS2_                                                       60       
     0

.xt.prop._ZNSt10unique_ptrIA_N3nvs4PageESt14default_deleteIS2_EED2Ev                                                            48       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE5eraseENS3_8iteratorE                                               84       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage13BlobIndexNodeEE5eraseENS3_8iteratorE                                                84       
     0

.xt.prop._ZN14intrusive_listIN3nvs7Storage12UsedPageNodeEE5eraseENS3_8iteratorE                                                 84       
     0

.xt.prop._ZTVN3nvs9NVSHandleE                                                                                                   12       
     0

.xt.prop._ZTVN3nvs15NVSHandleSimpleE                                                                                            12       
     0

.xt.lit._ZN3nvs12NVSPartitionD5Ev                                                                                                8       
     0

.xt.prop._ZN3nvs12NVSPartitionD5Ev                                                                                              12       
     0

.xt.prop._ZN3nvs12NVSPartitionD2Ev                                                                                              36       
     0

.xt.prop._ZN3nvs12NVSPartitionD0Ev                                                                                              36       
     0

.xt.prop._ZTVN3nvs9PartitionE                                                                                                   12       
     0

.xt.prop._ZTVN3nvs12NVSPartitionE                                                                                               12       
     0

.xt.lit._ZN3nvs19NVSPartitionManagerD5Ev                                                                                         8       
     0

.xt.lit._ZN3nvs7StorageC5EPNS_9PartitionE                                                                                        0       
     0

.xt.prop._ZN3nvs19NVSPartitionManagerD5Ev                                                                                       12       
     0

.xt.prop._ZN3nvs7StorageC5EPNS_9PartitionE                                                                                       0       
     0

.xt.prop._ZN3nvs19NVSPartitionManagerD2Ev                                                                                       36       
     0

.xt.prop._ZN3nvs19NVSPartitionManagerD0Ev                                                                                       36       
     0

.xt.prop._ZN3nvs7StorageC2EPNS_9PartitionE                                                                                      36       
     0

.xt.prop._ZN14intrusive_listIN3nvs12NVSPartitionEE9push_backEPS1_                                                               60       
     0

.xt.prop._ZN14intrusive_listIN3nvs12NVSPartitionEE5eraseENS2_8iteratorE                                                         84       
     0

.xt.prop._ZN14intrusive_listIN3nvs7StorageEE9push_backEPS1_                                                                     60       
     0

.xt.prop._ZN14intrusive_listIN3nvs15NVSHandleSimpleEE5eraseENS2_8iteratorE                                                      84       
     0

.xt.prop._ZN14intrusive_listIN3nvs7StorageEE5eraseENS2_8iteratorE                                                               84       
     0

.xt.prop._ZN14intrusive_listIN3nvs15NVSHandleSimpleEE9push_backEPS1_                                                            60       
     0

.xt.prop._ZTVN3nvs19NVSPartitionManagerE                                                                                        12       
     0

.xt.prop._ZN14intrusive_listIN3nvs8HashList13HashListBlockEE5eraseENS3_8iteratorE                                               84       
     0

.xt.prop._ZN14intrusive_listIN3nvs8HashList13HashListBlockEE9push_backEPS2_                                                     60       
     0

.xt.lit._ZN3nvs4ItemC5EhNS_8ItemTypeEhPKch                                                                                       0       
     0

.xt.prop._ZN3nvs4ItemC5EhNS_8ItemTypeEhPKch                                                                                      0       
     0

.xt.prop._ZN3nvs4ItemC2EhNS_8ItemTypeEhPKch                                                                                    108       
     0

.xt.prop._ZN19CompressedEnumTableIN3nvs4Page10EntryStateELj2ELj126EE3setEjS2_                                                   60       
     0

.xt.lit._ZN14intrusive_listIN3nvs4PageEE5clearEv                                                                                 0       
     0

.xt.lit._ZN14intrusive_listIN3nvs4PageEE6insertENS2_8iteratorEPS1_                                                               0       
     0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE5clearEv                                                                               60       
     0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE6insertENS2_8iteratorEPS1_                                                             84       
     0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE9push_backEPS1_                                                                        60       
     0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE5eraseENS2_8iteratorE                                                                  84       
     0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE10push_frontEPS1_                                                                      60       
     0

.xt.prop._ZTISt9exception                                                                                                       12       
     0

.xt.prop._ZTISt9bad_alloc                                                                                                       12       
     0

.xt.prop._ZTVN10__cxxabiv120__si_class_type_infoE                                                                               12       
     0

.xt.prop._ZTVSt9bad_alloc                                                                                                       12       
     0

.xt.prop._ZTVN10__cxxabiv117__class_type_infoE                                                                                  12       
     0

.xt.lit._ZNK9__gnu_cxx24__concurrence_lock_error4whatEv                                                                          8       
     0

.xt.lit._ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv                                                                        8       
     0

.xt.lit._ZN9__gnu_cxx24__concurrence_lock_errorD5Ev                                                                              8       
     0

.xt.lit._ZN9__gnu_cxx26__concurrence_unlock_errorD5Ev                                                                            8       
     0

.xt.lit._ZN9__gnu_cxx7__mutex4lockEv                                                                                             8       
     0

.xt.lit._ZN9__gnu_cxx7__mutex6unlockEv                                                                                           8       
     0

.xt.prop._ZNK9__gnu_cxx24__concurrence_lock_error4whatEv                                                                        48       
     0

.xt.prop._ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv                                                                      48       
     0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD5Ev                                                                            12       
     0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD5Ev                                                                          12       
     0

.xt.prop._ZN9__gnu_cxx7__mutex4lockEv                                                                                           48       
     0

.xt.prop._ZN9__gnu_cxx7__mutex6unlockEv                                                                                         48       
     0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD2Ev                                                                            36       
     0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD2Ev                                                                          36       
     0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD0Ev                                                                            36       
     0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD0Ev                                                                          36       
     0

.xt.prop._ZTIN9__gnu_cxx24__concurrence_lock_errorE                                                                             12       
     0

.xt.prop._ZTIN9__gnu_cxx26__concurrence_unlock_errorE                                                                           12       
     0

.xt.prop._ZTVN9__gnu_cxx24__concurrence_lock_errorE                                                                             12       
     0

.xt.prop._ZTVN9__gnu_cxx26__concurrence_unlock_errorE                                                                           12       
     0

.debug_frame                                                                                                                198832       
     0

.debug_info                                                                                                                5046303       
     0

.debug_abbrev                                                                                                               500627       
     0

.debug_loc                                                                                                                 1494441       
     0

.debug_aranges                                                                                                               79160       
     0

.debug_ranges                                                                                                                92232       
     0

.debug_line                                                                                                                3395873       
     0

.debug_str                                                                                                                  633441            0

.debug_loclists                                                                                                              87393            0

.debug_line_str                                                                                                              19519            0

.debug_rnglists                                                                                                               3466            0

Total                                                                                                                     14044812
<lambda>(["upload"], [".pio\build\esp32dev_DEBUG\firmware.bin"])
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
BeforeUpload(["upload"], [".pio\build\esp32dev_DEBUG\firmware.bin"])
Auto-detected: COM4
"C:\Users\USER\.platformio\penv\Scripts\python.exe" "C:\Users\USER\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32 --port "COM4" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 C:\...\my_project\.pio\build\esp32dev_DEBUG\bootloader.bin 0x8000 C:\...\my_project\.pio\build\esp32dev_DEBUG\partitions.bin 0xc000 C:\...\my_project\.pio\build\esp32dev_DEBUG\ota_data_initial.bin 0x10000 .pio\build\esp32dev_DEBUG\firmware.bin
usage: esptool write_flash [-h] [--erase-all]
                           [--flash_freq {keep,80m,60m,48m,40m,30m,26m,24m,20m,16m,15m,12m}]
                           [--flash_mode {keep,qio,qout,dio,dout}]
                           [--flash_size {detect,keep,256KB,512KB,1MB,2MB,2MB-c1,4MB,4MB-c1,8MB,16MB,32MB,64MB,128MB}]
                           [--spi-connection SPI_CONNECTION] [--no-progress]
                           [--verify] [--encrypt]
                           [--encrypt-files <address> <filename> [<address> <filename> ...]]
                           [--ignore-flash-encryption-efuse-setting] [--force]
                           [--compress | --no-compress]
                           <address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: Detected overlap at address: 0x8000 for file: C:\...\my_project\.pio\build\esp32dev_DEBUG\partitions.bin
*** [upload] Error 2
====================================================== [FAILED] Took 8.04 seconds ======================================================

Environment     Status    Duration
--------------  --------  ------------
esp32dev        SUCCESS   00:00:23.178
esp32dev_DEBUG  FAILED    00:00:08.039
================================================= 1 failed, 1 succeeded in 00:00:31.217 =================================================
C:\...\my_project>pio run -t upload --verbose

@Jason2866
Copy link
Contributor

@valeros
Copy link
Member

valeros commented Mar 22, 2024

I have a suspicion that the size of the bootloader image is greater than 0x7000 bytes in debug mode. Are you using the BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG option in your sdkconfig?

@FranckFreiburger
Copy link
Author

file sdkconfig.esp32dev_DEBUG :
# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set

@FranckFreiburger
Copy link
Author

The partition table looks not common. https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/partition-tables.html

I rely on automatic offset determination (I hope I've understood correctly how it works.)

@valeros
Copy link
Member

valeros commented Mar 22, 2024

Could you please share here the sizes of all binaries in bytes:

.pio\build\esp32dev_DEBUG\bootloader.bin
.pio\build\esp32dev_DEBUG\partitions.bin
.pio\build\esp32dev_DEBUG\ota_data_initial.bin
.pio\build\esp32dev_DEBUG\firmware.bin

@Jason2866
Copy link
Contributor

Placing nvs and otadata at this addresses is not common. As already mentioned your bootloader maybe is bigger than the tool is reserving space for and so it conflicts. Place nvs and ota to the addresses mentioned in examples. So your bootloader has more free address space to use.

# Name,   Type, SubType,  Offset,   Size,  Flags
nvs      , data  , nvs   ,         , 0x3000
otadata  , data  , ota   ,         , 0x2000
phy_init , data  , phy   ,         , 0x1000
ota_0    , app   , ota_0 ,         , 1600K
storage  , data  , fat   , 0x2ff000, 1024K

@FranckFreiburger
Copy link
Author

same issue, in "debug" mode with the following partition:

nvs      , data  , nvs   ,  0x9000 , 0x4000
otadata  , data  , ota   ,  0xd000 , 0x2000
phy_init , data  , phy   ,  0xf000 , 0x1000
ota_0    , app   , ota_0 ,         , 1600K
storage  , data  , fat   , 0x2ff000, 1024K

.pio\build\esp32dev_DEBUG\bootloader.bin -> 28 704 bytes
.pio\build\esp32dev_DEBUG\partitions.bin -> 3 072 bytes
.pio\build\esp32dev_DEBUG\ota_data_initial.bin -> 8 192 bytes
.pio\build\esp32dev_DEBUG\firmware.bin -> 1 355 712 bytes

@Jason2866
Copy link
Contributor

bootloader is too big 28704 = 0x7020. Esp32 bootloader is flashed at 0x1000
So you have reached the border with 0x8020. Partition table is by default at 0x8000.
You have to change the partition table start in sdkconfig settings.
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/kconfig.html#config-partition-table-offset

@valeros
Copy link
Member

valeros commented Mar 22, 2024

I'm also curious if -D DEBUG enables some additional code in bootloader sources that causes a larger footprint.

@FranckFreiburger
Copy link
Author

FranckFreiburger commented Mar 22, 2024

ok, in "release" mode bootloader is 25 152 bytes.
I wondering if it is possible to build bootloader in "release" and firmware in "debug" ? (this already seems to be the case)
image

@FranckFreiburger
Copy link
Author

in my platformio.ini:

;build_flags = -D DEBUG
bootloader: 26 992 bytes

build_flags = -D DEBUG
bootloader: 28 704 octets

@valeros
Copy link
Member

valeros commented Mar 22, 2024

How is the global -D DEBUG macro used in your codebase? If it's only needed by your own codebase I would recommend using build_src_flags instead of build_flags.

@FranckFreiburger
Copy link
Author

Thanks to the advice !
I still don't understand why bootloader is bigger in build_type debug than release (despite the use of build_src_flags instead of build_flags)
I then changed CONFIG_PARTITION_TABLE_OFFSET to 0x9000 and everything flash fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants