Closed Ananyaaynana closed 8 months ago
Can you fill in the missing information from https://github.com/zephyrproject-rtos/zephyr/blob/main/.github/ISSUE_TEMPLATE/001_bug_report.md ? This information is not optional
@Ananyaaynana, Hi, I just tested the code on latest main branch using a esp32c3_devkitm
and I could not spot the issue. Can you read the output below and confirm if there is any? In case there is no error, would you try erasing your device's flash memory prior running the same code? Use west flash --erase
.
*** Booting Zephyr OS build zephyr-v3.5.0-2784-ged610400bcb7 ***
[00:00:00.000,000] <dbg> fs_nvs: nvs_recover_last_ate: Recovering last ate from sector 0
[00:00:00.019,000] <inf> fs_nvs: 3 Sectors of 4096 bytes
[00:00:00.019,000] <inf> fs_nvs: alloc wra: 0, e50
[00:00:00.019,000] <inf> fs_nvs: data wra: 0, 2c8
Id: 3, Reboot_counter: 49
Id: 5, Longarray: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
Rebooting in ...5
Rebooting in ...4
Rebooting in ...3
Rebooting in ...2
Rebooting in ...1
Doing last reboot...
I (33) boot: ESP-IDF eb7e415dc1 2nd stage bootloader
I (33) boot: compile time 13:11:31
I (33) boot: chip revision: 3
I (35) boot.esp32c3: SPI Speed : 40MHz
I (40) boot.esp32c3: SPI Mode : DIO
I (45) boot.esp32c3: SPI Flash Size : 4MB
I (50) boot: Enabling RNG early entropy source...
I (55) boot: Partition Table:
I (59) boot: ## Label Usage Type ST Offset Length
I (66) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (73) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (81) boot: 2 factory factory app 00 00 00010000 00100000
I (88) boot: End of partition table
I (93) esp_image: segment 0: paddr=00010020 vaddr=00000020 size=0001ch ( 28)
I (101) esp_image: segment 1: paddr=00010044 vaddr=3fc86e10 size=000f0h ( 240) load
I (109) esp_image: segment 2: paddr=0001013c vaddr=3fc86f00 size=0027ch ( 636) load
I (118) esp_image: segment 3: paddr=000103c0 vaddr=40380000 size=05818h ( 22552) load
I (132) esp_image: segment 4: paddr=00015be0 vaddr=00000000 size=0a458h ( 42072)
I (143) esp_image: segment 5: paddr=00020040 vaddr=3c000040 size=01b18h ( 6936) map
I (145) esp_image: segment 6: paddr=00021b60 vaddr=00000000 size=0e4b8h ( 58552)
I (164) esp_image: segment 7: paddr=00030020 vaddr=42010020 size=05150h ( 20816) map
I (170) boot: Loaded app from partition at offset 0x10000
I (170) boot: Disabling RNG early entropy source...
*** Booting Zephyr OS build zephyr-v3.5.0-2784-ged610400bcb7 ***
[00:00:00.000,000] <dbg> fs_nvs: nvs_recover_last_ate: Recovering last ate from sector 0
[00:00:00.019,000] <inf> fs_nvs: 3 Sectors of 4096 bytes
[00:00:00.019,000] <inf> fs_nvs: alloc wra: 0, e48
[00:00:00.019,000] <inf> fs_nvs: data wra: 0, 2cc
Id: 3, Reboot_counter: 50
Id: 5, Longarray: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
Reboot counter reached max value.
Reset to 0 and exit test.
Sylvio
Hello, Even after using west flash --erase I am getting the same warning message:
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
Description
I want to store 19 arrays each having 250 elements. So I wanted to test if long arrays can be stored into the file system hence modified the nvs sample code.
`uint32_t longarray[NUM_ELEMENTS]; My array for this example is defined like this where NUM_ELEMENTS is 128.
I modified the sample code to read and write the reboot counter and longarray from nvs. While it works fine I am getting this line after every reboot
"0x40380484: esp_restart_noos at /home/ananya/zephyrproject/zephyr/soc/riscv/esp32c3/soc.c:156 (discriminator 1)"
The output of
addr2line -e build/zephyr/zephyr.elf 0x40380484
gives/home/ananya/zephyrproject/zephyr/soc/riscv/esp32c3/soc.c:156 (discriminator 1)
The code at this line is
while (true) { ; }
I am not able to understand what this means and why is this line occurring. When I run the original sample program I dont get this line.
Target platform 1) board: esp32c3_devkitm 2) OS: Ubuntu 22.04.3 LTS
To reproduce: 1) Navigate to ~/zephyrproject/zephyr/samples/subsys/nvs 2) west build -b esp32c3_devkitm 3) west flash 4) west espressif monitor This is the output I got: `SPIWP:0xee mode:DIO, clock div:2 load:0x3fcd6100,len:0x15e4 load:0x403ce000,len:0x920 load:0x403d0000,len:0x2c4c SHA-256 comparison failed: Calculated: 362e353aa64055f1f8559cf52d6e52673a816d7fc5760cd8f0b2b2414d986d48 Expected: 12e05f5d029cf7e92182617c52e10b052fa14f444d047d0fbec142815860c63a Attempting to boot anyway... entry 0x403ce000 I (53) boot: ESP-IDF a06af2476 2nd stage bootloader I (53) boot: compile time 11:54:48 I (54) boot: chip revision: 3 I (55) boot.esp32c3: SPI Speed : 40MHz I (60) boot.esp32c3: SPI Mode : DIO I (65) boot.esp32c3: SPI Flash Size : 4MB I (70) boot: Enabling RNG early entropy source... I (75) boot: Partition Table: I (79) boot: ## Label Usage Type ST Offset Length I (86) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (93) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (101) boot: 2 factory factory app 00 00 00010000 00100000 I (108) boot: End of partition table I (113) esp_image: segment 0: paddr=00010020 vaddr=00000020 size=0001ch ( 28) I (121) esp_image: segment 1: paddr=00010044 vaddr=3fc86da0 size=000d8h ( 216) load I (129) esp_image: segment 2: paddr=00010124 vaddr=3fc86e78 size=0027ch ( 636) load I (138) esp_image: segment 3: paddr=000103a8 vaddr=40380000 size=057ech ( 22508) load I (152) esp_image: segment 4: paddr=00015b9c vaddr=00000000 size=0a49ch ( 42140) I (164) esp_image: segment 5: paddr=00020040 vaddr=3c000040 size=011c4h ( 4548) map I (165) esp_image: segment 6: paddr=0002120c vaddr=00000000 size=0ee0ch ( 60940) I (185) esp_image: segment 7: paddr=00030020 vaddr=42010020 size=070c4h ( 28868) map I (193) boot: Loaded app from partition at offset 0x10000 I (193) boot: Disabling RNG early entropy source... � Booting Zephyr OS build zephyr-v3.3.0-530-g1751c8f0f59d [00:00:00.000,000] fs_nvs: nvs_recover_last_ate: Recovering last ate from sector 0
[00:00:00.000,000] fs_nvs: 3 Sectors of 4096 bytes
[00:00:00.000,000] fs_nvs: alloc wra: 0, c88
[00:00:00.000,000] fs_nvs: data wra: 0, 798
Id: 3, Reboot_counter: 49
Id: 5, Longarray: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
Rebooting in ...5 Rebooting in ...4 Rebooting in ...3 Rebooting in ...2 Rebooting in ...1 Doing last reboot... ESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0xc (RTC_SW_CPU_RST),boot:0xc (SPI_FAST_FLASH_BOOT) Saved PC:0x40380484 0x40380484: esp_restart_noos at /home/ananya/zephyrproject/zephyr/soc/riscv/esp32c3/soc.c:156 (discriminator 1) `
Expected behavior Booting Zephyr OS v1.12.0-rc1-176-gf091be783 [fs/nvs] [DBG] nvs_reinit: (Re)Initializing sectors [fs/nvs] [DBG] _nvs_sector_init: f->write_location set to c [fs/nvs] [INF] nvs_mount: maximum storage length 256 byte [fs/nvs] [INF] nvs_mount: write-align: 1, write-addr: c [fs/nvs] [INF] nvs_mount: entry sector: 0, entry sector ID: 1 No address found, adding 192.168.1.1 at id 1 No key found, adding it at id 2 No Reboot counter found, adding it at id 3 Id: 4 not found, adding it Longarray not found, adding it as id 4 Reboot counter history: ...0 Oldest reboot counter: 0 Rebooting in ...5...4...3...2...1 Booting Zephyr OS v1.12.0-rc1-176-gf091be783 [fs/nvs] [INF] nvs_mount: maximum storage length 256 byte [fs/nvs] [INF] nvs_mount: write-align: 1, write-addr: c7 [fs/nvs] [INF] nvs_mount: entry sector: 0, entry sector ID: 1 Entry: 1, Address: 192.168.1.1 Id: 2, Key: ff fe fd fc fb fa f9 f8 Id: 3, Reboot_counter: 1 Id: 4, Data: DATA Id: 5, Longarray: 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18 Reboot counter history: ...1...0 Oldest reboot counter: 0 Rebooting in ...5...4...3...2...1 ...
Impact Not able to flash data into non-volatile storage.
Environment 1) OS:Ubuntu 22.04.3 LTS 2) Toolchain: Zephyr-sdk-0.15.2 3) Commit: 1751c8f0f59df423fb31231856031776cf78f7ce
Additional Info This is my code so to reproduce the error This is the code:
//Second change to make storage partition to cellmodel_partition.
define NVS_PARTITION cellmodel_partition
define NVS_PARTITION_DEVICE FIXED_PARTITION_DEVICE(NVS_PARTITION)
define NVS_PARTITION_OFFSET FIXED_PARTITION_OFFSET(NVS_PARTITION)
/ 1000 msec = 1 sec /
define SLEEP_TIME 400
/ maximum reboot counts, make high enough to trigger sector change (buffer / / rotation). /
define MAX_REBOOT 50
define RBT_CNT_ID 3
define LONG_ID 5
//First change to make 128 a macro.
define NUM_ELEMENTS 128
int main(void) { int rc = 0, cnt = 0, cnt_his = 0; //Third change is longarray from uint8 to uint 32. uint32_t longarray[NUM_ELEMENTS]; uint32_t reboot_counter = 0U; struct flash_pages_info info;
}
I have created an app.overlay file to create a separate partition for writing into the flash named cellmodel_partition starting from 25600H and has a length of 2000H.