esp32-c3烧efuse复位后无法计算sha256,必须重新上电
测试了用不用batch mode都会概率出现
模块为
ESP32-C3-MINI-1-N4
程序 Hello world
日志:
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x400462e2
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd6100,len:0x1dbc
load:0x403ce000,len:0x9dc
load:0x403d0000,len:0x31d0
entry 0x403ce000
I (26) boot: ESP-IDF v4.4-dev-3042-g220590d599-dirty 2nd stage bootloader
I (26) boot: compile
time 12:09:42
D (26) bootloader_flash: XMC chip detected by RDID (00204016), skip.
D (32) bootloader_flash: mmu set block paddr=0x00000000 (was 0xffffffff)
I (39) boot: chip revision: 3
D (43) boot.esp32c3: magic e9
D (46) boot.esp32c3: segments 03
D (49) boot.esp32c3: spi_mode 02
D (52) boot.esp32c3: spi_speed 00
D (56) boot.esp32c3: spi_size 02
I (59) boot.esp32c3: SPI Speed : 40MHz
I (64) boot.esp32c3: SPI Mode : DIO
I (69) boot.esp32c3: SPI Flash Size : 4MB
D (73) boot: Enabling RTCWDT(9000 ms)
I (77) boot: Enabling RNG early entropy source...
D (83) bootloader_flash: mmu set paddr=00010000 count=1 size=c00 src_addr=10000 src_addr_aligned=10000
D (92) boot: mapped partition table 0x10000 at 0x3c000000
D (97) flash_parts: partition table verified, 4 entries
I (103) boot: Partition Table:
I (106) boot: ## Label Usage Type ST Offset Length
D (114) boot: load partition table entry 0x3c000000
D (119) boot: type=1 subtype=2
I (122) boot: 0 nvs WiFi data 01 02 00011000 00006000
D (129) boot: load partition table entry 0x3c000020
D (134) boot: type=1 subtype=1
I (137) boot: 1 phy_init RF data 01 01 00017000 00001000
D (145) boot: load partition table entry 0x3c000040
D (150) boot: type=0 subtype=0
I (153) boot: 2 factory factory app 00 00 00020000 00100000
I (161) boot: End of partition table
D (165) boot: Trying partition index -1 offs 0x20000 size 0x100000
D (171) esp_image: reading image header @ 0x20000
D (176) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
D (183) esp_image: image header: 0xe9 0x06 0x02 0x02 403802d2
I (189) esp_image: segment 0: paddr=00020020 vaddr=3c020020 size=067b0h ( 26544) map
D (197) esp_image: free data page_count 0x0000003f
D (202) bootloader_flash: mmu set paddr=00020000 count=1 size=67b0 src_addr=20020 src_addr_aligned=20000
D (217) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (218) esp_image: segment 1: paddr=000267d8 vaddr=3fc89a00 size=01374h ( 4980) load
D (227) esp_image: free data page_count 0x0000003f
D (232) bootloader_flash: mmu set paddr=00020000 count=1 size=1374 src_addr=267d8 src_addr_aligned=20000
D (242) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (248) esp_image: segment 2: paddr=00027b54 vaddr=40380000 size=084c4h ( 33988) load
D (257) esp_image: free data page_count 0x0000003f
D (261) bootloader_flash: mmu set paddr=00020000 count=2 size=84c4 src_addr=27b54 src_addr_aligned=20000
D (279) bootloader_flash: mmu set block paddr=0x00030000 (was 0xffffffff)
I (280) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=14df8h ( 85496) map
D (286) esp_image: free data page_count 0x0000003f
D (291) bootloader_flash: mmu set paddr=00030000 count=2 size=14df8 src_addr=30020 src_addr_aligned=30000
D (320) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
I (320) esp_image: segment 4: paddr=00044e20 vaddr=403884c4 size=01338h ( 4920) load
D (324) esp_image: free data page_count 0x0000003f
D (329) bootloader_flash: mmu set paddr=00040000 count=1 size=1338 src_addr=44e20 src_addr_aligned=40000
D (339) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
I (345) esp_image: segment 5: paddr=00046160 vaddr=50000000 size=00010h ( 16) load
D (354) esp_image: free data page_count 0x0000003f
D (358) bootloader_flash: mmu set paddr=00040000 count=1 size=10 src_addr=46160 src_addr_aligned=40000
D (368) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
D (375) boot: Calculated hash: aa398efa12618d1ac337b4ba0817ea0512046b8e7ed147d2ec8a60bd49ea97d4
I (386) boot: Loaded app from partition at offset 0x20000
I (390) boot: Disabling RNG early entropy source...
D (395) boot: Mapping segment 0 as DROM
D (399) boot: Mapping segment 3 as IROM
D (403) boot: calling set_cache_and_start_app
D (407) boot: configure drom and irom and start
D (412) boot: start: 0x403802d2
0x403802d2: call_start_cpu0 at D:/Program_Files/esp-idf/components/esp_system/port/cpu_start.c:270
I (415) cpu_start: Pro cpu up.
I (431) cpu_start: Pro cpu start user code
I (431) cpu_start: cpu freq: 160000000
I (431) cpu_start: Application information:
I (433) cpu_start: Project name: hello-world
I (439) cpu_start: App version: 1
I (443) cpu_start: Compile time: Dec 10 2021 12:09:43
I (449) cpu_start: ELF file SHA256: 63af5056a1faa2f8...
I (455) cpu_start: ESP-IDF: v4.4-dev-3042-g220590d599-dirty
I (462) heap_init: Initializing. RAM available for dynamic allocation:
I (469) heap_init: At 3FC8BD30 len 000342D0 (208 KiB): DRAM
I (476) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
I (482) heap_init: At 50000010 len 00001FF0 (7 KiB): RTCRAM
I (489) spi_flash: detected chip: generic
I (490) spi_flash: flash io: dio
I (491) sleep: Configure to isolate all GPIO pins in sleep state
I (491) sleep: Enable automatic switching of GPIO sleep configuration
I (492) cpu_start: Starting scheduler.
I (492) efuse: Batch mode of writing fields is enabled
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4004c4cc
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd6100,len:0x1dbc
load:0x403ce000,len:0x9dc
load:0x403d0000,len:0x31d0
entry 0x403ce000
I (25) boot: ESP-IDF v4.4-dev-3042-g220590d599-dirty 2nd stage bootloader
I (25) boot: compile time 12:09:42
D (26) bootloader_flash: XMC chip detected by RDID (00204016), skip.
D (32) bootloader_flash: mmu set block paddr=0x00000000 (was 0xffffffff)
I (39) boot: chip revision: 3
D (42) boot.esp32c3: magic e9
D (45) boot.esp32c3: segments 03
D (49) boot.esp32c3: spi_mode 02
D (52) boot.esp32c3: spi_speed 00
D (55) boot.esp32c3: spi_size 02
I (59) boot.esp32c3: SPI Speed : 40MHz
I (64) boot.esp32c3: SPI Mode : DIO
I (68) boot.esp32c3: SPI Flash Size : 4MB
W (73) boot.esp32c3: PRO CPU has been reset by WDT.
D (78) boot: Enabling RTCWDT(9000 ms)
I (82) boot: Enabling RNG early entropy source...
D (88) bootloader_flash: mmu set paddr=00010000 count=1 size=c00 src_addr=10000 src_addr_aligned=10000
D (97) boot: mapped partition table 0x10000 at 0x3c000000
D (102) flash_parts: partition table verified, 4 entries
I (108) boot: Partition Table:
I (112) boot: ## Label Usage Type ST Offset Length
D (119) boot: load partition table entry 0x3c000000
D (124) boot: type=1 subtype=2
I (127) boot: 0 nvs WiFi data 01 02 00011000 00006000
D (135) boot: load partition table entry 0x3c000020
D (139) boot: type=1 subtype=1
I (143) boot: 1 phy_init RF data 01 01 00017000 00001000
D (150) boot: load partition table entry 0x3c000040
D (155) boot: type=0 subtype=0
I (158) boot: 2 factory factory app 00 00 00020000 00100000
I (166) boot: End of partition table
D (170) boot: Trying partition index -1 offs 0x20000 size 0x100000
D (176) esp_image: reading image header @ 0x20000
D (181) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
D (188) esp_image: image header: 0xe9 0x06 0x02 0x02 403802d2
I (194) esp_image: segment 0: paddr=00020020 vaddr=3c020020 size=067b0h ( 26544) map
D (202) esp_image: free data page_count 0x0000003f
D (207) bootloader_flash: mmu set paddr=00020000 count=1 size=67b0 src_addr=20020 src_addr_aligned=20000
D (223) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (223) esp_image: segment 1: paddr=000267d8 vaddr=3fc89a00 size=01374h ( 4980) load
D (232) esp_image: free data page_count 0x0000003f
D (237) bootloader_flash: mmu set paddr=00020000 count=1 size=1374 src_addr=267d8 src_addr_aligned=20000
D (248) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (253) esp_image: segment 2: paddr=00027b54 vaddr=40380000 size=084c4h ( 33988) load
D (262) esp_image: free data page_count 0x0000003f
D (267) bootloader_flash: mmu set paddr=00020000 count=2 size=84c4 src_addr=27b54 src_addr_aligned=20000
D (285) bootloader_flash: mmu set block paddr=0x00030000 (was 0xffffffff)
I (285) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=14df8h ( 85496) map
D (291) esp_image: free data page_count 0x0000003f
D (296) bootloader_flash: mmu set paddr=00030000 count=2 size=14df8 src_addr=30020 src_addr_aligned=30000
D (325) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
I (326) esp_image: segment 4: paddr=00044e20 vaddr=403884c4 size=01338h ( 4920) load
D (329) esp_image: free data page_count 0x0000003f
D (334) bootloader_flash: mmu set paddr=00040000 count=1 size=1338 src_addr=44e20 src_addr_aligned=40000
D (345) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
I (351) esp_image: segment 5: paddr=00046160 vaddr=50000000 size=00010h ( 16) load
D (359) esp_image: free data page_count 0x0000003f
D (364) bootloader_flash: mmu set paddr=00040000 count=1 size=10 src_addr=46160 src_addr_aligned=40000
D (374) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
D (380) boot: Calculated hash: 0000000000000000000000000000000000000000000000000000000000000000
E (389) esp_image: Image hash failed - image is corrupt
D (395) boot: Expected hash: aa398efa12618d1ac337b4ba0817ea0512046b8e7ed147d2ec8a60bd49ea97d4
E (404) boot: Factory app partition is not bootable
D (409) boot: Can't boot from zero-length partition
E (414) boot: No bootable app partitions in the partition table
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403d17b6
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd6100,len:0x1dbc
load:0x403ce000,len:0x9dc
load:0x403d0000,len:0x31d0
entry 0x403ce000
I (25) boot: ESP-IDF v4.4-dev-3042-g220590d599-dirty 2nd stage bootloader
I (25) boot: compile time 12:09:42
D (26) bootloader_flash: XMC chip detected by RDID (00204016), skip.
D (32) bootloader_flash: mmu set block paddr=0x00000000 (was 0xffffffff)
I (39) boot: chip revision: 3
D (42) boot.esp32c3: magic e9
D (45) boot.esp32c3: segments 03
D (49) boot.esp32c3: spi_mode 02
D (52) boot.esp32c3: spi_speed 00
D (55) boot.esp32c3: spi_size 02
I (59) boot.esp32c3: SPI Speed : 40MHz
I (64) boot.esp32c3: SPI Mode : DIO
I (68) boot.esp32c3: SPI Flash Size : 4MB
D (73) boot: Enabling RTCWDT(9000 ms)
I (77) boot: Enabling RNG early entropy source...
D (82) bootloader_flash: mmu set paddr=00010000 count=1 size=c00 src_addr=10000 src_addr_aligned=10000
D (91) boot: mapped partition table 0x10000 at 0x3c000000
D (97) flash_parts: partition table verified, 4 entries
I (102) boot: Partition Table:
I (106) boot: ## Label Usage Type ST Offset Length
D (113) boot: load partition table entry 0x3c000000
D (118) boot: type=1 subtype=2
I (121) boot: 0 nvs WiFi data 01 02 00011000 00006000
D (129) boot: load partition table entry 0x3c000020
D (134) boot: type=1 subtype=1
I (137) boot: 1 phy_init RF data 01 01 00017000 00001000
D (145) boot: load partition table entry 0x3c000040
D (149) boot: type=0 subtype=0
I (153) boot: 2 factory factory app 00 00 00020000 00100000
I (160) boot: End of partition table
D (164) boot: Trying partition index -1 offs 0x20000 size 0x100000
D (171) esp_image: reading image header @ 0x20000
D (175) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
D (182) esp_image: image header: 0xe9 0x06 0x02 0x02 403802d2
I (188) esp_image: segment 0: paddr=00020020 vaddr=3c020020 size=067b0h ( 26544) map
D (196) esp_image: free data page_count 0x0000003f
D (201) bootloader_flash: mmu set paddr=00020000 count=1 size=67b0 src_addr=20020 src_addr_aligned=20000
D (217) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (218) esp_image: segment 1: paddr=000267d8 vaddr=3fc89a00 size=01374h ( 4980) load
D (226) esp_image: free data page_count 0x0000003f
D (231) bootloader_flash: mmu set paddr=00020000 count=1 size=1374 src_addr=267d8 src_addr_aligned=20000
D (242) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (248) esp_image: segment 2: paddr=00027b54 vaddr=40380000 size=084c4h ( 33988) load
D (256) esp_image: free data page_count 0x0000003f
D (261) bootloader_flash: mmu set paddr=00020000 count=2 size=84c4 src_addr=27b54 src_addr_aligned=20000
D (279) bootloader_flash: mmu set block paddr=0x00030000 (was 0xffffffff)
I (279) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=14df8h ( 85496) map
D (286) esp_image: free data page_count 0x0000003f
D (291) bootloader_flash: mmu set paddr=00030000 count=2 size=14df8 src_addr=30020 src_addr_aligned=30000
D (320) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
I (320) esp_image: segment 4: paddr=00044e20 vaddr=403884c4 size=01338h ( 4920) load
D (324) esp_image: free data page_count 0x0000003f
D (329) bootloader_flash: mmu set paddr=00040000 count=1 size=1338 src_addr=44e20 src_addr_aligned=40000
D (340) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
I (345) esp_image: segment 5: paddr=00046160 vaddr=50000000 size=00010h ( 16) load
D (354) esp_image: free data page_count 0x0000003f
D (358) bootloader_flash: mmu set paddr=00040000 count=1 size=10 src_addr=46160 src_addr_aligned=40000
D (368) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
D (375) boot: Calculated hash: 0000000000000000000000000000000000000000000000000000000000000000
E (383) esp_image: Image hash failed - image is corrupt
D (389) boot: Expected hash: aa398efa12618d1ac337b4ba0817ea0512046b8e7ed147d2ec8a60bd49ea97d4
E (398) boot: Factory app partition is not bootable
D (404) boot: Can't boot from zero-length partition
E (408) boot: No bootable app partitions in the partition table
程序:
void app_main(void)
{
uint8_t data[]={0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11};
esp_efuse_batch_write_begin();
esp_err_t ret = esp_efuse_write_field_blob(ESP_EFUSE_KEY4,data,32*8);
esp_efuse_batch_write_commit();
printf("Hello world!n");
vTaskDelay(1000 / portTICK_PERIOD_MS);
printf("Restarting now.n");
REG_WRITE(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_SW_SYS_RST);
while(1);
}