Expand description
§eFuse (one-time programmable configuration)
§Overview
The efuse module provides functionality for reading eFuse data
from the 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.
§Examples
§Reading interface MAC addresses
use esp_hal::efuse::{self, InterfaceMacAddress};
let mac = efuse::interface_mac_address(InterfaceMacAddress::Station);
println!("MAC: {mac}");
println!("MAC bytes: {:02x?}", mac.as_bytes());Structs§
- Chip
Revision - Represents the hardware revision.
- Efuse
Field unstable - The bit field for get access to efuse data
- MacAddress
- Hardware (MAC) address.
Enums§
- AdcCalib
Unit unstable - Selects which ADC we are interested in the efuse calibration data for
- Interface
MacAddress - Interface selection for
interface_mac_address. - SetMac
Error unstable - Error indicating issues with setting the MAC address.
Constants§
- ACTIVE_
HP_ DBIAS unstable - Active HP DBIAS of fixed voltage
- ACTIVE_
LP_ DBIAS unstable - Active LP DBIAS of fixed voltage
- ADC1_
AVE_ INITCODE_ ATTE N0 unstable - Average initcode of ADC1 atten0
- ADC1_
AVE_ INITCODE_ ATTE N1 unstable - Average initcode of ADC1 atten0
- ADC1_
AVE_ INITCODE_ ATTE N2 unstable - Average initcode of ADC1 atten0
- ADC1_
AVE_ INITCODE_ ATTE N3 unstable - Average initcode of ADC1 atten0
- ADC1_
CH0_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH0 and average initcode
- ADC1_
CH1_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH1 and average initcode
- ADC1_
CH2_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH2 and average initcode
- ADC1_
CH3_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH3 and average initcode
- ADC1_
CH4_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH4 and average initcode
- ADC1_
CH5_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH5 and average initcode
- ADC1_
HI_ DOUT_ ATTE N0 unstable - HI DOUT of ADC1 atten0
- ADC1_
HI_ DOUT_ ATTE N1 unstable - HI DOUT of ADC1 atten1
- ADC1_
HI_ DOUT_ ATTE N2 unstable - HI DOUT of ADC1 atten2
- ADC1_
HI_ DOUT_ ATTE N3 unstable - HI DOUT of ADC1 atten3
- BLK_
VERSION_ MAJOR unstable - BLK_VERSION_MAJOR of BLOCK2
- BLK_
VERSION_ MINOR unstable - BLK_VERSION_MINOR of BLOCK2
- BLOCK_
KEY0 unstable - Key0 or user data
- BLOCK_
KEY1 unstable - Key1 or user data
- BLOCK_
KEY2 unstable - Key2 or user data
- BLOCK_
KEY3 unstable - Key3 or user data
- BLOCK_
KEY4 unstable - Key4 or user data
- BLOCK_
KEY5 unstable - Key5 or user data
- BLOCK_
SYS_ DATA2 unstable - System data part 2 (reserved)
- BLOCK_
USR_ DATA unstable - User data
- BOOTLOADER_
ANTI_ ROLLBACK_ EN unstable - Represents whether the ani-rollback check for the 2nd stage bootloader is enabled
- BOOTLOADER_
ANTI_ ROLLBACK_ SECURE_ VERSION_ HI unstable - Represents the anti-rollback secure version of the 2nd stage bootloader used by the ROM bootloader (the high part of the field)
- BOOTLOADER_
ANTI_ ROLLBACK_ SECURE_ VERSION_ LO unstable - Represents the anti-rollback secure version of the 2nd stage bootloader used by the ROM bootloader (the low part of the field)
- BOOTLOADER_
ANTI_ ROLLBACK_ UPDATE_ IN_ ROM unstable - Represents whether the ani-rollback SECURE_VERSION will be updated from the ROM bootloader
- CUSTOM_
MAC unstable - Custom MAC
- DISABLE_
BLK_ VERSION_ MAJOR unstable - Disables check of blk version major
- DISABLE_
WAFER_ VERSION_ MAJOR unstable - Disables check of wafer version major
- DIS_
DIRECT_ BOOT unstable - Represents whether direct boot mode is disabled or enabled
- DIS_
DOWNLOAD_ MANUAL_ ENCRYPT unstable - Represents whether flash encryption is disabled (except in SPI boot mode)
- DIS_
DOWNLOAD_ MODE unstable - Represents whether Download mode is disable or enable
- DIS_
FORCE_ DOWNLOAD unstable - Represents whether the function that forces chip into Download mode is disabled
- DIS_
ICACHE unstable - Represents whether cache is disabled
- DIS_
PAD_ JTAG unstable - Represents whether PAD JTAG is disabled in the hard way (permanently)
- DIS_
TWAI unstable - Represents whether TWAI function is disabled
- DIS_
USB_ JTAG unstable - Represents whether the USB-to-JTAG function in USB Serial/JTAG is disabled. Note that EFUSE_DIS_USB_JTAG is available only when EFUSE_DIS_USB_SERIAL_JTAG is configured to 0
- DIS_
USB_ SERIAL_ JTAG unstable - Represents whether USB Serial/JTAG is disabled
- DIS_
USB_ SERIAL_ JTAG_ DOWNLOAD_ MODE unstable - Represents whether the USB-Serial-JTAG download function is disabled or enabled
- DIS_
USB_ SERIAL_ JTAG_ ROM_ PRINT unstable - Represents whether print from USB-Serial-JTAG is disabled or enabled
- DSLP_
LP_ DBG unstable - DSLP LP DBG of fixed voltage
- DSLP_
LP_ DBIAS unstable - DSLP LP DBIAS of fixed voltage
- ECC_
FORCE_ CONST_ TIME unstable - Represents whether to force ECC to use constant-time mode for point multiplication calculation
- ENABLE_
SECURITY_ DOWNLOAD unstable - Represents whether security download is enabled. Only downloading into flash is supported. Reading/writing RAM or registers is not supported (i.e. stub download is not supported)
- FLASH_
CAP unstable - Flash capacity
- FLASH_
TPUW unstable - Represents the flash waiting time after power-up. Measurement unit: ms. When the value is less than 15; the waiting time is the programmed value. Otherwise; the waiting time is a fixed value; i.e. 30 ms
- FLASH_
VENDOR unstable - Flash vendor
- FORCE_
DISABLE_ SW_ INIT_ KEY unstable - Represents whether to disable the use of the initialization key written by software and instead force use efuse_init_key
- FORCE_
SEND_ RESUME unstable - Represents whether ROM code is forced to send a resume command during SPI boot
- FORCE_
USE_ KEY_ MANAGER_ KEY unstable - Represents whether the corresponding key must come from Key Manager. Bit0: ECDSA key (0: Not required, 1: Required). Bit1: XTS-AES (flash and PSRAM) key (0: Not required, 1: Required). Bit2: HMAC key (0: Not required, 1: Required). Bit3: DS key (0: Not required, 1: Required)
- HUK_
GEN_ STATE unstable - Represents whether the HUK generate mode is valid. Odd count of bits with a value of 1: Invalid; Even count of bits with a value of 1: Valid
- HYS_
EN_ PAD unstable - Represents whether the hysteresis function of PAD0 - PAD27 is enabled
- JTAG_
SEL_ ENABLE unstable - Represents whether the selection of a JTAG signal source through the strapping pin value is enabled when all of EFUSE_DIS_PAD_JTAG; EFUSE_DIS_USB_JTAG and EFUSE_DIS_USB_SERIAL_JTAG are configured to 0
- KEY_
PURPOSE_ 0 unstable - Represents the purpose of Key0.
- KEY_
PURPOSE_ 1 unstable - Represents the purpose of Key1.
- KEY_
PURPOSE_ 2 unstable - Represents the purpose of Key2.
- KEY_
PURPOSE_ 3 unstable - Represents the purpose of Key3.
- KEY_
PURPOSE_ 4 unstable - Represents the purpose of Key4.
- KEY_
PURPOSE_ 5 unstable - Represents the purpose of Key5.
- KM_
DEPLOY_ ONLY_ ONCE unstable - Represents whether the corresponding key can be deployed only once. Bit0: ECDSA key (0: Multiple times, 1: Only once). Bit1: XTS-AES (flash and PSRAM) key (0: Multiple times, 1: Only once). Bit2: HMAC key (0: Multiple times, 1: Only once). Bit3: DS key (0: Multiple times, 1: Only once)
- KM_
DISABLE_ DEPLOY_ MODE unstable - Represents whether the new key deployment of key manager is disabled. Bit0: ECDSA key deployment (0: Enabled, 1: Disabled). Bit1: XTS-AES (flash and PSRAM) key deployment (0: Enabled, 1: Disabled). Bit2: HMAC key deployment (0: Enabled, 1: Disabled). Bit3: DS key deployment (0: Enabled, 1: Disabled)
- KM_
RND_ SWITCH_ CYCLE unstable - Represents the cycle at which the Key Manager switches random numbers
- KM_
XTS_ KEY_ LENGTH_ 256 unstable - Represents which key flash encryption uses
- LOCK_
KM_ KEY unstable - Represents whether the keys in the Key Manager are locked after deployment
- LP_
HP_ DBIAS_ VOL_ GAP unstable - DBIAS gap between LP and HP
- LSLP_
HP_ DBG unstable - LSLP HP DBG of fixed voltage
- LSLP_
HP_ DBIAS unstable - LSLP HP DBIAS of fixed voltage
- MAC0
unstable - MAC address
- MAC1
unstable - MAC address
- MAC_EXT
unstable - Represents the extended bits of MAC address
- OCODE
unstable - ADC OCode
- OPTIONAL_
UNIQUE_ ID unstable - Optional unique 128-bit ID
- PA_
TRIM_ VERSION unstable - PADC CAL PA trim version
- PKG_
VERSION unstable - Package version
- PSRAM_
CAP unstable - Psram capacity
- PSRAM_
VENDOR unstable - Psram vendor
- RD_DIS
unstable - Disable reading from BlOCK4-10
- RECOVERY_
BOOTLOADER_ FLASH_ SECTOR_ HI unstable - Represents the starting flash sector (flash sector size is 0x1000) of the recovery bootloader used by the ROM bootloader If the primary bootloader fails. 0 and 0xFFF - this feature is disabled. (The high part of the field)
- RECOVERY_
BOOTLOADER_ FLASH_ SECTOR_ LO unstable - Represents the starting flash sector (flash sector size is 0x1000) of the recovery bootloader used by the ROM bootloader If the primary bootloader fails. 0 and 0xFFF - this feature is disabled. (The low part of the field)
- REF_
CURR_ CODE unstable - REF PADC Calibration Curr
- RESERVED_
1_ 143 unstable - reserved
- RESERVED_
2_ 249 unstable - reserved
- RESERVED_
3_ 192 unstable - reserved
- RESERVED_
3_ 248 unstable - reserved
- RESERVE_
0_ 146 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 158 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 183 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RES_
TUNE_ CODE unstable - RES PADC Calibration Tune
- SECURE_
BOOT_ AGGRESSIVE_ REVOKE unstable - Represents whether aggressive revocation of Secure Boot is enabled
- SECURE_
BOOT_ DISABLE_ FAST_ WAKE unstable - Represents whether FAST VERIFY ON WAKE is disabled when Secure Boot is enabled
- SECURE_
BOOT_ EN unstable - Represents whether Secure Boot is enabled
- SECURE_
BOOT_ KEY_ REVOK E0 unstable - Revoke 1st secure boot key
- SECURE_
BOOT_ KEY_ REVOK E1 unstable - Revoke 2nd secure boot key
- SECURE_
BOOT_ KEY_ REVOK E2 unstable - Revoke 3rd secure boot key
- SECURE_
BOOT_ SHA384_ EN unstable - Represents if the chip supports Secure Boot using SHA-384
- SECURE_
VERSION unstable - Represents the app secure version used by ESP-IDF anti-rollback feature
- SEC_
DPA_ LEVEL unstable - Represents the security level of anti-DPA attack. The level is adjusted by configuring the clock random frequency division mode
- SOFT_
DIS_ JTAG unstable - Represents whether PAD JTAG is disabled in the soft way. It can be restarted via HMAC. Odd count of bits with a value of 1: Disabled; Even count of bits with a value of 1: Enabled
- SPI_
BOOT_ CRYPT_ CNT unstable - Enables flash encryption when 1 or 3 bits are set and disables otherwise
- SPI_
DOWNLOAD_ MSPI_ DIS unstable - Represents whether SPI0 controller during boot_mode_download is disabled
- SYS_
DATA_ PART0_ 2 unstable - Represents the third 32-bit of zeroth part of system data
- TEMP
unstable - Temp (die embedded inside)
- TEMPERATURE_
SENSOR unstable - Temperature calibration data
- TRIM_
N_ BIAS unstable - PADC CAL N bias
- TRIM_
P_ BIAS unstable - PADC CAL P bias
- UART_
PRINT_ CONTROL unstable - Set the default UART boot message output mode
- USB_
DREFH unstable - Represents the single-end input threshold vrefh; 1.76 V to 2 V with step of 80 mV
- USB_
DREFL unstable - Represents the single-end input threshold vrefl; 1.76 V to 2 V with step of 80 mV
- USB_
EXCHG_ PINS unstable - Represents whether the D+ and D- pins is exchanged
- VDD_
SPI_ AS_ GPIO unstable - Represents whether VDD SPI pin is functioned as GPIO
- WAFER_
VERSION_ MAJOR unstable - Minor chip version
- WAFER_
VERSION_ MINOR unstable - Minor chip version
- WDT_
DELAY_ SEL unstable - Represents RTC watchdog timeout threshold. The originally configured STG0 threshold * (2 ^ (EFUSE_WDT_DELAY_SEL + 1))
- WR_DIS
unstable - Disable programming of individual eFuses
- XTAL_
48M_ SEL unstable - Represents whether XTAL frequency is 48MHz or not. If not; 40MHz XTAL will be used. If this field contains Odd number bit 1: Enable 48MHz XTAL; Even number bit 1: Enable 40MHz XTAL
- XTAL_
48M_ SEL_ MODE unstable - Represents what determines the XTAL frequency in Joint Download Boot mode
- XTS_
DPA_ CLK_ ENABLE unstable - Represents whether XTS-AES anti-DPA attack clock is enabled
- XTS_
DPA_ PSEUDO_ LEVEL unstable - Represents the pseudo round level of XTS-AES anti-DPA attack
Functions§
- base_
mac_ address unstable - Returns the base MAC address programmed into eFuse during manufacturing.
- block_
version unstable - Get efuse block version
- chip_
revision - Returns the hardware revision.
- flash_
encryption unstable - Get status of SPI boot encryption.
- interface_
mac_ address - Returns the MAC address for a specific interface, derived from the base MAC.
- major_
chip_ version unstable - Returns the major hardware revision
- minor_
chip_ version unstable - Returns the minor hardware revision
- override_
mac_ address unstable - Overrides the base MAC address used by
interface_mac_address. - read_
bit unstable - Read bit value.
- read_
field_ le unstable - Read field value in a little-endian order
- rtc_
calib_ cal_ code unstable - Get ADC calibration code
- rtc_
calib_ cal_ mv unstable - Get ADC calibration coefficients
- rtc_
calib_ get_ chan_ compens unstable - Get the channel specific calibration compensation
- rtc_
calib_ init_ code unstable - Get ADC initial code for specified attenuation from efuse
- rtc_
calib_ version unstable - Get version of RTC calibration block
- rwdt_
multiplier unstable - Get the multiplier for the timeout value of the RWDT STAGE 0 register.
- xtal_
frequency_ mhz unstable - Returns the frequency of the crystal oscillator in MHz