using larger offset address for ota_0 partition #7919
Replies: 2 comments 1 reply
-
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 |
Beta Was this translation helpful? Give feedback.
-
@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 |
Beta Was this translation helpful? Give feedback.
-
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:
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?
Beta Was this translation helpful? Give feedback.
All reactions