[solved] nvs_flash_init ./. nvs_flash_init_custom

User avatar
rudi ;-)
Posts: 1726
Joined: Fri Nov 13, 2015 3:25 pm

[solved] nvs_flash_init ./. nvs_flash_init_custom

Postby rudi ;-) » Mon Oct 03, 2016 3:42 am

[NO Hurry! - after holiday is enough]

hi guys
saw the last change for this by chance
in the last try project i used nvs_flash_init(6, 3); and standard partion table from menuconfig. "single factory app, no ota"
because
Temporarily, this region is hardcoded as a 12KB (0x3000 byte)
region starting at 24KB (0x6000 byte) offset in flash


with update on SDK on nvs_flash now we can use nvs_flash_init_custom with same parameters before in nvs_flash_init
and parameters for nvs_flash_init is now (void)
https://github.com/espressif/esp-idf/bl ... lash.h#L26


if we use the standard from the menuconfig, we do not create own partion table or other and we select "single factory app, no ota",
we can use nvs_flash_init_custom(6, 3); again or we need to use nvs_flash(void); ? and this has the same effect like nvs_flash_init_custom(6, 3); ?

the things are the same now`?
nvs_flash_init_custom(6, 3);
nvs_flash_init_(void);

because we do not change the partion, then we use better hardcoded version and now without parameters?
nvs_flash_init_(void);


i ask, because since last change, got "to many arguments" from compiler i used nvs_flash_init(6, 3); with the newer changed SDK.


best wishes
rudi ;-)
Last edited by rudi ;-) on Tue Oct 04, 2016 8:40 am, edited 1 time in total.
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

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

Re: nvs_flash_init ./. nvs_flash_init_custom

Postby ESP_Angus » Mon Oct 03, 2016 11:33 pm

Hi Rudi,

Sorry for the rapid changes with this function!

* nvs_flash_init is currently hard-coded to call nvs_flash_init_custom(6,3) - 0x3000 bytes at offset 0x6000. Partition table is ignored right now. However, nvs_flash_init() will eventually use the partition table in order to find the NVS data partition, and use this partition instead of the hard-coded region.

* nvs_flash_init_custom() allows you to specify any hard-coded offsets instead. This function will always ignore the partition table.

For now I'd recommend using "nvs_flash_init()" unless you really need a larger NVS storage space. In which case you have to use nvs_flash_init_custom() at the moment, although for V1.0 you will be able to change the partition table layout instead (which will be the recommended way to change the NVS layout.)

Angus

User avatar
rudi ;-)
Posts: 1726
Joined: Fri Nov 13, 2015 3:25 pm

Re: nvs_flash_init ./. nvs_flash_init_custom

Postby rudi ;-) » Tue Oct 04, 2016 8:13 am

ESP_Angus wrote:Hi Rudi,

Sorry for the rapid changes with this function!
Hi Angus

no no this is ok ;-) go on further rapid ;-) - this is a good time to learn how the things are combine work
and we happy for the "extended" code now and it is better understand with this parametry custom function.
Well done!
ESP_Angus wrote:
* nvs_flash_init is currently hard-coded to call nvs_flash_init_custom(6,3) - 0x3000 bytes at offset 0x6000. Partition table is ignored right now. However, nvs_flash_init() will eventually use the partition table in order to find the NVS data partition, and use this partition instead of the hard-coded region.

* nvs_flash_init_custom() allows you to specify any hard-coded offsets instead. This function will always ignore the partition table.

For now I'd recommend using "nvs_flash_init()" unless you really need a larger NVS storage space. In which case you have to use nvs_flash_init_custom() at the moment, although for V1.0 you will be able to change the partition table layout instead (which will be the recommended way to change the NVS layout.)

Angus
Thank you so much for your time on this and the detailed Info.
It is clear now, thanks for the instruction
- i use now "nvs_flash_init()" for Basic Standard projects unless not need larger NVS storage space.

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Who is online

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