Trying to change partition table

Josh_T
Posts: 4
Joined: Mon Jan 30, 2017 7:28 pm

Trying to change partition table

Postby Josh_T » Fri Jul 21, 2017 4:37 pm

Hello, I'm having trouble trying to change the partition table to use the rest of our 16M flash chip with espressif's nvs api.

I created the custom .csv and specified its location in menuconfig, where I also updated the app start address and saved the sdkconfig file. Next, I run "make partition_table" which generates the binary partition table from the custom csv. when I run make and flash the esp32, the chip is stuck in a reset loop that appears to come from nvs_flash_init_custom() (based on the printed Backtrace). This suggests that the application image is being loaded correctly, but the nvs driver does not have the correct symbols defined to properly initialize its flash partition.

I've played with the order, size, and offsets of the three lines in the default singleapp_partition table to get a custom csv. typically these attempts look something like...

Code: Select all

# Name,   Type, SubType, Offset,  Size, Flags	
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 1M,
nvs,      data, nvs,     ,  	  12M,
note: I get the following warning when exiting menuconfig...
/sdkconfig:84:warning: symbol value '' invalid for PHY_DATA_OFFSET
sdkconfig line 84 appears to supply no value for CONFIG_PHY_DATA_OFFSET, and this is overwritten whenever make is invoked. My guess is that there is an additional setting file I need to edit or my project structure is somehow throwing off the make system.

Josh

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Trying to change partition table

Postby ESP_igrr » Sat Jul 22, 2017 7:44 am

That is probably a bug in NVS. Please open an issue on GitHub, attaching your code, sdkconfig, and the partition table. I won't have access to any 16M boards to debug this for another 2-3 weeks, but if you log your issue on GitHub it will not be forgotten by then.

Josh_T
Posts: 4
Joined: Mon Jan 30, 2017 7:28 pm

Re: Trying to change partition table

Postby Josh_T » Mon Aug 14, 2017 5:54 pm

OK, bug was posted. Is anyone looking at this? Seems like something that should be fixed if it is a legit bug and not something dumb on my part.

https://github.com/espressif/esp-idf/issues/834

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Trying to change partition table

Postby ESP_igrr » Wed Aug 16, 2017 11:09 am

Thanks for reporting this. The issue seems to be present only for large partitions, which is not a common use case for NVS, this is why this issue did not receive high priority. We'll definitely fix the crash in the next IDF version, but operations with such partition may still be very slow.

Josh_T
Posts: 4
Joined: Mon Jan 30, 2017 7:28 pm

Re: Trying to change partition table

Postby Josh_T » Wed Aug 23, 2017 8:12 pm

So I have a couple questions on this. First, what are the practical limits to what I can allocate for the nvs? You mentioned that performance falls off for larger partitions, so if I am able to get 1 or 2M working, will it be unbearably slow? Second, is there any documentation for accessing the Flash outside the partition table directly? I note that flash_ops.c seems to have a lot of the functions I would expect for doing this.

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: Trying to change partition table

Postby ESP_Sprite » Thu Aug 24, 2017 2:50 am

On your second question: the first part of the API reference on this page has all the flash access methods that are public.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Trying to change partition table

Postby ESP_igrr » Mon Sep 04, 2017 5:03 am

Small update on NVS performance for large partition sizes. Currently we need to read every flash sector when initializing NVS. Changing this would require significant modifications of NVS (adding an index, for example), at which point it will stop being a simple log-based storage. The time it takes to read single page in flash is around 400-500us, if SPI flash is working at 80MHz frequency. Multiply that by the number of 4-kilobyte sectors in the partition, and you will get the absolute minimum init time for NVS. Currently it is slightly worse than that because we read in blocks smaller than 4kB, but this part can be optimized.

Who is online

Users browsing this forum: tahseenabbas52 and 94 guests