ESP32 Flash partition content

Sysprogs forums Forums VisualGDB ESP32 Flash partition content

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28220
    m.ridoni
    Participant

    Hello,

    I”ve set up a custom partition table for my project. VisualGDB correctly handles the CSV file, generates the correct .bin partition table and is able to flash it along with the rest of the application.

    For reference, my partition table is:

    # Name, Type, SubType, Offset, Size, Flags
    nvs, data, nvs, 0x9000, 0x4000
    otadata, data, ota, 0xd000, 0x2000
    phy_init, data, phy, 0xf000, 0x1000
    factory, app, factory, 0x10000, 0x140000
    ota_0, app, ota_0, , 0x140000
    ota_1, app, ota_1, , 0x140000
    my_info, data, nvs, , 0x1000

    Now what if I want to flash a pre-initialized partition (specifically the one named “my_info”) with some default (or unit-specific) values? I know I can generate a flashable image with nvs_partition_gen.py, but I don’t know if it is possibile for VisualGDB to directly handle it, without using  a (manually issued) separate flash command from esptool.py

     

    Thanks

    #28245
    support
    Keymaster

    Hi,

    Normally, the partitions would be handled by the ESP-IDF build scripts directly and VisualGDB would pick up the FLASH images reported by them. So as long as the FLASH gets progammed when you run “make flash”, it should get programmed with VisualGDB as well. If this doesn’t happen, please let us know if you are using GNU Make or CMake and we can show you how to troubleshoot this.

    You can also use the VisualGDB Project Properties -> Debug Settings -> Additional FLASH Resources settings to explicitly tell VisualGDB to program a specific image at a specific address.

    #28278
    KeithInAsia
    Participant

    m.ridoni,

    You wrote “I’ve set up a custom partition table for my project. VisualGDB correctly handles the CSV file, generates the correct .bin partition table and is able to flash it along with the rest of the application.”

    Can you point me to the location of where this is documented?     I don’t see where VisualGDB correctly handles the CSV file.  I don’t know what commend in VGDB generates the correct .bin portion table — nor do I have the understanding on how it is able to flash that along with the rest of the application.

    I’m happy to read those instructions if you can point me to them.   Thanks.

     

    I see you have allocated about 1.3M in your partitions…   My app is now over 1M as well…   I think developers who are successful with the VGDB tool will certainly easily exceed 1M with BT and Wifi enabled.

    #28284
    KeithInAsia
    Participant

    SOLUTION:
    This is for Windows Developers. Other platforms will be similar.

    TOOLS: I assume you have all this on your system. Only Git Bash may be missing in some standard build environments. (I use Github and have installed the standard tools.)

    VS2019
    VisualGDB
    Git Bash
    Python V3

    General Steps to Change the Partition Table:

    1) Edit your source csv file to include all your correct partition information
    2) Generate a binary file by using the gen_esp32part.py python tool.
    3) Place the final “partition-table.bin” in the correct build location.

    Specific Instructions:

    1) Create a working directory somewhere in your project source area. Avoid building in your root directory area as these files may be destroyed during various operations.

    2) I strongly suggest cloning all the Github based example files from:

    https://github.com/espressif/esp-idf/tree/master/examples

    Inside you will find all the partition tools and sample partition table cvs files.

    3) Search for gen_esp32part.py That should be located in examples/esp-idf/components/partition_table directory.

    4) Copy that command and sample csv files which are located there to your working directory as needed.

    5) Make a working csv file and name it appropriately descriptive. eg. PartitionSingleApp2M.csv

    6) Right mouse click in that directory and select ‘Git Bash here’ That will open Git Bash and have it pointing already into that directory.

    7) Invoke your Python tool which converts the csv working file to the final partition table bin

    Here is a sample of the instruction:
    python gen_esp32part.py PartitionSingleApp2M.csv partition-table.bin

    (There are many various options in that tool not talked about here)

    8) The final file name appears to be dependant on the VisualGDB build system (I could be wrong on this). Move your newly generated partition-table.bin file into and replace the existing one at:

    <project dirctory> /build/VisualGDB/Debug/partition-table/ <file is here>

    WARNING: I strong suspect that the build directories has been in flux and that the fine people at VisualGDB may be monkeying around with the build directory structure. You may need to search for partition-table.bin in the future.

    NOTE: VisualGDB doesn’t appear to have any reliance to the Partition Table settings inside the ESP-IDF Project properties at this time (this is the place where you edit the sdkconfig file). The better solution for the future would be for you to have chosen your new csv file there and the build system would convert it for you and place the final binary in the correct location automatically.

    NOTE: The startup software in your core build is pretty good about finding errors in the partition table. You will notice a confirmation of your table settings in the normal serial port debug print statements. If you have errors, they will show error message in red following that table print out.

    That should do it.

    #28294
    m.ridoni
    Participant

    Just to be clear: I don’t have a problem with the partition table per se: if I go into VisualGDB settings and set “Custom partition CSV file” in “Partition Table”, VisualGDB handles the custom partitioning just fine without the need to use bash and manually invoke gen_esp32part.py; VisualGDB handles that and generates the “partitions.bin” file corresponding to the “partitions.csv” (this file you have to create and maintain manually, of course).

    My request was about flashing the contents of a given partition during the building process.

    The answer given by support about using the “Additional FLASH Resources” should solve my problem (I still have to try).

     

    Thanks

    • This reply was modified 3 years, 10 months ago by m.ridoni.
    #28308
    KeithInAsia
    Participant

    It says that the csv file that you generate manually should be placed in the build directory.   Where is that?    The build directory gets destroyed when you do a clean… so — what location are they talking about?

    And why wouldn’t the support people here just explain that me?   I have never seen the instructions on this — and the support people (person) would not direct me to those instructions… they can’t be that difficult to follow.

    I just don’t know what they are considering the build directory.

    With one more sentence — my problem is correctly solved… and to think they wanted to charge me for this.

    K.

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