esp32-c3f开启安全启动和flash加密概率不启动的问题

jzy1115
Posts: 8
Joined: Wed Dec 08, 2021 6:19 am

esp32-c3f开启安全启动和flash加密概率不启动的问题

Postby jzy1115 » Wed Dec 08, 2021 6:56 am

esp32-c3f开启安全启动和flash加密概率不启动,重新上电就好了,启动时候签名校验错误,硬件sha256 返回全0,怀疑是烧efuse影响了硬件sha,把硬件sha替换为软件sha,直接卡在secure_boot_v2: Verifying with RSA-PSS然后复位
rst:0x3 (RTC_SW_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)

jzy1115
Posts: 8
Joined: Wed Dec 08, 2021 6:19 am

Re: esp32-c3f开启安全启动和flash加密概率不启动的问题

Postby jzy1115 » Wed Dec 08, 2021 12:04 pm

这是日志
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403d1540
SPIWP:0xee
mode:DIO, clock div:2
Valid secure boot key blocks: 0
secure boot verification succeeded
load:0x3fcd6268,len:0x3730
load:0x403ce000,len:0x9b0
load:0x403d0000,len:0x58bc
entry 0x403ce000
I (78) boot: ESP-IDF v4.4-dev-3042-g220590d599-dirty 2nd stage bootloader
I (78) boot: compile time 19:53:08
D (78) bootloader_flash: XMC chip detected by RDID (00204016), skip.
D (84) bootloader_flash: mmu set block paddr=0x00000000 (was 0xffffffff)
I (91) boot: chip revision: 3
D (95) boot.esp32c3: magic e9
D (98) boot.esp32c3: segments 03
D (101) boot.esp32c3: spi_mode 02
D (105) boot.esp32c3: spi_speed 00
D (108) boot.esp32c3: spi_size 02
I (111) boot.esp32c3: SPI Speed : 40MHz
I (116) boot.esp32c3: SPI Mode : DIO
I (121) boot.esp32c3: SPI Flash Size : 4MB
D (126) boot: Enabling RTCWDT(9000 ms)
I (130) boot: Enabling RNG early entropy source...
D (135) bootloader_flash: mmu set paddr=00010000 count=1 size=c00 src_addr=10000 src_addr_aligned=10000
D (145) boot: mapped partition table 0x10000 at 0x3c000000
D (150) flash_parts: partition table verified, 4 entries
I (156) boot: Partition Table:
I (159) boot: ## Label Usage Type ST Offset Length
D (167) boot: load partition table entry 0x3c000000
D (172) boot: type=1 subtype=2
I (175) boot: 0 nvs WiFi data 01 02 00011000 00006000
D (182) boot: load partition table entry 0x3c000020
D (187) boot: type=1 subtype=1
I (190) boot: 1 phy_init RF data 01 01 00017000 00001000
D (198) boot: load partition table entry 0x3c000040
D (203) boot: type=0 subtype=0
I (206) boot: 2 factory factory app 00 00 00020000 00100000
I (214) boot: End of partition table
D (218) boot: Trying partition index -1 offs 0x20000 size 0x100000
D (224) esp_image: reading image header @ 0x20000
D (229) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
D (236) esp_image: image header: 0xe9 0x07 0x02 0x02 403802d2
I (241) esp_image: segment 0: paddr=00020020 vaddr=3c020020 size=033c0h ( 13248) map
D (250) esp_image: free data page_count 0x0000003f
D (255) bootloader_flash: mmu set paddr=00020000 count=1 size=33c0 src_addr=20020 src_addr_aligned=20000
D (267) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (271) esp_image: segment 1: paddr=000233e8 vaddr=3fc89000 size=00c3ch ( 3132) load
D (280) esp_image: free data page_count 0x0000003f
D (285) bootloader_flash: mmu set paddr=00020000 count=1 size=c3c src_addr=233e8 src_addr_aligned=20000
D (295) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (301) esp_image: segment 2: paddr=0002402c vaddr=40380000 size=08e68h ( 36456) load
D (309) esp_image: free data page_count 0x0000003f
D (314) bootloader_flash: mmu set paddr=00020000 count=1 size=8e68 src_addr=2402c src_addr_aligned=20000
D (333) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (333) esp_image: segment 3: paddr=0002ce9c vaddr=50000000 size=00010h ( 16) load
D (339) esp_image: free data page_count 0x0000003f
D (344) bootloader_flash: mmu set paddr=00020000 count=1 size=10 src_addr=2ce9c src_addr_aligned=20000
D (353) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
I (360) esp_image: segment 4: paddr=0002ceb4 vaddr=00000000 size=03164h ( 12644)
D (368) esp_image: free data page_count 0x0000003f
D (373) bootloader_flash: mmu set paddr=00020000 count=2 size=3164 src_addr=2ceb4 src_addr_aligned=20000
D (386) bootloader_flash: mmu set block paddr=0x00030000 (was 0xffffffff)
I (390) esp_image: segment 5: paddr=00030020 vaddr=42000020 size=1532ch ( 86828) map
D (398) esp_image: free data page_count 0x0000003f
D (403) bootloader_flash: mmu set paddr=00030000 count=2 size=1532c src_addr=30020 src_addr_aligned=30000
D (432) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
I (432) esp_image: segment 6: paddr=00045354 vaddr=00000000 size=0ac7ch ( 44156)
D (435) esp_image: free data page_count 0x0000003f
D (440) bootloader_flash: mmu set paddr=00040000 count=1 size=ac7c src_addr=45354 src_addr_aligned=40000
D (459) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
I (460) esp_image: Verifying image signature...
D (462) bootloader_flash: mmu set paddr=00040000 count=1 size=20 src_addr=4ffe0 src_addr_aligned=40000
D (471) boot: Calculated secure boot hash: 0000000000000000000000000000000000000000000000000000000000000000
D (481) bootloader_flash: mmu set paddr=00050000 count=1 size=1000 src_addr=50000 src_addr_aligned=50000
D (491) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 21 bit
D (498) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 21 bit
D (505) efuse: In EFUSE_BLK0__DATA2_REG is used 4 bits starting with 24 bit
D (512) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 22 bit
D (519) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 23 bit
D (526) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 21 bit
D (533) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 21 bit
D (540) efuse: In EFUSE_BLK0__DATA2_REG is used 4 bits starting with 24 bit
D (547) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 22 bit
D (554) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 23 bit
D (561) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 21 bit
D (568) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 21 bit
D (575) efuse: In EFUSE_BLK0__DATA2_REG is used 4 bits starting with 24 bit
D (582) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 22 bit
D (589) efuse: In EFUSE_BLK0__DATA2_REG is used 1 bits starting with 23 bit
I (596) secure_boot_v2: Verifying with RSA-PSS...
Sig block 0 invalid: Image digest does not match
E (606) secure_boot_v2: Secure Boot V2 verification failed.
E (612) esp_image: Secure boot signature verification failed
I (618) esp_image: Calculating simple hash to check for corruption...
D (625) bootloader_flash: mmu set paddr=00020000 count=3 size=2ffe0 src_addr=20000 src_addr_aligned=20000
D (666) boot: Calculated hash: 0000000000000000000000000000000000000000000000000000000000000000
E (666) esp_image: Image hash failed - image is corrupt
D (669) boot: Expected hash: b856709876133b893f1208934ceac825fed8771d85c35e0ef8af69e877852ca7
W (678) esp_image: image corrupted on flash
E (682) boot: Factory app partition is not bootable
D (688) boot: Can't boot from zero-length partition
E (693) boot: No bootable app partitions in the partition table
Last edited by jzy1115 on Thu Dec 09, 2021 4:46 am, edited 1 time in total.

jzy1115
Posts: 8
Joined: Wed Dec 08, 2021 6:19 am

Re: esp32-c3f开启安全启动和flash加密概率不启动的问题

Postby jzy1115 » Thu Dec 09, 2021 4:45 am

log和efuse都在文件里,会有两种情况,一种是加密前无法验证签名,一种是执行加密后,无法验证签名,概率大概是2-3个芯片有一个会这样,但是重新上电就可以
Attachments
没问题的.txt
没问题的
(55.41 KiB) Downloaded 259 times
err加密之前无法启动,重新上电会执行加密.txt
err加密之前无法启动,重新上电会执行加密
(66.21 KiB) Downloaded 275 times
err加密之后无法启动,需重新上电.txt
err加密之后无法启动,需重新上电
(79.16 KiB) Downloaded 265 times

Who is online

Users browsing this forum: No registered users and 18 guests