sdkconfig, partitions.csv, esptool.py

leemoore1966
Posts: 9
Joined: Sat Feb 15, 2020 11:51 am

sdkconfig, partitions.csv, esptool.py

Postby leemoore1966 » Sun Aug 27, 2023 12:01 pm

Hi All,

I have got myself into a very confusing situation.
Partly I think my issue is that I have taken a lot of boilerplate code from other projects, without fully understanding the underlying usage.

I am having issues building and writing to my device, having had to change the settings of the location of the partition table in sdkconfig from 0x8000 to 0x10000.

I have the following settings

1. sdkconfig using custom partitions.csv

Code: Select all

#
# Partition Table
#
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x10000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table
2. partitions.csv

Code: Select all

# Name,   Type, SubType, Offset,   Size,    Flags
nvs,      data, nvs,     0x009000, 0x4000,
otadata,  data, ota,     0x00D000, 0x2000,
phy_init, data, phy,     0x00F000, 0x1000,
factory,  app,  factory, 0x010000, 1M,
ota_0,    app,  ota_0,   0x110000, 1M,
ota_1,    app,  ota_1,   0x210000, 1M,
storage,  data, spiffs,  ,         0xF0000,
3. esptool command

Code: Select all

esptool.py \
    --chip esp32 \
    -p /dev/ttyUSB0 \
    -b 460800 \
    \
    --before=default_reset \
    --after=hard_reset write_flash \
    --flash_mode dio \
    --flash_freq 80m \
    --flash_size 16MB \
    \
    0x00001000 build/bootloader/bootloader.bin \
    0x00010000 build/partition_table/partition-table.bin \
    0x00012000 build/ota_data_initial.bin \
    0x00100000 build/Rosetta-FX.bin \
    0x00400000 build/storage.bin

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

Re: sdkconfig, partitions.csv, esptool.py

Postby MicroController » Mon Aug 28, 2023 12:00 am

Code: Select all

CONFIG_PARTITION_TABLE_OFFSET=0x10000
and
factory, app, factory, 0x010000, 1M,
Looks like a conflict where the partition table and the application both want to reside at address 0x10000.
I guess you'll have to move all partitions after the partition table up by 64kb.

leemoore1966
Posts: 9
Joined: Sat Feb 15, 2020 11:51 am

Re: sdkconfig, partitions.csv, esptool.py

Postby leemoore1966 » Mon Aug 28, 2023 8:21 am

MicroController wrote:
Mon Aug 28, 2023 12:00 am

Code: Select all

CONFIG_PARTITION_TABLE_OFFSET=0x10000
and
factory, app, factory, 0x010000, 1M,
Looks like a conflict where the partition table and the application both want to reside at address 0x10000.
I guess you'll have to move all partitions after the partition table up by 64kb.
I did try this, and unfortunately got into more of a tangle
What I could not understand was why the size of the bootloader had increased from a previous successful installation
Then I realized
At one point I enabled debug and reduced the optimization of the bootloader, causing it to increase in size

for now, my solution - re-enable the optimization and disable debug of the bootloader

Thx
Lee

Who is online

Users browsing this forum: Baidu [Spider], iryna7 and 132 guests