jomjol / AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world
https://jomjol.github.io/AI-on-the-edge-device-docs/
5.26k stars 580 forks source link

Flash encrypt or Secure Boot #3045

Closed alx-xlx closed 2 weeks ago

alx-xlx commented 2 months ago

The Problem

I am trying to flash my esp32cam using the Webinstaller, esptool CMD, and even using GUI but I am getting this secure boot error I didn't find any documentation on how to solve this issue. Please fix this issue

Version

15.7.0

Logfile

rst:0x10 (RTCWDT_RTC_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:0x3fff0030,len:3456
load:0x40078000,len:14756
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3068
secure boot check fail
ets_main.c 371 
ets Jun  8 2016 00:22:57

Expected Behavior

No response

Screenshots

sSa8v7D0q7

Additional Context

Here is the flashing logs

(myenv) C:\AI-on-the-edge-device__manual-setup__v15.7.0>esptool erase_flash --force
esptool.py v4.7.0
Found 3 serial ports
Serial port COM7
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 3c:71:bf:c4:a7:18
Stub is already running. No upload is necessary.
Erasing flash (this may take a while)...
Chip erase completed successfully in 2.2s
Hard resetting via RTS pin...
(myenv) C:\AI-on-the-edge-device__manual-setup__v15.7.0>esptool write_flash 0x01000 bootloader.bin 0x08000 partitions.bin 0x10000 firmware.bin --force
esptool.py v4.7.0
Found 3 serial ports
Serial port COM7
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 3c:71:bf:c4:a7:18
Stub is already running. No upload is necessary.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x0017efff...
Compressed 21376 bytes to 14127...
Wrote 21376 bytes (14127 compressed) at 0x00001000 in 1.4 seconds (effective 121.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.1 seconds (effective 196.6 kbit/s)...
Hash of data verified.
Compressed 1500320 bytes to 968156...
Wrote 1500320 bytes (968156 compressed) at 0x00010000 in 89.5 seconds (effective 134.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

and when I reconnect the device to the computer after removing the IOO to GND I get this in the webinstaller

rst:0x10 (RTCWDT_RTC_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:0x3fff0030,len:3456
load:0x40078000,len:14756
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3068
secure boot check fail
ets_main.c 371 
ets Jun  8 2016 00:22:57

No response

caco3 commented 2 months ago

Please fix this issue

If this would be an issue of the project, many other would have had it. But I never heard about this issue.

Could it be a bad hardware on your side? Can you try with a different board?

alx-xlx commented 1 month ago

@caco3 It seems some manufacturers enable secureboot. https://github.com/bdring/FluidNC/issues/149 so I guess my board is bricked now. Can you mention this as a note so that people don't brick their device ?

jomjol commented 1 month ago

This project is not using secure boot. So if this enabled, it must have been done by another project.

Or did you use another source for the AI-on-the-Edge? In this case we are very interested, where you got that.

caco3 commented 1 month ago

@jomjol I think what he wanted to say is that he got a board where secure boot was enabled by default. I have never looked into it. But I doubt that this is a common issue, else we would have heard more issues like this.

Can you mention this as a note so that people don't brick their device ?

@alx-xlx can you create a Pull Request in the documentation repo? Eg. here: https://jomjol.github.io/AI-on-the-edge-device-docs/Hardware-Compatibility/