ESP32: Modifying flash settings for writing binary to partition

Sysprogs forums Forums VisualGDB ESP32: Modifying flash settings for writing binary to partition

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32791
    tonicode
    Participant

    Hello,

    in our project we need to write a binary to the OTA0 partition when executing right-click on project – “Program FLASH memory” but we could not find a way to modify the flash settings.

    We tried to right-click on the partition and select “Program from File”, but the flash command does not change:

    “esptool.py esp32s3 -b 115200 –before=default_reset –after=hard_reset write_flash –flash_mode dio –flash_freq 80m –flash_size 8MB 0x0 bootloader/bootloader.bin 0x10000 main.bin 0x8000 partition_table/partition-table.bin”

    We also tried modifying the file “Debug\flash_args” but this file is overwritten, when recompiling the project.

    We need the flash command to look like:
    “esptool.py esp32s3 -b 115200 –before=default_reset –after=hard_reset write_flash –flash_mode dio –flash_freq 80m –flash_size 8MB 0x0 bootloader/bootloader.bin 0x10000 main.bin 0x110000 oat.bin 0x8000 partition_table/partition-table.bin”
    so that the main.bin is written to 0x10000 and the ota.bin is written to 0x110000.

    Is there a way to modify the flash settings to flash an additional binary to the OTA0 partition?

    Thanks in advance,
    Toni

    #32792
    support
    Keymaster

    Hi,

    The exact FLASH command line is not directly under VisualGDB’s control, however we can explain what parts are involved in computing it so that you can pinpoint the correct setting:

    1. ESP-IDF enumerates all KConfig files referenced by the project and stores them in the project_description.json file.
    2. VisualGDB scans the KConfig files referenced there and shows the ESP-IDF-specific settings based on them.
    3. When you change those settings in the GUI, VisualGDB updates the sdkconfig file.
    4. When you build the project using ESP-IDF scripts, they pick up the settings from sdkconfig, and compute various command lines based on them.
    5. Some command lines are saved to intermediate files such as flash_args

    Modifying flash_args manually will indeed not work, since the build scripts will overwrite it. Instead you would need to find the ESP-IDF setting that controls its content and change it (either by editing sdkconfig directly, or via VisualGDB Project Properties that will let VisualGDB edit it for you). Searching ESP-IDF build scripts for flash_args or parts of the command line shown there could be a good starting point.

    #32795
    tonicode
    Participant

    Hi,

    thank you for that information, unfortunately we could not find any way to modify the flash_args via sdkconfig or in the ESP-IDF build scripts.

    What is the option “Program from File” when right-clicking on a Partion intended to do? See screenshot attached.

    It does not seem to do anything, but according to the name it should set the File that is programmed to that partition.

    Thanks
    Toni

    Attachments:
    You must be logged in to view attached files.
    #32798
    support
    Keymaster

    Hi,

    You can try contacting Espressif for help, or patching the ESP-IDF build scripts yourself. VisualGDB works on top of the existing scripts and cannot do it for you.

    The “program from file” option programs the specified file into the bounds of the partition reported by ESP-IDF. This is done once and does not change the ESP-IDF project properties, or override the regular ESP-IDF programming logic.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.