ota data partition info error

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

ota data partition info error

Postby Ritesh » Wed Jan 04, 2017 2:53 pm

Hi,

I am getting following error while selecting OTA 2 partition option from make menuconfig. please let me know if anyone has any idea or clue for that.
Welcome to minicom 2.5

OPTIONS: I18n
Compiled on May 2 2011, 00:39:27.
Port /dev/ttyUSB0

Press CTRL-A Z for help on special keys

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x16 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x16 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3ffc0008,len:4
load:0x3ffc000c,len:2752
ho 0 tail 12 room 4
load:0x40078000,len:4120
ho 0 tail 12 room 4
load:0x40080000,len:260
entry 0x40080034
I (32) boot: Espressif ESP32 2nd stage bootloader v. V0.1
I (40) boot: compile time 20:08:29
I (62) boot: SPI Speed : 40MHz
I (63) boot: SPI Mode : DIO
I (63) boot: SPI Flash Size : 16MB
I (65) boot: Partition Table:
I (70) boot: ## Label Usage Type ST Offset Length
I (81) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (92) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (103) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (115) boot: 3 factory factory app 00 00 00010000 00100000
I (126) boot: 4 ota_0 OTA app 00 10 00110000 00100000
I (137) boot: 5 ota_1 OTA app 00 11 00210000 00100000
I (148) boot: End of partition table
E (155) boot: ota data partition info error
user code done
Bootloader is stored at 0x1000, application is stored at 0x10000 and partitions_two_ota.bin file is stored at 0x8000 locations using make flash command.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ota data partition info error

Postby Ritesh » Wed Jan 04, 2017 3:02 pm

Hi,

I have also tried with custom csv partitions as well but issue remains same.

# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 1M
ota_0, app, ota_0, 0x110000, 2M
ota_1, app, ota_1, 0x310000, 2M

Please let me know if anyone has any idea for this issue.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ota data partition info error

Postby Ritesh » Wed Jan 04, 2017 3:22 pm

Hi All,

We are using ESP32-idf RTOS SDK of 20th December GIT Release with following last commits.
commit cca883490e3d7142457309d54ab3d692cf5c2d0d
Merge: ba08d1a d60ff9b
Author: Wu Jian Gang <wujiangang@espressif.com>
Date: Tue Dec 20 11:18:17 2016 +0800

Merge branch 'bugfix/tcpip_adapter_set_ip_info' into 'master'

Fix set static IP address issue

Set static IP address, clear current DNS servers default.

See merge request !310
So, Please let me know if this issue has been fixed into latest SDK or anyone has any idea or clue to solve this type of issue.
Regards,
Ritesh Prajapati

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ota data partition info error

Postby ESP_Angus » Wed Jan 04, 2017 8:48 pm

If the OTA partition has leftover data in it from a previous flash, it will error out in this way. Try "esptool.py --port PORT erase_flash" to erase the flash.

(On more recent esp-idf versions, ie current master, you can run "make erase_flash" for the same result.)

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ota data partition info error

Postby Ritesh » Wed Jan 04, 2017 10:01 pm

ESP_Angus wrote:If the OTA partition has leftover data in it from a previous flash, it will error out in this way. Try "esptool.py --port PORT erase_flash" to erase the flash.

(On more recent esp-idf versions, ie current master, you can run "make erase_flash" for the same result.)
Thanks for reply.

It means OTA data partition has been corrupted due to some way and it can be resolved using flash erase command. But I want to know that what part of ESP32 section will write that OTA data partition?

Please let me know if you have any idea...
Regards,
Ritesh Prajapati

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ota data partition info error

Postby ESP_Angus » Thu Jan 05, 2017 12:08 am

Running an OTA update will write to this section, as it contains metadata about which OTA partition is currently selected.

However, if you previously ran different (non-OTA) code on this module, with a different partition table, then there can be invalid data there from before OTA was even enabled.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ota data partition info error

Postby Ritesh » Thu Jan 05, 2017 1:53 am

ESP_Angus wrote:Running an OTA update will write to this section, as it contains metadata about which OTA partition is currently selected.

However, if you previously ran different (non-OTA) code on this module, with a different partition table, then there can be invalid data there from before OTA was even enabled.
OK. Got it. Let me check by erasing SPI flash memory and will let you know if it is working or not.

Because, I have flashed OTA as well as non OTA code multiple times on this module which causes this issue.

Thanks for support.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ota data partition info error

Postby Ritesh » Thu Jan 05, 2017 4:57 am

Hi,

I have checked with flash_erase and it works for me but it seems like if i change partition table then it is going to create problem which means that I have to finalize partition table onetime to recover this issue.

Let me know if i am wrong.
Regards,
Ritesh Prajapati

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ota data partition info error

Postby ESP_Angus » Thu Jan 05, 2017 8:00 am

Ritesh wrote: I have checked with flash_erase and it works for me but it seems like if i change partition table then it is going to create problem which means that I have to finalize partition table onetime to recover this issue.
You don't necessarily have to finalize the partition table, but if you move the ota_data partition then you'll need to erase the flash in that partition. (You can do this by erasing the entire flash, or using esptool.py erase_region to erase the ota_data partition's sectors only.)

Angus

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ota data partition info error

Postby Ritesh » Thu Jan 05, 2017 10:20 am

Hi,

Thanks for Reply.

I have one quick question that can I allocate more than 1 MB for OTA Factory and OTA_0 partitions as i have tried with following OTA Partition CSV file but not worked.

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

Above partition table is only working if allocated factory and ota_0 partitions as 1MB. Even if I have also tried with 1.5 MB but issue remains same.

Please let me know if there is any limitations for that.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 155 guests