开发板的nvs分区可以写入,但是无法正常读取出来
Posted: Sat Sep 03, 2022 2:29 pm
ESP32-S3-DevKitC-1 v1.1 开发板。
这个开发板大概是半年前我买的,一直在用。最近调试的时候一直发现,程序运行不正常,上一个蓝牙信息掉电的问题也是我发布的。今天终于找打原因了。
这个板子的nvs分区可以正常写入,但是读取出来的时候数据读不出来。下面的日志是我测试的nvs_rw_value这个例程的日志。发现数据读取不出来。这个日志是官方例程直接编译烧写的,一点修改都没有。
今天下午我在测试adf 的tone分区音乐播放时也出现了,tone数据写入flash成功了,用esp_tool.py 脚本吧flash读取出来,发现也确实写入了。但是在程序里面读取的时候返回的值就是0xFF。但是相同的程序写入其他开发板就好使。所以怀疑是这个开发板的问题。
但是这个开发板的nvs分区 tone分区我都修改位置都一样读取出来不正确。但是很奇怪的是编译好的程序都能正常运行。
麻烦官方的看一下吧,是哪里有缺陷还是什么问题。应该不是flash的问题,因为吧程序分区换个位置也都能正产运行。
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x18 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
SHA-256 comparison failed:
Calculated: ec8c1078b7d7c602da6213cd1ee1bd86839f52775356993d8b6aba512a420298
Expected: 5699852c304c8aea9492aedf7506f40820beaaf5f9c5075df5cc7cd8433ee3c4
Attempting to boot anyway...
entry 0x403c9954
I (50) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (51) boot: compile time 22:20:03
I (51) boot: chip revision: 0
I (53) boot.esp32s3: Boot SPI Speed : 80MHz
I (58) boot.esp32s3: SPI Mode : SLOW READ
I (63) boot.esp32s3: SPI Flash Size : 16MB
I (68) boot: Enabling RNG early entropy source...
I (73) boot: Partition Table:
I (77) boot: ## Label Usage Type ST Offset Length
I (84) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (91) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (99) boot: 2 factory factory app 00 00 00010000 00100000
I (106) boot: End of partition table
I (111) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=08054h ( 32852) map
I (127) esp_image: segment 1: paddr=0001807c vaddr=3fc90d60 size=026f4h ( 9972) load
I (130) esp_image: segment 2: paddr=0001a778 vaddr=40374000 size=058a0h ( 22688) load
I (142) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=1ab6ch (109420) map
I (238) cpu_start: ESP-IDF: v4.4.2-dirty
I (243) heap_init: Initializing. RAM available for dynamic allocation:
I (250) heap_init: At 3FC93E70 len 0004C190 (304 KiB): D/IRAM
I (257) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (263) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (270) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (277) spi_flash: detected chip: mxic
W (280) spi_flash: Detected flash size > 16 MB, but access beyond 16 MB is not supported for this flash model yet.
I (292) spi_flash: flash io: dio
W (295) spi_flash: Detected size(32768k) larger than the size in the binary image header(16384k). Using the size in the binary image header.
I (309) sleep: Configure to isolate all GPIO pins in sleep state
I (316) sleep: Enable automatic switching of GPIO sleep configuration
I (323) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
Opening Non-Volatile Storage (NVS) handle... Done
Reading restart counter from NVS ... The value is not initialized yet!
Updating restart counter in NVS ... Done
Committing updates in NVS ... Done
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...
Restarting in 5 seconds...
Restarting in 4 seconds...
Restarting in 3 seconds...
Restarting in 2 seconds...
Restarting in 1 seconds...
Restarting in 0 seconds...
Restarting now.
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403756a4
0x403756a4: esp_restart_noos at D:/software/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system/port/soc/esp32s3/system_internal.c:143 (discriminator 1)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
SHA-256 comparison failed:
Calculated: ec8c1078b7d7c602da6213cd1ee1bd86839f52775356993d8b6aba512a420298
Expected: 5699852c304c8aea9492aedf7506f40820beaaf5f9c5075df5cc7cd8433ee3c4
Attempting to boot anyway...
entry 0x403c9954
I (55) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (55) boot: compile time 22:20:03
I (55) boot: chip revision: 0
I (57) boot.esp32s3: Boot SPI Speed : 80MHz
I (62) boot.esp32s3: SPI Mode : SLOW READ
I (67) boot.esp32s3: SPI Flash Size : 16MB
I (72) boot: Enabling RNG early entropy source...
I (77) boot: Partition Table:
I (81) boot: ## Label Usage Type ST Offset Length
I (88) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (96) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (103) boot: 2 factory factory app 00 00 00010000 00100000
I (111) boot: End of partition table
I (115) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=08054h ( 32852) map
I (131) esp_image: segment 1: paddr=0001807c vaddr=3fc90d60 size=026f4h ( 9972) load
I (135) esp_image: segment 2: paddr=0001a778 vaddr=40374000 size=058a0h ( 22688) load
I (147) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=1ab6ch (109420) map
I (175) esp_image: segment 4: paddr=0003ab94 vaddr=403798a0 size=074c0h ( 29888) load
I (183) esp_image: segment 5: paddr=0004205c vaddr=50000000 size=00010h ( 16) load
I (189) boot: Loaded app from partition at offset 0x10000
I (189) boot: Disabling RNG early entropy source...
I (203) cpu_start: Pro cpu up.
I (204) cpu_start: Starting app cpu, entry point is 0x403750ec
0x403750ec: call_start_cpu1 at D:/software/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system/port/cpu_start.c:160
I (163) cpu_start: App cpu up.
I (218) cpu_start: Pro cpu start user code
I (218) cpu_start: cpu freq: 160000000
I (218) cpu_start: Application information:
I (221) cpu_start: Project name: nvs_rw_value
I (226) cpu_start: App version: 1
I (230) cpu_start: Compile time: Sep 3 2022 22:19:43
I (236) cpu_start: ELF file SHA256: be01ca20d393b5bc...
I (242) cpu_start: ESP-IDF: v4.4.2-dirty
I (248) heap_init: Initializing. RAM available for dynamic allocation:
I (255) heap_init: At 3FC93E70 len 0004C190 (304 KiB): D/IRAM
I (261) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (268) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (274) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (281) spi_flash: detected chip: mxic
W (285) spi_flash: Detected flash size > 16 MB, but access beyond 16 MB is not supported for this flash model yet.
I (296) spi_flash: flash io: dio
W (300) spi_flash: Detected size(32768k) larger than the size in the binary image header(16384k). Using the size in the binary image header.
I (314) sleep: Configure to isolate all GPIO pins in sleep state
I (320) sleep: Enable automatic switching of GPIO sleep configuration
I (328) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
Opening Non-Volatile Storage (NVS) handle... Done
Reading restart counter from NVS ... The value is not initialized yet!
Updating restart counter in NVS ... Done
Committing updates in NVS ... Done
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...
这个开发板大概是半年前我买的,一直在用。最近调试的时候一直发现,程序运行不正常,上一个蓝牙信息掉电的问题也是我发布的。今天终于找打原因了。
这个板子的nvs分区可以正常写入,但是读取出来的时候数据读不出来。下面的日志是我测试的nvs_rw_value这个例程的日志。发现数据读取不出来。这个日志是官方例程直接编译烧写的,一点修改都没有。
今天下午我在测试adf 的tone分区音乐播放时也出现了,tone数据写入flash成功了,用esp_tool.py 脚本吧flash读取出来,发现也确实写入了。但是在程序里面读取的时候返回的值就是0xFF。但是相同的程序写入其他开发板就好使。所以怀疑是这个开发板的问题。
但是这个开发板的nvs分区 tone分区我都修改位置都一样读取出来不正确。但是很奇怪的是编译好的程序都能正常运行。
麻烦官方的看一下吧,是哪里有缺陷还是什么问题。应该不是flash的问题,因为吧程序分区换个位置也都能正产运行。
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x18 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
SHA-256 comparison failed:
Calculated: ec8c1078b7d7c602da6213cd1ee1bd86839f52775356993d8b6aba512a420298
Expected: 5699852c304c8aea9492aedf7506f40820beaaf5f9c5075df5cc7cd8433ee3c4
Attempting to boot anyway...
entry 0x403c9954
I (50) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (51) boot: compile time 22:20:03
I (51) boot: chip revision: 0
I (53) boot.esp32s3: Boot SPI Speed : 80MHz
I (58) boot.esp32s3: SPI Mode : SLOW READ
I (63) boot.esp32s3: SPI Flash Size : 16MB
I (68) boot: Enabling RNG early entropy source...
I (73) boot: Partition Table:
I (77) boot: ## Label Usage Type ST Offset Length
I (84) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (91) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (99) boot: 2 factory factory app 00 00 00010000 00100000
I (106) boot: End of partition table
I (111) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=08054h ( 32852) map
I (127) esp_image: segment 1: paddr=0001807c vaddr=3fc90d60 size=026f4h ( 9972) load
I (130) esp_image: segment 2: paddr=0001a778 vaddr=40374000 size=058a0h ( 22688) load
I (142) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=1ab6ch (109420) map
I (238) cpu_start: ESP-IDF: v4.4.2-dirty
I (243) heap_init: Initializing. RAM available for dynamic allocation:
I (250) heap_init: At 3FC93E70 len 0004C190 (304 KiB): D/IRAM
I (257) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (263) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (270) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (277) spi_flash: detected chip: mxic
W (280) spi_flash: Detected flash size > 16 MB, but access beyond 16 MB is not supported for this flash model yet.
I (292) spi_flash: flash io: dio
W (295) spi_flash: Detected size(32768k) larger than the size in the binary image header(16384k). Using the size in the binary image header.
I (309) sleep: Configure to isolate all GPIO pins in sleep state
I (316) sleep: Enable automatic switching of GPIO sleep configuration
I (323) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
Opening Non-Volatile Storage (NVS) handle... Done
Reading restart counter from NVS ... The value is not initialized yet!
Updating restart counter in NVS ... Done
Committing updates in NVS ... Done
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...
Restarting in 5 seconds...
Restarting in 4 seconds...
Restarting in 3 seconds...
Restarting in 2 seconds...
Restarting in 1 seconds...
Restarting in 0 seconds...
Restarting now.
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403756a4
0x403756a4: esp_restart_noos at D:/software/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system/port/soc/esp32s3/system_internal.c:143 (discriminator 1)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
SHA-256 comparison failed:
Calculated: ec8c1078b7d7c602da6213cd1ee1bd86839f52775356993d8b6aba512a420298
Expected: 5699852c304c8aea9492aedf7506f40820beaaf5f9c5075df5cc7cd8433ee3c4
Attempting to boot anyway...
entry 0x403c9954
I (55) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (55) boot: compile time 22:20:03
I (55) boot: chip revision: 0
I (57) boot.esp32s3: Boot SPI Speed : 80MHz
I (62) boot.esp32s3: SPI Mode : SLOW READ
I (67) boot.esp32s3: SPI Flash Size : 16MB
I (72) boot: Enabling RNG early entropy source...
I (77) boot: Partition Table:
I (81) boot: ## Label Usage Type ST Offset Length
I (88) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (96) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (103) boot: 2 factory factory app 00 00 00010000 00100000
I (111) boot: End of partition table
I (115) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=08054h ( 32852) map
I (131) esp_image: segment 1: paddr=0001807c vaddr=3fc90d60 size=026f4h ( 9972) load
I (135) esp_image: segment 2: paddr=0001a778 vaddr=40374000 size=058a0h ( 22688) load
I (147) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=1ab6ch (109420) map
I (175) esp_image: segment 4: paddr=0003ab94 vaddr=403798a0 size=074c0h ( 29888) load
I (183) esp_image: segment 5: paddr=0004205c vaddr=50000000 size=00010h ( 16) load
I (189) boot: Loaded app from partition at offset 0x10000
I (189) boot: Disabling RNG early entropy source...
I (203) cpu_start: Pro cpu up.
I (204) cpu_start: Starting app cpu, entry point is 0x403750ec
0x403750ec: call_start_cpu1 at D:/software/Espressif/frameworks/esp-idf-v4.4.2/components/esp_system/port/cpu_start.c:160
I (163) cpu_start: App cpu up.
I (218) cpu_start: Pro cpu start user code
I (218) cpu_start: cpu freq: 160000000
I (218) cpu_start: Application information:
I (221) cpu_start: Project name: nvs_rw_value
I (226) cpu_start: App version: 1
I (230) cpu_start: Compile time: Sep 3 2022 22:19:43
I (236) cpu_start: ELF file SHA256: be01ca20d393b5bc...
I (242) cpu_start: ESP-IDF: v4.4.2-dirty
I (248) heap_init: Initializing. RAM available for dynamic allocation:
I (255) heap_init: At 3FC93E70 len 0004C190 (304 KiB): D/IRAM
I (261) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (268) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (274) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (281) spi_flash: detected chip: mxic
W (285) spi_flash: Detected flash size > 16 MB, but access beyond 16 MB is not supported for this flash model yet.
I (296) spi_flash: flash io: dio
W (300) spi_flash: Detected size(32768k) larger than the size in the binary image header(16384k). Using the size in the binary image header.
I (314) sleep: Configure to isolate all GPIO pins in sleep state
I (320) sleep: Enable automatic switching of GPIO sleep configuration
I (328) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
Opening Non-Volatile Storage (NVS) handle... Done
Reading restart counter from NVS ... The value is not initialized yet!
Updating restart counter in NVS ... Done
Committing updates in NVS ... Done
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...