Forum: Mikrocontroller und Digitale Elektronik Frustraded with partition table esp32C3


Announcement: there is an English version of this forum on EmbDev.net. Posts you create there will be displayed on Mikrocontroller.net and EmbDev.net.
von Martin L. (tempusertempuser)


Lesenswert?

Hello,

I tried to ceate a partition table for my esp32 with OTA support

I need a app size of at least 1441792 bytes and also a data (littlefs) 
partition.

can you help me with the partition table?
1
# Name,   Type, SubType,  Offset,   Size,      Flags
2
nvs,      data, nvs,      0x9000,   0x4000
3
otadata,  data, ota,      0xd000,   0x2000
4
phy_init, data, phy,      0xf000,   0x1000
5
factory,  app,  factory,  0x10000,  0x144000
6
ota_0,    app,  ota_0,    0x160000, 0x144000
7
ota_1,    app,  ota_1,    0x2A8000, 0x144000
8
nvs_key,  data, nvs_keys, 0x3EC000, 0x1000


error is
1
Partition ota_1 invalid: Offset 0x2a8000 is not aligned to 0x10000


according to the espressif forum i need

2 app partitions to perform OTA, either 2x OTA or OTA + factory.

how can i arrange this.

von Max M. (jens2001)


Lesenswert?

Martin L. schrieb:
> error is
> Partition ota_1 invalid: Offset 0x2a8000 is not aligned to 0x10000

von Jörg W. (dl8dtl) (Moderator) Benutzerseite


Lesenswert?

Thus, reducing the size of factory, ota_0, and ota_1 from 0x144000 to 
0x140000 ought to be a viable solution.

von Martin L. (tempusertempuser)


Lesenswert?

Jörg W. schrieb:
> Thus, reducing the size of factory, ota_0, and ota_1 from 0x144000 to
> 0x140000 ought to be a viable solution.

Okay i tried it with
1
# Name,   Type, SubType,  Offset,   Size,      Flags
2
nvs,      data, nvs,      0x9000,   0x4000          # Offset: 0x00009000
3
otadata,  data, ota,      0xd000,   0x2000          # Offset: 0x00000D000
4
phy_init, data, phy,      0xf000,   0x1000          # Offset: 0x00000F000
5
factory,  app,  factory,  0x10000,  0x140000        # Offset: 0x000010000
6
ota_0,    app,  ota_0,    0x140000, 0x140000        # Offset: 0x0000140000
7
ota_1,    app,  ota_1,    0x280000, 0x140000        # Offset: 0x0000280000
8
nvs_key,  data, nvs_keys, 0x3C0000, 0x1000          # Offset: 0x00003C0000

but get this error
1
Error at line 2: Invalid field value 0x4000          # Offset: 0x00009000

von Jörg W. (dl8dtl) (Moderator) Benutzerseite


Lesenswert?

Kinda strange.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html

One of the example tables there looks quite similar:
1
# ESP-IDF Partition Table
2
# Name,   Type, SubType, Offset,  Size, Flags
3
nvs,      data, nvs,     0x9000,  0x4000,
4
otadata,  data, ota,     0xd000,  0x2000,
5
phy_init, data, phy,     0xf000,  0x1000,
6
factory,  app,  factory, 0x10000,  1M,
7
ota_0,    app,  ota_0,   0x110000, 1M,
8
ota_1,    app,  ota_1,   0x210000, 1M,

von Jörg W. (dl8dtl) (Moderator) Benutzerseite


Lesenswert?

Wait: maybe you are not allowed to add trailing comments? Try removing 
them.

von Jörg W. (dl8dtl) (Moderator) Benutzerseite


Lesenswert?

Ah, second observation: the example table has trailing commas, as there 
is a possible "flags" column following the size column.

von Martin L. (tempusertempuser)


Lesenswert?

Jörg W. schrieb:
> Wait: maybe you are not allowed to add trailing comments? Try removing
> them.

Yes that was the issue solved

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.