ESP32 custom flash partitions

Sysprogs forums Forums VisualGDB ESP32 custom flash partitions

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11987
    dparkinson
    Participant

    How can I set up custom flash partitions for an ESP32 MSBuild project?

    Specifically, I want some partitions reserved for some data (Type = data, SubType = nvs?). I’d give it a unique name so I know what it’s used for in my program when I call the

    esp_partition_find_first(
    ESP_PARTITION_TYPE_DATA,
    ESP_PARTITION_SUBTYPE_DATA_NVS,
    “my_data”);

    Do I need to run the esp-idf tool to first generate a partitions.bin file before creating a new project? (see http://esp-idf.readthedocs.io/en/latest/api-guides/partition-tables.html and  partition_table/gen_esp32part.py).

     

    #11989
    support
    Keymaster

    Hi,

    Yes, please run the esp-idf tool, generate a new partitions.bin file and specify a path to it on the first page of VisualGDB Project Properties.

    #12020
    dparkinson
    Participant

    Thanks! I was able to get something that seems to work.

    It seems I had to make a custom partition type in the range 0x40-0xFE. Otherwise, if I make it general NVS data, the WiFi will try to store wifi configuration data in that space. (I was using your WiFi server example/tutorial as the starting point for the project).  The subtype then has to be O (instead of nvs) or the gen_esp32part.py doesn’t like it.

    I left the other partitions alone so hopefully the WiFi portion will continue to work, correctly. (It seems to be working so far).

    # Name, Type, SubType, Offset, Size, Flags
    factory, app, factory, 0x010000, 1M,
    rfdata, data, phy, 0x110000, 0x40000,
    wifidata, data, nvs, 0x150000, 0x40000,
    
    --------------- App Partitions-----------
    --- App Partition 1 ---
    pPartition->type 0
    pPartition->subtype 0
    pPartition->address 0x00010000
    pPartition->size 0x00100000
    pPartition->label factory
    pPartition->encrypt 0
    --------------- Data Partitions-----------
    --- Data Partition 1 ---
    pPartition->type 1
    pPartition->subtype 2
    pPartition->address 0x00150000
    pPartition->size 0x00040000
    pPartition->label wifidata
    pPartition->encrypt 0
    
    --- Data Partition 2 ---
    pPartition->type 1
    pPartition->subtype 1
    pPartition->address 0x00110000
    pPartition->size 0x00040000
    pPartition->label rfdata
    pPartition->encrypt 0

    So, my new partition.csv table looked something like this

    # Name, Type, SubType, Offset, Size, Flags
    # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
    factory, app, factory, 0x010000, 1M,
    rfdata, data, phy, 0x110000, 0x40000,
    wifidata, data, nvs, 0x150000, 0x40000,
    my_data, 0x40, 0, 0x190000, 0x10000
    
    
    #12027
    support
    Keymaster

    Hi,

    Thanks for sharing this, good to know that it works.

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