partition table

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

partition table

Postby burkulesomesh43 » Wed Aug 29, 2018 12:36 pm

Hi all,
I am using the wear levelling example given in esp idf. and I want to update the firmware using ota example given in esp idf.
but as I update wear levelling example using ota. gives some error.

18:04:25.007 -> [0;32mI (0) cpu_start: Starting scheduler on APP CPU.[0m
18:04:25.007 -> [0;32mI (115) file handle: Mounting FAT filesystem[0m
18:04:25.007 -> [0;31mE (115) vfs_fat_spiflash: Failed to find FATFS partition (type='data', subtype='fat', partition_label='storage'). Check the partition table.[0m
18:04:25.042 -> [0;31mE (125) file handle: Failed to mount FATFS (ESP_ERR_NOT_FOUND)[0m
--
Somesh Burkule

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: partition table

Postby WiFive » Wed Aug 29, 2018 3:26 pm

You have to make a partition table that supports both ota and filesystem

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: partition table

Postby fly135 » Wed Aug 29, 2018 3:34 pm

The problem is that you need to burn the entire flash with partitions that you need first. The OTA example won't have a partition for the file system. So when you OTA new firmware that was built based on a different partitioning of the flash, then it isn't going to find the non existent partitions. The approach you are taking is wrong.

You need to design an application that has OTA built into it with the partitions you expect to have in place. The OTA example is only good for getting your feet wet doing an OTA. But it serves no purpose other than as an example.

When OTA burns a new firmware build it does not change the paritioning of the flash. It only erases the partition that it's going to put the firmware in and then update the OTADATA partition with boot information.

John A

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: partition table

Postby burkulesomesh43 » Wed Aug 29, 2018 4:33 pm

WiFive wrote:You have to make a partition table that supports both ota and filesystem
Is there any documentation to understand partition table or have any idea to do it.
--
Somesh Burkule

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: partition table

Postby burkulesomesh43 » Wed Aug 29, 2018 4:42 pm

fly135 wrote:The problem is that you need to burn the entire flash with partitions that you need first. The OTA example won't have a partition for the file system. So when you OTA new firmware that was built based on a different partitioning of the flash, then it isn't going to find the non existent partitions. The approach you are taking is wrong.

You need to design an application that has OTA built into it with the partitions you expect to have in place. The OTA example is only good for getting your feet wet doing an OTA. But it serves no purpose other than as an example.

When OTA burns a new firmware build it does not change the paritioning of the flash. It only erases the partition that it's going to put the firmware in and then update the OTADATA partition with boot information.

John A
ok. thank you.
I will just try to combine both partition tables in single as per requirement.and then try to work on.
--
Somesh Burkule

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: partition table

Postby WiFive » Wed Aug 29, 2018 4:57 pm

burkulesomesh43 wrote:Is there any documentation to understand partition table or have any idea to do it.
Of course

https://docs.espressif.com/projects/esp ... ables.html

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: partition table

Postby burkulesomesh43 » Wed Aug 29, 2018 5:06 pm

WiFive wrote:
burkulesomesh43 wrote:Is there any documentation to understand partition table or have any idea to do it.
Of course

https://docs.espressif.com/projects/esp ... ables.html
I will try to make custom partition table. need to know limitations of memory for ota and file system.
thank you.
--
Somesh Burkule

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: partition table

Postby fly135 » Wed Aug 29, 2018 5:51 pm

burkulesomesh43 wrote:I will try to make custom partition table. need to know limitations of memory for ota and file system.
thank you.
You are limited by the amount of flash. Here is a partition table that does OTA into 2MB partitions and has a 1MB partition for a file system. The target needs 8MB of flash for this example.

Code: Select all

# 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
nvs,      data, nvs,     0x9000,  0x4000
otadata,  data, ota,     0xd000,  0x2000
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 2M,
storage,  data, spiffs,  ,        0xF0000,
ota_0,    0, ota_0,     0x400000, 2M,
ota_1,    0, ota_1,     0x600000, 2M,

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: partition table

Postby burkulesomesh43 » Wed Aug 29, 2018 6:32 pm

fly135 wrote:
burkulesomesh43 wrote:I will try to make custom partition table. need to know limitations of memory for ota and file system.
thank you.
You are limited by the amount of flash. Here is a partition table that does OTA into 2MB partitions and has a 1MB partition for a file system. The target needs 8MB of flash for this example.

Code: Select all

# 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
nvs,      data, nvs,     0x9000,  0x4000
otadata,  data, ota,     0xd000,  0x2000
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 2M,
storage,  data, spiffs,  ,        0xF0000,
ota_0,    0, ota_0,     0x400000, 2M,
ota_1,    0, ota_1,     0x600000, 2M,
so can i use 8mb of flash in esp32? or i need to interface external flash or sd card?
--
Somesh Burkule

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: partition table

Postby fly135 » Wed Aug 29, 2018 6:49 pm

burkulesomesh43 wrote:so can i use 8mb of flash in esp32? or i need to interface external flash or sd card?
You can use 8MB of flash if you are using the WROVER version of the ESP32. If you are using the WROOM version then you need to make your partitions smaller as it only has 4MB.

Who is online

Users browsing this forum: Bing [Bot] and 122 guests