How to set partition table OFFSET in a SIMPLE way?
I need to move the partition table offset of my ESP32S3 system from the default value of 0x8000 up to 0xA000, because I now use ‘secure bootloader’ (V2) from ESP-IDF. This brought the size of the bootloader above 32KB, meaning it now overlaps with adress 0x8000.
I cannot find any “platformio.ini” setting that easily sets the offset to ‘whatever’ (in my case, 0xA000, as the bootloader is now at 40KB). The closest I get, seem to be this:
custom_sdkconfig = CONFIG_PARTITION_TABLE_OFFSET=0XA000
However, this in effect generates two ‘sdkconfig’ files:
- sdkconfig.defaults
- sdkconfig.[environment name]
where both seem to have same content. And, unfortunately, with a bunch of unwanted settings (ESPRainMaker, ESPInsights +++)! This makes my build no longer pass, terminating with the error:
“Source .pio/build/app_firmware/https_server.crt.S' not found, needed by target
.pio/build/app_firmware/.pio/build/app_firmware/https_server.crt.S.o’”
My workaround for now is to clone the ‘esp32-arduino-lib-builder’ repository from Espressif’s GitHub, modify the “sdkconfig” file, add my (custom) “partitions.csv” file, run ‘build.sh’ for target=“esp32s3”, wait an hour or so - and then overwrite the generated .a library files in the relevant PlatformIO folder (“~/.platformio/packages/framework-arduinoespressif32-libs/esp32s3”).
This builds my firmware with correct partition table offset at 0x8000, as used by the ‘load_partitions()’ function, and it can now be booted after signing w. key used by the secured bootloader. But, as the libraries are now differing from the original ones, this firmware quickly runs into an exception :-/
Is there a shorter, safer, more ‘elegant’ way of achieving this without resorting to any of:
- rebuilding libraries
- wrestle with auto-generated ‘sdkconfig’ file(s)
- rewrite code to use ‘espidf’ framework (tried & faulted)
???
NOTE: setting ‘framework=espidf, arduino’ results in exactly the same as when using the ‘custom_sdkconfig’-setting in “platformio.ini” file! ‘Unwanted’ sdkconfig-files, and odd build-errors … I found a “https_server.crt” certificate in the ESP-IDF sources, but adding it to the project did not please the build-system, unfortunately. And furthermore, I do NOT have any need for a webserver in my application either.