Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TW#24593] Complete allocated NVS partition not available #2216

Closed
hvishu opened this issue Jul 23, 2018 · 2 comments
Closed

[TW#24593] Complete allocated NVS partition not available #2216

hvishu opened this issue Jul 23, 2018 · 2 comments

Comments

@hvishu
Copy link

hvishu commented Jul 23, 2018

I have attached the modified blink project. I have allocated 36K (in partition.csv), but when I try to get the nvs allocated I get 23K.

How do we calculate the available NVS data for the app from the allocated done through partition table?
blink.zip

Log on Bootup

LOG
Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Feb 7 2016, 13:37:27.
Port /dev/ttyUSB0, 16:56:40

Press CTRL-A Z for help on special keys

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5556
load:0x40078000,len:0
load:0x40078000,len:13756
entry 0x40078fb4
I (28) boot: ESP-IDF v3.0-dirty 2nd stage bootloader
I (28) boot: compile time 16:53:41
I (28) boot: Enabling RNG early entropy source...
I (33) boot: SPI Speed : 40MHz
I (37) boot: SPI Mode : DIO
I (41) boot: SPI Flash Size : 4MB
I (45) boot: Partition Table:
I (49) boot: ## Label Usage Type ST Offset Length
I (56) boot: 0 phy_init RF data 01 01 00009000 00001000
I (64) boot: 1 aws_config unknown 41 00 0000a000 00001000
I (71) boot: 2 aws_cert unknown 40 00 0000b000 00002000
I (79) boot: 3 tlc_bin unknown 42 00 0000d000 00002000
I (86) boot: 4 nvs WiFi data 01 02 0000f000 00009000
I (94) boot: 5 otadata OTA data 01 00 0001a000 00002000
I (101) boot: 6 model_bin unknown 43 00 0001c000 00002000
I (109) boot: 7 valve_bin unknown 44 00 0001e000 00000300
I (116) boot: 8 prog_bin unknown 45 00 0001f000 00000100
I (124) boot: 9 ota_0 OTA app 00 10 00020000 00160000
I (131) boot: 10 ota_1 OTA app 00 11 00180000 00160000
I (139) boot: End of partition table
I (143) boot: No factory image, trying OTA 0
I (148) esp_image: segment 0: paddr=0x00020020 vaddr=0x3f400020 size=0x05bfc ( 23548) map
I (165) esp_image: segment 1: paddr=0x00025c24 vaddr=0x3ffb0000 size=0x02190 ( 8592) load
I (169) esp_image: segment 2: paddr=0x00027dbc vaddr=0x40080000 size=0x00400 ( 1024) load
I (175) esp_image: segment 3: paddr=0x000281c4 vaddr=0x40080400 size=0x07e4c ( 32332) load
I (197) esp_image: segment 4: paddr=0x00030018 vaddr=0x400d0018 size=0x153d4 ( 86996) map
I (228) esp_image: segment 5: paddr=0x000453f4 vaddr=0x4008824c size=0x006d8 ( 1752) load
I (229) esp_image: segment 6: paddr=0x00045ad4 vaddr=0x400c0000 size=0x00000 ( 0) load
I (240) boot: Loaded app from partition at offset 0x20000
I (241) boot: Disabling RNG early entropy source...
I (246) cpu_start: Pro cpu up.
I (250) cpu_start: Starting app cpu, entry point is 0x4008102c
I (0) cpu_start: App cpu up.
I (261) heap_init: Initializing. RAM available for dynamic allocation:
I (267) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (273) heap_init: At 3FFB29C0 len 0002D640 (181 KiB): DRAM
I (280) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (286) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (292) heap_init: At 40088924 len 000176DC (93 KiB): IRAM
I (299) cpu_start: Pro cpu start user code
I (317) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (597) APP_DEBUG: nvsSize = 36864
I (607) APP_DEBUG: numberOfChunks = 36
I (607) APP_DEBUG: (0) tempBlkName = mfgBlk0
I (607) APP_DEBUG: (1) tempBlkName = mfgBlk1
I (617) APP_DEBUG: (2) tempBlkName = mfgBlk2
I (617) APP_DEBUG: (3) tempBlkName = mfgBlk3
I (627) APP_DEBUG: (4) tempBlkName = mfgBlk4
I (627) APP_DEBUG: (5) tempBlkName = mfgBlk5
I (637) APP_DEBUG: (6) tempBlkName = mfgBlk6
I (637) APP_DEBUG: (7) tempBlkName = mfgBlk7
I (647) APP_DEBUG: (8) tempBlkName = mfgBlk8
I (647) APP_DEBUG: (9) tempBlkName = mfgBlk9
I (657) APP_DEBUG: (10) tempBlkName = mfgBlk10
I (657) APP_DEBUG: (11) tempBlkName = mfgBlk11
I (667) APP_DEBUG: (12) tempBlkName = mfgBlk12
I (667) APP_DEBUG: (13) tempBlkName = mfgBlk13
I (677) APP_DEBUG: (14) tempBlkName = mfgBlk14
I (677) APP_DEBUG: (15) tempBlkName = mfgBlk15
I (687) APP_DEBUG: (16) tempBlkName = mfgBlk16
I (687) APP_DEBUG: (17) tempBlkName = mfgBlk17
I (697) APP_DEBUG: (18) tempBlkName = mfgBlk18
I (697) APP_DEBUG: (19) tempBlkName = mfgBlk19
I (707) APP_DEBUG: (20) tempBlkName = mfgBlk20
I (707) APP_DEBUG: (21) tempBlkName = mfgBlk21
I (717) APP_DEBUG: (22) tempBlkName = mfgBlk22
I (717) APP_DEBUG: (23) tempBlkName = mfgBlk23
I (727) APP_DEBUG: (24) tempBlkName = mfgBlk24
I (727) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (727) APP_DEBUG: app_main(110) Error = 0x1105 at index: 24
I (737) APP_DEBUG: (25) tempBlkName = mfgBlk25
I (747) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (747) APP_DEBUG: app_main(110) Error = 0x1105 at index: 25
I (757) APP_DEBUG: (26) tempBlkName = mfgBlk26
I (757) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (767) APP_DEBUG: app_main(110) Error = 0x1105 at index: 26
I (777) APP_DEBUG: (27) tempBlkName = mfgBlk27
I (777) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (787) APP_DEBUG: app_main(110) Error = 0x1105 at index: 27
I (787) APP_DEBUG: (28) tempBlkName = mfgBlk28
I (797) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (797) APP_DEBUG: app_main(110) Error = 0x1105 at index: 28
I (807) APP_DEBUG: (29) tempBlkName = mfgBlk29
I (817) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (817) APP_DEBUG: app_main(110) Error = 0x1105 at index: 29
I (827) APP_DEBUG: (30) tempBlkName = mfgBlk30
I (827) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (837) APP_DEBUG: app_main(110) Error = 0x1105 at index: 30
I (847) APP_DEBUG: (31) tempBlkName = mfgBlk31
I (847) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (857) APP_DEBUG: app_main(110) Error = 0x1105 at index: 31
I (857) APP_DEBUG: (32) tempBlkName = mfgBlk32
I (867) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (867) APP_DEBUG: app_main(110) Error = 0x1105 at index: 32
I (877) APP_DEBUG: (33) tempBlkName = mfgBlk33
I (887) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (887) APP_DEBUG: app_main(110) Error = 0x1105 at index: 33
I (897) APP_DEBUG: (34) tempBlkName = mfgBlk34
I (897) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (907) APP_DEBUG: app_main(110) Error = 0x1105 at index: 34
I (917) APP_DEBUG: (35) tempBlkName = mfgBlk35
I (917) APP_DEBUG: esphal_nvs_write(52) Error (0x1105) !
E (927) APP_DEBUG: app_main(110) Error = 0x1105 at index: 35

CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7 | VT102 | Offline | ttyUSB0
root@vishwanatha-L460:~/esp/rel_v3_0/examples/get-started/blink# cat partitions.csv

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, 0x6000,
phy_init, data, phy, 0x9000, 0x1000,
aws_config,0x41, 0x00, 0xA000, 0x1000,
aws_cert, 0x40, 0x00, 0xB000, 0x2000,
tlc_bin, 0x42, 0x00, 0xD000, 0x2000,
nvs, data, nvs, 0xF000, 0x9000,
#0x2000 gap
otadata, data, ota, 0x1A000, 0x2000,
#18 models with 440 size each is possible
model_bin, 0x43, 0x00, 0x1C000, 0x2000,
#10 valuves with 75 size each is possible
valve_bin, 0x44, 0x00, 0x1E000, 0x300,
#1 program bin
prog_bin, 0x45, 0x00, 0x1F000, 0x100,
#ota partition
ota_0, app, ota_0, 0x20000, 0x160000,
ota_1, app, ota_1, , 0x160000,
root@vishwanatha-L460:~/esp/rel_v3_0/examples/get-started/blink#

@negativekelvin
Copy link
Contributor

negativekelvin commented Jul 23, 2018

You should not expect to be able to store 36 1k blobs in a 36k nvs partition. There is an overhead. 36k is 9 pages, 1 page must be free so you have 8 pages and with overhead you can store 3 blobs per page so 3*8=24.

@FayeY FayeY changed the title Complete allocated NVS partition not available [TW#24593] Complete allocated NVS partition not available Jul 26, 2018
@hvishu
Copy link
Author

hvishu commented Aug 5, 2018

Thank you

@hvishu hvishu closed this as completed Aug 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants