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::Bluetooth);
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§
- Interface
MacAddress - Interface selection for
interface_mac_address. - SetMac
Error unstable - Error indicating issues with setting the MAC address.
Constants§
- ACTIVE_
DCDC_ 1V25 unstable - DCDC-DCDC DBIAS of 1.25v
- ACTIVE_
DCDC_ 1V35 unstable - DCDC-DCDC DBIAS of 1.35v
- ADC1_
AVE_ INITCODE_ ATTE N0 unstable - Average initcode of ADC1 atten0
- ADC1_
AVE_ INITCODE_ ATTE N1 unstable - Average initcode of ADC1 atten1
- ADC1_
AVE_ INITCODE_ ATTE N2 unstable - Average initcode of ADC1 atten2
- ADC1_
AVE_ INITCODE_ ATTE N3 unstable - Average initcode of ADC1 atten3
- 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_
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
- ADJUST_
1V2 unstable - SPI LDO adjust of 1.2v
- ADJUST_
1V8 unstable - SPI LDO adjust of 1.8v
- 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
- CUSTOM_
MAC unstable - Custom MAC
- DCDC_
CCM_ EN unstable - Represents whether change DCDC to CCM mode
- DCDC_
OCODE unstable - DCDC OCode
- DISABLE_
BLK_ VERSION_ MAJOR unstable - Disables check of blk version major
- DISABLE_
WAFER_ VERSION_ MAJOR unstable - Disables check of wafer version major
- DIS_
CORE1 unstable - Represents whether the CPU-Core1 is disabled. 1: Disabled. 0: Not disable
- DIS_
DIRECT_ BOOT unstable - Represents whether direct boot mode is disabled or enabled. 1: disabled 0: enabled
- DIS_
DOWNLOAD_ MANUAL_ ENCRYPT unstable - Represents whether flash encrypt function is disabled or enabled(except in SPI boot mode). 1: disabled 0: enabled
- DIS_
DOWNLOAD_ MODE unstable - Represents whether Download mode is disabled or enabled. 1: disabled 0: enabled
- DIS_
FORCE_ DOWNLOAD unstable - Represents whether the function that forces chip into download mode is disabled or enabled. 1: disabled 0: enabled
- DIS_
PAD_ JTAG unstable - Represents whether JTAG is disabled in the hard way(permanently). 1: disabled 0: enabled
- DIS_
TWAI unstable - Represents whether TWAI function is disabled or enabled. 1: disabled 0: enabled
- DIS_
USB_ JTAG unstable - Represents whether the function of usb switch to jtag is disabled or enabled. 1: disabled 0: enabled
- DIS_
USB_ SERIAL_ JTAG unstable - Represents whether USB-Serial-JTAG is disabled or enabled. 1: disabled 0: enabled
- DIS_
USB_ SERIAL_ JTAG_ DOWNLOAD_ MODE unstable - Represents whether the USB-Serial-JTAG download function is disabled or enabled. 1: Disable 0: Enable
- DIS_
USB_ SERIAL_ JTAG_ ROM_ PRINT unstable - Represents whether print from USB-Serial-JTAG is disabled or enabled. 1: disabled 0: enabled
- DSLP_
LP_ DBIAS unstable - LP DBIAS in deep sleep
- ECC_
FORCE_ CONST_ TIME unstable - Represents whether to force ecc to use const-time calculation mode. 1: Enable. 0: Disable
- ENABLE_
SECURITY_ DOWNLOAD unstable - Represents whether security download is enabled or disabled. 1: enabled 0: disabled
- FLASH_
CAP unstable - Flash capacity
- FLASH_
LDO_ EFUSE_ SEL unstable - Represents whether to select efuse control flash ldo default voltage. 1 : efuse 0 : strapping
- FLASH_
LDO_ POWER_ SEL unstable - Represents which flash ldo be select: 1: FLASH LDO 1P2 0 : FLASH LDO 1P8
- FLASH_
TPUW unstable - Represents the flash waiting time after power-up; in unit of ms. When the value less than 15; the waiting time is the programmed value. Otherwise; the waiting time is 2 times the programmed value
- 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.0: Enable1: Disable
- FORCE_
SEND_ RESUME unstable - Represents whether ROM code is forced to send a resume command during SPI boot. 1: forced 0:not forced
- FORCE_
USE_ KEY_ MANAGER_ KEY unstable - Represents whether the corresponding key must come from Key Manager. Bit0: Represents whether the ECDSA key must come from Key Manager.0: The key does not need to come from Key Manager1: The key must come from Key ManagerBit1: Represents whether the XTS-AES (flash and PSRAM) key must come from Key Manager.0: The key does not need to come from Key Manager1: The key must come from Key ManagerBit2: Represents whether the HMAC key must come from Key Manager.0: The key does not need to come from Key Manager1: The key must come from Key ManagerBit3: Represents whether the DS key must come from Key Manager.0: The key does not need to come from Key Manager1: The key must come from Key Manager
- HI_
DOUT_ DIFF_ 1P8_ 3P3 unstable - HI dout diff between IO LDO 1.8v and 3.3v
- HUK_
GEN_ STATE unstable - Represents whether the HUK generate mode is valid.Odd count of bits with a value of 1: InvalidEven count of bits with a value of 1: Valid
- HYS_
EN_ PAD unstable - Represents whether the hysteresis function of corresponding PAD is enabled. 1: enabled 0:disabled
- INITCODE_
DIFF_ 1P8_ 3P3 unstable - Initcode diff between IO LDO 1.8v and 3.3v
- IO_
LDO_ 1P8 unstable - Represents select IO LDO voltage to 1.8V or 3.3V. 1: 1.8V 0: 3.3V
- IO_
LDO_ ADJUST unstable - Represents configuration of IO LDO mode and voltage.
- JTAG_
SEL_ ENABLE unstable - Represents whether the selection between usb_to_jtag and pad_to_jtag through strapping gpio15 when both EFUSE_DIS_PAD_JTAG and EFUSE_DIS_USB_JTAG are equal to 0 is enabled or disabled. 1: enabled 0: disabled
- 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: Represents whether the ECDSA key can be deployed only once0: The key can be deployed multiple times1: The key can be deployed only onceBit1: Represents whether the XTS-AES (flash and PSRAM) key can be deployed only once0: The key can be deployed multiple times1: The key can be deployed only onceBit2: Represents whether the HMAC key can be deployed only once0: The key can be deployed multiple times1: The key can be deployed only onceBit3: Represents whether the DS key can be deployed only once0: The key can be deployed multiple times1: The key can be deployed only once
- KM_
DISABLE_ DEPLOY_ MODE unstable - Represents whether the new key deployment of key manager is disabled. Bit0: Represents whether the new ECDSA key deployment is disabled0: Enabled1: DisabledBit1: Represents whether the new XTS-AES (flash and PSRAM) key deployment is disabled0: Enabled1: DisabledBit2: Represents whether the new HMAC key deployment is disabled0: Enabled1: DisabledBit3: Represents whether the new DS key deployment is disabled0: Enabled1: Disabled
- KM_
RND_ SWITCH_ CYCLE unstable - Represents the cycle at which the Key Manager switches random numbers.0: Controlled by the \hyperref[fielddesc:KEYMNGRNDSWITCHCYCLE]{KEYMNG_RND_SWITCH_CYCLE} register. For more information; please refer to Chapter \ref{mod:keymng} \textit{\nameref{mod:keymng}}1: 8 Key Manager clock cycles2: 16 Key Manager clock cycles3: 32 Key Manager clock cycles
- KM_
XTS_ KEY_ LENGTH_ 256 unstable - Represents which key flash encryption uses.0: XTS-AES-256 key1: XTS-AES-128 key
- LOCK_
KM_ KEY unstable - Represents whether the keys in the Key Manager are locked after deployment.0: Not locked1: Locked
- LSLP_
HP_ DRVB unstable - HP DRVB in light sleep
- 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
- PKG_
VERSION unstable - Package version
- PSRAM_
CAP unstable - Psram capacity
- PSRAM_
VENDOR unstable - Psram vendor
- PUMP_
DRV unstable - Use to configure charge pump voltage gain
- PVT_
CELL_ SELECT unstable - Power glitch monitor PVT cell select
- PVT_
DBIAS unstable - PVT DBIAS
- PVT_
GLITCH_ CHARGE_ RESET unstable - Represents whether to trigger reset or charge pump when PVT power glitch happened.1:Trigger charge pump. 0:Trigger reset
- PVT_
GLITCH_ EN unstable - Represents whether to enable PVT power glitch monitor function.1:Enable. 0:Disable
- PVT_
GLITCH_ MODE unstable - Use to configure glitch mode
- PVT_
LIMIT unstable - Power glitch monitor threthold
- PVT_
PUMP_ LIMIT unstable - Use to configure voltage monitor limit for charge pump
- RD_DIS
unstable - Disable reading from BlOCK4-10
- RESERVED_
1_ 186 unstable - reserved
- RESERVED_
2_ 251 unstable - reserved
- RESERVED_
3_ 192 unstable - reserved
- RESERVED_
3_ 248 unstable - reserved
- RESERVE_
0_ 47 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 51 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 61 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 126 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 157 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 184 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
1_ 95 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
1_ 104 unstable - Reserved; it was created by set_missed_fields_in_regs func
- SECURE_
BOOT_ AGGRESSIVE_ REVOKE unstable - Represents whether revoking aggressive secure boot is enabled or disabled. 1: enabled. 0: disabled
- SECURE_
BOOT_ EN unstable - Represents whether secure boot is enabled or disabled. 1: enabled 0: disabled
- 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 version used by ESP-IDF anti-rollback feature
- SEC_
DPA_ LEVEL unstable - Represents the spa secure level by configuring the clock random divide mode
- SLP_
DCDC unstable - DCDC DBIAS in sleep
- SOFT_
DIS_ JTAG unstable - Represents whether JTAG is disabled in soft way. Odd number: disabled Even number: 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 or enabled. 1: disabled 0: enabled
- TEMP
unstable - Temp (die embedded inside)
- TEMP_
CALIB unstable - Temperature calibration data
- UART_
PRINT_ CONTROL unstable - Represents the type of UART printing. 00: force enable printing 01: enable printing when GPIO8 is reset at low level 10: enable printing when GPIO8 is reset at high level 11: force disable printing
- USB_
DREFH unstable - Represents the single-end input threshold vrefh of USB_SERIAL_JTAG PHY; 1.76 V to 2 V with step of 80 mV
- USB_
DREFL unstable - Represents the single-end input threshold vrefl of USB_SERIAL_JTAG PHY; 1.76 V to 2 V with step of 80 mV
- USB_
EXCHG_ PINS unstable - Represents whether the D+ and D- pins of USB_SERIAL_JTAG PHY is exchanged. 1: exchanged 0: not exchanged
- USB_
OTG_ FS_ DREFH unstable - Represents the single-end input threshold vrefh of USB_OTG_FS PHY; 1.76 V to 2 V with step of 80 mV
- USB_
OTG_ FS_ DREFL unstable - Represents the single-end input threshold vrefl of USB_OTG_FS PHY; 1.76 V to 2 V with step of 80 mV
- USB_
OTG_ FS_ EXCHG_ PINS unstable - Represents whether the D+ and D- pins of USB_OTG_FS PHY is exchanged. 1: exchanged 0: not exchanged
- USB_
PHY_ SEL unstable - Represents whether to exchange the USB_SERIAL_JTAG PHY with USB_OTG_FS PHY. 1: exchanged. 0: not exchanged
- VDD_
3V4_ DOUT unstable - ADC dout of vdd 3.4v
- VDD_
SPI_ LDO_ ADJUST unstable - Represents configuration of FLASH LDO mode and voltage.
- WAFER_
VERSION_ MAJOR unstable - Major chip version
- WAFER_
VERSION_ MINOR unstable - Minor chip version
- WDT_
DELAY_ SEL unstable - Represents the threshold level of the RTC watchdog STG0 timeout. 0: Original threshold configuration value of STG0 *2 1: Original threshold configuration value of STG0 *4 2: Original threshold configuration value of STG0 *8 3: Original threshold configuration value of STG0 *16
- WR_DIS
unstable - Disable programming of individual eFuses
- XTS_
DPA_ CLK_ ENABLE unstable - Represents whether xts-aes anti-dpa attack clock is enabled. 1. Enable. 0: Disable.
- XTS_
DPA_ PSEUDO_ LEVEL unstable - Represents the pseudo round level of xts-aes anti-dpa attack. 3: High. 2: Moderate 1. Low 0: Disabled
Functions§
- base_
mac_ address unstable - Returns the base MAC address programmed into eFuse during manufacturing.
- block_
version unstable - Returns the eFuse block version.
- chip_
revision - Returns the hardware revision.
- flash_
encryption unstable - Returns whether SPI boot encryption is enabled.
- 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 - Reads bit value.
- read_
field_ le unstable - Reads field value in a little-endian order.
- rwdt_
multiplier unstable - Returns the multiplier for the timeout value of the RWDT STAGE 0 register.