esp-rs / esp-flasher-stub

Rust implementation of flasher stub located in esptool
Apache License 2.0
18 stars 10 forks source link

Add ESP32-C6 and ESP32-H2 support for get_security_info #60

Closed dobairoland closed 3 months ago

dobairoland commented 3 months ago

esp-flasher-stub v0.2.0 with esptool.py produces the following error for ESP32-C6 and ESP32-H2:

A fatal error occurred: Failed to get security info (result was 01C3: Unknown result)

This PR solves the above issue.

`--> esptool.py --port /dev/ttyUSB0 --chip esp32c6 get_security_info
esptool.py v4.7.0
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-C6 (QFN40) (revision v0.0)
Features: WiFi 6, BT 5, IEEE802.15.4
Crystal is 40MHz
MAC: xxxxxxxxxxxxxxx
BASE MAC: xxxxxxxxxxxx
MAC_EXT: xxxxxxxxx
Uploading stub...
Running stub...
Stub running...

Security Information:
=====================
Flags: 0x00000000 (0b0)
Key Purposes: (0, 0, 0, 0, 0, 0, 12)
Chip ID: 13
API Version: 0
Secure Boot: Disabled
Flash Encryption: Disabled
SPI Boot Crypt Count (SPI_BOOT_CRYPT_CNT): 0x0
Hard resetting via RTS pin...

`--> esptool.py --port /dev/ttyUSB0 --chip esp32h2 get_security_info
esptool.py v4.7.0
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-H2 (revision v0.2)
Features: BLE, IEEE802.15.4
Crystal is 32MHz
MAC: xxxxxxxxxxxx
BASE MAC: xxxxxxxxxxx
MAC_EXT: xxxxxxx
Uploading stub...
Running stub...
Stub running...

Security Information:
=====================
Flags: 0x00000000 (0b0)
Key Purposes: (0, 0, 0, 0, 0, 0, 12)
Chip ID: 16
API Version: 0
Secure Boot: Disabled
Flash Encryption: Disabled
SPI Boot Crypt Count (SPI_BOOT_CRYPT_CNT): 0x0
Hard resetting via RTS pin...

Internal reference: ESPTOOL-848

dobairoland commented 3 months ago

@SergioGasquez @radimkarnis PTAL