Page 1 of 2

partation table questions

Posted: Tue Dec 06, 2016 3:42 pm
by wziy520
1. example
# Espressif ESP32 Partition Table
# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, 0, 0, 0x10000, 1M
ota_0, 0, ota_0, , 1M
ota_1, 0, ota_1, , 1M

1. why not list 0x0000 ~0x8FFF,this part of space reserve for what type of using ?
2. make flash , does all binary flash to SPI flash, where the binary stored, from which addr?
3. does NVS write by page, and erase by block, what kind of variables recommend to save to NVS,?

Re: partation table questions

Posted: Tue Dec 06, 2016 4:00 pm
by kolban
The address space of the SPI flash is architected by Espressif. I'm imagining that all addresses south of 0x1 0000 are architected for exclusive use by ESP32 internals ... and you must not use them. I believe address 0x1 0000 onwards is available for your application and data usage.

When we run make flash, the esptool.py is run which copies three files into flash address space:

bootloader.bin -> 0x1000
partitions.bin -> 0x8000
app.bin -> 0x1 0000

The API for Non Volatile Storage appears to be well documented here ...

http://esp-idf.readthedocs.io/en/latest ... flash.html

The different types of variables you can store are rich including signed and unsigned numerics, strings and blobs. The purpose of NVS storage is to persist data between boots. A classic example might be to store configuration data such as your WiFi connection configuration, passwords for remote web services that your app may call etc etc.

Re: partation table questions

Posted: Wed Dec 07, 2016 4:08 am
by ESP_Sprite
If I recall correctly, space from 0x0 to 0x1000 is reserved for secureboot stuff; it's unused if you do not use that. Address 0x1000-0x8000 is reserved for the 2nd stage bootloader. Address 0x8000 is where the partition table starts; the 2nd stage bootloader uses that to load whatever else you have in memory.

Re: partation table questions

Posted: Tue Jan 03, 2017 10:14 am
by zizoalbert
Hello
i have a question about partition table and bootloader:
If we use OTA1 and OTA2, how can i choose in what OTA i want to boot my device ? TKX

Re: partation table questions

Posted: Tue Jan 03, 2017 1:22 pm
by ESP_Sprite
In general, you do not. The bootloader will always pick the last successfully flashed OTA partition and boot that.

Re: partation table questions

Posted: Tue Jan 03, 2017 2:24 pm
by zizoalbert
Thank you for your help
but i have two others questions (plz)
1- So to flash the OTA1 app for example, i must run flash just the app in address (0x10000 + 1M), then the boot-loader will boot in it ?
2- If -one day- we will want to boot in our factory app, how can we do ?

Thank you for your help

Re: partation table questions

Posted: Tue Jan 03, 2017 2:31 pm
by zizoalbert
Hello,
why they said that the boot-loader will read some parameters in OTADATA (partition after NVS) and boot in the partition that corresponds to the parameters read in OTADATA ?

Thank you

Re: partation table questions

Posted: Tue Jan 03, 2017 3:06 pm
by ESP_Sprite
You should use the OTA API, it takes care of flashing to the correct OTA partition and setting the OTADATA information correctly. At the moment we do not have a way to boot to the factory firmware yet; we have some plans to have user-configurable hooks for that but nothing concrete yet. For now, you can copy the bootloader code to your own project and put in a condition to boot the factory f/w yourself.

Re: partation table questions

Posted: Wed Jan 04, 2017 8:01 am
by zizoalbert
thank you for your help, but where can i find the bootloader code (is it the code that we find in component/bootloader ? or there is a github for bootloader source ?

TKX

Re: partation table questions

Posted: Wed Jan 04, 2017 10:29 am
by WiFive
zizoalbert wrote:is it the code that we find in component/bootloader ?
Yes