Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

using larger offset address for ota_0 partition #7919

STMAndreas started this conversation in Ideas
Discussion options

In Arduino-ESP32 documentation there is a hint that the first application partition must have an offset at 0x010000
(see https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/tutorials/partition_table.html)
This restriction can be a problem if you need a larger NVS partition (e.g. 64k). Of course, in this case it is maybe better to place the NVS partiton to the end of the flash. But I read the documentation too late and I simply tried to set the first application parrtition to 0x200000 (ota_0) and the second to 0x500000 (ota_1).
And it works! furthermore I also shiftes the otadata partition from 0xe000 to 0x19000 to have enough space for the large nvs partition:

Name,     Type, SubType,  Offset,   Size,     Flags
nvs,      data, nvs,      0x009000, 0x010000,
otadata,  data, ota,      0x019000, 0x002000,
spiffs,   data, spiffs,   0x01B000, 0x1D5000,
coredump, data, coredump, 0x1F0000, 0x10000,
app0,     app,  ota_0,    0x200000, 0x300000,
app1,     app,  ota_1,    0x500000, 0x300000,

The only problem I saw was that Arduino does not flash the application and otadata to the right location. It flash the application always to 0x010000 and otadata to 0x0e000.
Maybe that's the reason for the note in the Arduini-ESP32 documentation.
But it is easy to change this. Simply edit plattform.txt file and modify the arguments for the flash tool (esptool.exe). With such a change I can use Arduino upload function without restrictions.

Why isn't it possible for Arduino to read the flash adresses from the partions.csv file and use it as arguments for the upload process?
Has anyone an idea how it could be possible?

I did this with ESP board version v1.0.6 as well as v2.0.7. In v2.0.7 in plattform.txt in line 266 theis is the argument definition for flash tool:

tools.esptool_py.upload.pattern_args=--chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset write_flash {upload.erase_cmd} -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} {build.bootloader_addr} "{build.path}/{build.project_name}.bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" {otaloc} "{runtime.platform.path}/tools/partitions/boot_app0.bin" {apploc} "{build.path}/{build.project_name}.bin" {upload.extra_flags}

I defined {otaloc} and {apploc} at the start of plattform.txt after line 16: tools.esptool_py.cmd.windows=esptool.exe

tools.esptool_py.apploc=0x200000
tools.esptool_py.otaloc=0x019000

Isn't it possible to define these to variables from outside?

You must be logged in to vote

Replies: 2 comments · 1 reply

Comment options

generally app could be made relocatable, but that could only be done with using fixed addresses, like the ones you used. It needs to be defined per partition scheme in the board menu as well.

You can read more about partitions here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html

You must be logged in to vote
1 reply
@STMAndreas
Comment options

Hi,
yes of course. That what I did and it is working.
My question is more to add a feature in Arduino or ESP32 board package to get the partition addresses from the partition.csv file to flash the binaries (with esptools.exe) at the right addresses. Currently Arduino flash the app binary always at 0x10000.

Comment options

@STMAndreas If you move from Arduino IDE to Platformio IDE you can change this values. Sadly it is not a inbuilt feature. To make it possible i forked the needed part (platform-espressif32) and we use it in Project Tasmota. Most addresses are read from partitions.csv. Example
In this example a factory image is placed at 0x10000 which manages the OTA update without the need of 2 identic sized OTA partitions. In the boards.json can be defined how many additional files and to which addresses the are flashed.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.