Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Custom partitions not loading #92

Open
duevil opened this issue Sep 20, 2024 · 0 comments
Open

[BUG] Custom partitions not loading #92

duevil opened this issue Sep 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@duevil
Copy link

duevil commented Sep 20, 2024

It seems like the plugin does not support custom partitions. I added a custom partitions.csv to the project's root path, expecting the partitions to show up in the simulation. However, when running the simulation with the code of the ESP32 Custom partition table code example, the default partition is shown.

I am using the plugin v0.10.3 inside CLion 2024.2.2 together with the PlatformIO plugin. When loding the same code on a physical ESP32 the partition is loaded correctly. The same applies when running the code inside the WOKWI online editor.

Serial output when running the simulation inside CLion:

[   472][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[   770][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
Flash size: 8388608 bytes
ESP32 Partition table:

| Type | Sub |  Offset  |   Size   |       Label      |
| ---- | --- | -------- | -------- | ---------------- |
|  01  | 02  | 0x009000 | 0x006000 | nvs              |
|  01  | 01  | 0x00F000 | 0x001000 | phy_init         |
|  00  | 00  | 0x010000 | 0x190000 | factory          |
|  01  | 81  | 0x200000 | 0x1F0000 | vfs              |
|  01  | 03  | 0x3F0000 | 0x010000 | coredump         |
Hello, world!

diagram.json:

{
  "version": 1,
  "author": "Uri Shaked",
  "editor": "wokwi",
  "parts": [ { "type": "wokwi-esp32-devkit-v1", "id": "esp", "top": 0, "left": 0, "attrs": { "flashSize": "8" } } ],
  "connections": [ [ "esp:TX0", "$serialMonitor:RX", "", [] ], [ "esp:RX0", "$serialMonitor:TX", "", [] ] ]
}

main.cpp:

#include <Arduino.h>

void setup() {
    Serial.begin(115200);

    Serial.printf("Flash size: %d bytes\n", spi_flash_get_chip_size());

    Serial.printf("ESP32 Partition table:\n\n");

    Serial.printf("| Type | Sub |  Offset  |   Size   |       Label      |\n");
    Serial.printf("| ---- | --- | -------- | -------- | ---------------- |\n");

    esp_partition_iterator_t pi = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, nullptr);
    if (pi != nullptr) {
        do {
            const esp_partition_t *p = esp_partition_get(pi);
            Serial.printf("|  %02x  | %02x  | 0x%06X | 0x%06X | %-16s |\r\n",
                   p->type, p->subtype, p->address, p->size, p->label);
        } while (pi = (esp_partition_next(pi)));
    } else {
        Serial.printf("No partitions found.\n");
    }

    Serial.println("Hello, world!");
}

void loop() {
    delay(1000);
}

PlatformIO .ini:

[env:adafruit_feather_esp32_v2]
platform = espressif32
board = adafruit_feather_esp32_v2
framework = arduino
upload_speed = 921600
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
board_build.filesystem = littlefs
board_build.partitions = partitions.csv
build_flags =
    -w
    -D SERIAL_BAUD_RATE=${env:adafruit_feather_esp32_v2.monitor_speed}
    -D CUSTOM_LOG_LEVEL=2
    -D CORE_DEBUG_LEVEL=4
lib_deps =
@duevil duevil added the bug Something isn't working label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant