Available on crate feature
unstable
only.Expand description
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
§Reading of eFuses (ESP32-S3)
§Overview
The efuse
module provides functionality for reading eFuse data
from the ESP32-S3
chip, allowing access to various chip-specific
information such as:
- MAC address
- Chip revision
and more. It is useful for retrieving chip-specific configuration and identification data during runtime.
The Efuse
struct represents the eFuse peripheral and is responsible for
reading various eFuse fields and values.
§Examples
§Read data from the eFuse storage.
let mac_address = Efuse::read_base_mac_address();
println!(
"MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
mac_address[0],
mac_address[1],
mac_address[2],
mac_address[3],
mac_address[4],
mac_address[5]
);
println!("MAC address {:02x?}", Efuse::mac_address());
println!("Flash Encryption {:?}", Efuse::flash_encryption());
Structs§
- Efuse
- A struct representing the eFuse functionality of the chip.
Constants§
- ADC1_
CAL_ VOL_ ATTE N0 - ADC1 calibration voltage at atten0
- ADC1_
CAL_ VOL_ ATTE N1 - ADC1 calibration voltage at atten1
- ADC1_
CAL_ VOL_ ATTE N2 - ADC1 calibration voltage at atten2
- ADC1_
CAL_ VOL_ ATTE N3 - ADC1 calibration voltage at atten3
- ADC1_
INIT_ CODE_ ATTE N0 - ADC1 init code at atten0
- ADC1_
INIT_ CODE_ ATTE N1 - ADC1 init code at atten1
- ADC1_
INIT_ CODE_ ATTE N2 - ADC1 init code at atten2
- ADC1_
INIT_ CODE_ ATTE N3 - ADC1 init code at atten3
- ADC2_
CAL_ VOL_ ATTE N0 - ADC2 calibration voltage at atten0
- ADC2_
CAL_ VOL_ ATTE N1 - ADC2 calibration voltage at atten1
- ADC2_
CAL_ VOL_ ATTE N2 - ADC2 calibration voltage at atten2
- ADC2_
CAL_ VOL_ ATTE N3 - ADC2 calibration voltage at atten3
- ADC2_
INIT_ CODE_ ATTE N0 - ADC2 init code at atten0
- ADC2_
INIT_ CODE_ ATTE N1 - ADC2 init code at atten1
- ADC2_
INIT_ CODE_ ATTE N2 - ADC2 init code at atten2
- ADC2_
INIT_ CODE_ ATTE N3 - ADC2 init code at atten3
- BLK_
VERSION_ MAJOR - BLK_VERSION_MAJOR of BLOCK2
- BLK_
VERSION_ MINOR - BLK_VERSION_MINOR
- BLOCK_
KEY0 - Key0 or user data
- BLOCK_
KEY1 - Key1 or user data
- BLOCK_
KEY2 - Key2 or user data
- BLOCK_
KEY3 - Key3 or user data
- BLOCK_
KEY4 - Key4 or user data
- BLOCK_
KEY5 - Key5 or user data
- BLOCK_
SYS_ DATA2 - System data part 2 (reserved)
- BLOCK_
USR_ DATA - User data
- BTLC_
GPIO_ ENABLE - Bluetooth GPIO signal output security level control
- CUSTOM_
MAC - Custom MAC
- DIG_
DBIAS_ HVT - BLOCK1 digital dbias when hvt
- DISABLE_
BLK_ VERSION_ MAJOR - Disables check of blk version major
- DISABLE_
WAFER_ VERSION_ MAJOR - Disables check of wafer version major
- DIS_
APP_ CPU - Disable app cpu
- DIS_
DCACHE - Set this bit to disable Dcache
- DIS_
DIRECT_ BOOT - Disable direct boot mode
- DIS_
DOWNLOAD_ DCACHE - Set this bit to disable Dcache in download mode ( boot_mode[3:0] is 0; 1; 2; 3; 6; 7)
- DIS_
DOWNLOAD_ ICACHE - Set this bit to disable Icache in download mode (boot_mode[3:0] is 0; 1; 2; 3; 6; 7)
- DIS_
DOWNLOAD_ MANUAL_ ENCRYPT - Set this bit to disable flash encryption when in download boot modes
- DIS_
DOWNLOAD_ MODE - Set this bit to disable download mode (boot_mode[3:0] = 0; 1; 2; 3; 6; 7)
- DIS_
FORCE_ DOWNLOAD - Set this bit to disable the function that forces chip into download mode
- DIS_
ICACHE - Set this bit to disable Icache
- DIS_
PAD_ JTAG - Set this bit to disable JTAG in the hard way. JTAG is disabled permanently
- DIS_
RTC_ RAM_ BOOT - Set this bit to disable boot from RTC RAM
- DIS_
TWAI - Set this bit to disable CAN function
- DIS_
USB_ JTAG - Set this bit to disable function of usb switch to jtag in module of usb device
- DIS_
USB_ OTG - Set this bit to disable USB function
- DIS_
USB_ OTG_ DOWNLOAD_ MODE - Set this bit to disable download through USB-OTG
- DIS_
USB_ SERIAL_ JTAG - Set this bit to disable usb device
- DIS_
USB_ SERIAL_ JTAG_ DOWNLOAD_ MODE - Set this bit to disable UART download mode through USB
- DIS_
USB_ SERIAL_ JTAG_ ROM_ PRINT - USB printing
- ENABLE_
SECURITY_ DOWNLOAD - Set this bit to enable secure UART download mode
- FLASH_
CAP - Flash capacity
- FLASH_
ECC_ EN - Set 1 to enable ECC for flash boot
- FLASH_
ECC_ MODE - Flash ECC mode in ROM
- FLASH_
PAGE_ SIZE - Set Flash page size
- FLASH_
TEMP - Flash temperature
- FLASH_
TPUW - Configures flash waiting time after power-up; in unit of ms. If the value is less than 15; the waiting time is the configurable value. Otherwise; the waiting time is twice the configurable value
- FLASH_
TYPE - SPI flash type
- FLASH_
VENDOR - Flash vendor
- FORCE_
SEND_ RESUME - Set this bit to force ROM code to send a resume command during SPI boot
- KEY_
PURPOSE_ 0 - Purpose of Key0
- KEY_
PURPOSE_ 1 - Purpose of Key1
- KEY_
PURPOSE_ 2 - Purpose of Key2
- KEY_
PURPOSE_ 3 - Purpose of Key3
- KEY_
PURPOSE_ 4 - Purpose of Key4
- KEY_
PURPOSE_ 5 - Purpose of Key5
- K_
DIG_ LDO - BLOCK1 K_DIG_LDO
- K_
RTC_ LDO - BLOCK1 K_RTC_LDO
- MAC0
- MAC address
- MAC1
- MAC address
- OCODE
- ADC OCode
- OPTIONAL_
UNIQUE_ ID - Optional unique 128-bit ID
- PIN_
POWER_ SELECTION - Set default power supply for GPIO33-GPIO37; set when SPI flash is initialized
- PKG_
VERSION - Package version
- POWERGLITCH_
EN - Set this bit to enable power glitch function
- POWER_
GLITCH_ DSENSE - Sample delay configuration of power glitch
- PSRAM_
CAP - PSRAM capacity
- PSRAM_
CAP_ 3 - PSRAM capacity bit 3
- PSRAM_
TEMP - PSRAM temperature
- PSRAM_
VENDOR - PSRAM vendor
- RD_DIS
- Disable reading from BlOCK4-10
- RESERVED_
0_ 162 - reserved
- RESERVED_
1_ 137 - reserved
- RESERVED_
1_ 176 - reserved
- RESERVED_
1_ 180 - reserved
- RESERVED_
2_ 130 - reserved
- RESERVED_
2_ 255 - reserved
- RESERVED_
3_ 192 - reserved
- RESERVED_
3_ 248 - reserved
- RPT4_
RESERVE D0 - Reserved (used for four backups method)
- SECURE_
BOOT_ AGGRESSIVE_ REVOKE - Set this bit to enable revoking aggressive secure boot
- SECURE_
BOOT_ EN - Set this bit to enable secure boot
- SECURE_
BOOT_ KEY_ REVOK E0 - Revoke 1st secure boot key
- SECURE_
BOOT_ KEY_ REVOK E1 - Revoke 2nd secure boot key
- SECURE_
BOOT_ KEY_ REVOK E2 - Revoke 3rd secure boot key
- SECURE_
VERSION - Secure version (used by ESP-IDF anti-rollback feature)
- SOFT_
DIS_ JTAG - Set these bits to disable JTAG in the soft way (odd number 1 means disable ). JTAG can be enabled in HMAC module
- SPI_
BOOT_ CRYPT_ CNT - Enables flash encryption when 1 or 3 bits are set and disabled otherwise
- SPI_
PAD_ CONFIG_ CLK - SPI_PAD_configure CLK
- SPI_
PAD_ CONFIG_ CS - SPI_PAD_configure CS
- SPI_
PAD_ CONFIG_ D - SPI_PAD_configure D(D0)
- SPI_
PAD_ CONFIG_ D4 - SPI_PAD_configure D4
- SPI_
PAD_ CONFIG_ D5 - SPI_PAD_configure D5
- SPI_
PAD_ CONFIG_ D6 - SPI_PAD_configure D6
- SPI_
PAD_ CONFIG_ D7 - SPI_PAD_configure D7
- SPI_
PAD_ CONFIG_ DQS - SPI_PAD_configure DQS
- SPI_
PAD_ CONFIG_ HD - SPI_PAD_configure HD(D3)
- SPI_
PAD_ CONFIG_ Q - SPI_PAD_configure Q(D1)
- SPI_
PAD_ CONFIG_ WP - SPI_PAD_configure WP(D2)
- STRAP_
JTAG_ SEL - Set this bit to enable selection between usb_to_jtag and pad_to_jtag through strapping gpio3 when both reg_dis_usb_jtag and reg_dis_pad_jtag are equal to 0
- TEMP_
CALIB - Temperature calibration data
- UART_
PRINT_ CONTROL - Set the default UART boot message output mode
- USB_
DREFH - Controls single-end input threshold vrefh; 1.76 V to 2 V with step of 80 mV; stored in eFuse
- USB_
DREFL - Controls single-end input threshold vrefl; 0.8 V to 1.04 V with step of 80 mV; stored in eFuse
- USB_
EXCHG_ PINS - Set this bit to exchange USB D+ and D- pins
- USB_
EXT_ PHY_ ENABLE - Set this bit to enable external PHY
- USB_
PHY_ SEL - This bit is used to switch internal PHY and external PHY for USB OTG and USB Device
- VDD_
SPI_ DCAP - Prevents SPI regulator from overshoot
- VDD_
SPI_ DCURLIM - Tunes the current limit threshold of SPI regulator when tieh=0; about 800 mA/(8+d)
- VDD_
SPI_ DREFH - SPI regulator high voltage reference
- VDD_
SPI_ DREFL - SPI regulator low voltage reference
- VDD_
SPI_ DREFM - SPI regulator medium voltage reference
- VDD_
SPI_ ENCURLIM - Set SPI regulator to 1 to enable output current limit
- VDD_
SPI_ EN_ INIT - Set SPI regulator to 0 to configure init[1:0]=0
- VDD_
SPI_ FORCE - Set this bit and force to use the configuration of eFuse to configure VDD_SPI
- VDD_
SPI_ INIT - Adds resistor from LDO output to ground
- VDD_
SPI_ MODECURLIM - SPI regulator switches current limit mode
- VDD_
SPI_ TIEH - If VDD_SPI_FORCE is 1; determines VDD_SPI voltage
- VDD_
SPI_ XPD - SPI regulator power up signal
- V_
DIG_ DBIA S20 - BLOCK1 voltage of digital dbias20
- V_
RTC_ DBIA S20 - BLOCK1 voltage of rtc dbias20
- WAFER_
VERSION_ MAJOR - WAFER_VERSION_MAJOR
- WAFER_
VERSION_ MINOR_ HI - WAFER_VERSION_MINOR most significant bit
- WAFER_
VERSION_ MINOR_ LO - WAFER_VERSION_MINOR least significant bits
- WDT_
DELAY_ SEL - RTC watchdog timeout threshold; in unit of slow clock cycle
- WR_DIS
- Disable programming of individual eFuses