Skip to main content

Module efuse

Module efuse 

Source
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§

ChipRevision
Represents the hardware revision.
EfuseFieldunstable
The bit field for get access to efuse data.
MacAddress
Hardware (MAC) address.

Enums§

InterfaceMacAddress
Interface selection for interface_mac_address.
SetMacErrorunstable
Error indicating issues with setting the MAC address.

Constants§

BLK_VERSION_MAJORunstable
BLK_VERSION_MAJOR of BLOCK2
BLK_VERSION_MINORunstable
BLK_VERSION_MINOR of BLOCK2
BLOCK_KEY0unstable
[BLOCK_KEY0] Key0 or user data
BLOCK_KEY1unstable
[BLOCK_KEY1] Key1 or user data
BLOCK_KEY2unstable
[BLOCK_KEY2] Key2 or user data
BLOCK_KEY3unstable
[BLOCK_KEY3] Key3 or user data
BLOCK_KEY4unstable
[BLOCK_KEY4] Key4 or user data
BLOCK_SYS_DATA2unstable
[BLOCK_SYS_DATA2] System data part 2 (reserved)
BLOCK_USR_DATAunstable
[BLOCK_USR_DATA] User data
BOOTLOADER_ANTI_ROLLBACK_ENunstable
Enable anti-rollback check for 2nd-stage bootloader
BOOTLOADER_ANTI_ROLLBACK_SECURE_VERSIONunstable
Anti-rollback secure version for 2nd-stage bootloader
BOOTLOADER_ANTI_ROLLBACK_UPDATE_IN_ROMunstable
Enable anti-rollback SECURE_VERSION update from ROM bootloader
CUSTOM_MACunstable
[MAC_CUSTOM CUSTOM_MAC] Custom MAC
DCDC_VSET_ENunstable
Select DCDC vset from efuse_dcdc_vset
DISABLE_BLK_VERSION_MAJORunstable
Disables check of blk version major
DISABLE_WAFER_VERSION_MAJORunstable
Disables check of wafer version major
DIS_DIRECT_BOOTunstable
Disable direct boot mode
DIS_DOWNLOAD_MANUAL_ENCRYPTunstable
Disable manual flash encryption
DIS_DOWNLOAD_MODEunstable
Disable download mode
DIS_FORCE_DOWNLOADunstable
Disable force download mode
DIS_PAD_JTAGunstable
Permanently disable JTAG
DIS_SM_CRYPTunstable
Disable all SM crypto functions (SM2, SM3)
DIS_SWDunstable
Disable super-watchdog
DIS_TWAIunstable
Disable TWAI
DIS_USB_JTAGunstable
Disable USB JTAG function
DIS_USB_OTG_DOWNLOAD_MODEunstable
Disable USB-OTG download mode
DIS_USB_SERIAL_JTAGunstable
Disable USB-Serial-JTAG
DIS_USB_SERIAL_JTAG_DOWNLOAD_MODEunstable
Disable USB download mode
DIS_USB_SERIAL_JTAG_ROM_PRINTunstable
Disable USB print from ROM
DIS_WDTunstable
Disable watchdog
DIS_WIFI6unstable
Disable Wi-Fi 6
ECC_FORCE_CONST_TIMEunstable
Permanently enable ECC constant-time mode
ECDSA_DISABLE_SOFT_Kunstable
Permanently disable ECDSA software-set KEY
ENABLE_SECURITY_DOWNLOADunstable
Enable security download
ENA_SPI_BOOT_CRYPT_SCRAMBLERunstable
Enable ciphertext scrambler for external memory
ENA_XTS_SHADOWunstable
Enable XTS-AES shadow core countermeasure against fault injection
FLASH_TPUWunstable
Flash power-up waiting time (ms; ≥15 = 2× programmed value)
FLASH_TYPEunstable
Flash type (0 = NOR, 1 = NAND)
FORCE_DISABLE_SW_INIT_KEYunstable
Disable software-written init key; force efuse_init_key
FORCE_SEND_RESUMEunstable
Force ROM to send resume command during SPI boot
FORCE_USE_KEY_MANAGER_KEYunstable
Force use of key manager key (per-bit)
HUK_GEN_STATEunstable
HUK generation state (odd count = invalid)
HYS_EN_PADunstable
Enable hysteresis on corresponding pad
JTAG_SEL_ENABLEunstable
Enable JTAG selection via strapping pin
KEY_PURPOSE_0unstable
Key purpose for Key0
KEY_PURPOSE_1unstable
Key purpose for Key1
KEY_PURPOSE_2unstable
Key purpose for Key2
KEY_PURPOSE_3unstable
Key purpose for Key3
KEY_PURPOSE_4unstable
Key purpose for Key4
KM_DEPLOY_ONLY_ONCEunstable
Restrict each KM key to single-deploy (per-bit)
KM_DISABLE_DEPLOY_MODEunstable
Disable KM deploy modes (per-bit: ecdsa, flash/spi, hmac/aes, ds/rma, psram)
KM_RND_SWITCH_CYCLEunstable
KM random number switch cycle control
KM_XTS_KEY_LENGTH_256unstable
Configure flash encryption to use XTS-128 key (0 = 128-bit, 1 = 256-bit)
LOCK_KM_KEYunstable
Lock KM efuse key
MAC0unstable
[MAC_FACTORY] MAC address (bits 0–31)
MAC1unstable
[MAC_FACTORY] MAC address (bits 32–47)
MAC_EXTunstable
Extended MAC address bits
MAC_RESERVED_0unstable
Reserved
MAC_RESERVED_1unstable
Reserved
MAC_RESERVED_2unstable
Reserved
OPTIONAL_UNIQUE_IDunstable
Optional unique 128-bit ID
PKG_VERSIONunstable
Package version
PMU_FLASH_POWER_SELunstable
Flash power select (1 = 3.3V, 0 = 1.8V)
PMU_FLASH_POWER_SEL_ENunstable
Validate PMU_FLASH_POWER_SEL
POWER_GLITCH_ENunstable
Enable power glitch detection
PSRAM_CAPunstable
PSRAM capacity
PSRAM_VENDORunstable
PSRAM vendor
PVT_0_CELL_SELECTunstable
PVT glitch monitor 0 cell select
PVT_0_GLITCH_ENunstable
Enable PVT power glitch monitor 0
PVT_0_GLITCH_MODEunstable
Glitch mode for PVT monitor 0
PVT_0_LIMITunstable
PVT glitch monitor 0 threshold
PVT_1_CELL_SELECTunstable
PVT glitch monitor 1 cell select
PVT_1_GLITCH_ENunstable
Enable PVT power glitch monitor 1
PVT_1_GLITCH_MODEunstable
Glitch mode for PVT monitor 1
PVT_1_LIMITunstable
PVT glitch monitor 1 threshold
RD_DISunstable
Disable reading from BLOCK4-9
RECOVERY_BOOTLOADER_FLASH_SECTORunstable
Starting flash sector of recovery bootloader (0 or 0xFFF = disabled)
REPEAT7_RSVDunstable
Reserved
RESERVED_1_136unstable
Reserved
RESERVED_3_192unstable
Reserved
RESERVED_3_248unstable
Reserved
RESERVE_0_39unstable
Reserved
RESERVE_0_53unstable
Reserved
RESERVE_0_60unstable
Reserved
RESERVE_0_65unstable
Reserved
RESERVE_0_91unstable
Reserved
RESERVE_0_126unstable
Reserved
RESERVE_0_132unstable
Reserved
RESERVE_0_134unstable
Reserved
RESERVE_0_138unstable
Reserved
RESERVE_0_153unstable
Reserved
RESERVE_0_178unstable
Reserved
RESERVE_0_192unstable
Reserved
RESERVE_0_197unstable
Reserved
RESERVE_0_246unstable
Reserved
RESERVE_0_272unstable
Reserved
RESERVE_9_197unstable
Reserved
RESERVE_9_223unstable
Reserved
RE_ENABLE_JTAG_SOURCEunstable
Select crypto peripheral for re-enabling JTAG (0 = RMA, 1 = HMAC)
RMA_CHIP_INFO_SOURCEunstable
Use HUK_info as CHIP_info source in RMA (0 = UNIQ_id)
RMA_DISABLE_FAST_VEFunstable
Disable FAST_VEF in RMA session
RMA_ENAunstable
Enable RMA function in download mode (01/10 = enabled, 00/11 = disabled)
RMA_NONCE_ENAunstable
RMA NONCE enable (x0 = no NONCE, 1x = KM-generated NONCE)
RMA_SESSION_COUNTERunstable
Number of times the RMA session has been entered
SECURE_BOOT_AGGRESSIVE_REVOKEunstable
Enable aggressive revocation for secure boot
SECURE_BOOT_DISABLE_FAST_WAKEunstable
Disable fast verify on wake when secure boot is enabled
SECURE_BOOT_ENunstable
Enable secure boot
SECURE_BOOT_KEY_REVOKE0unstable
Revoke secure boot key 0
SECURE_BOOT_KEY_REVOKE1unstable
Revoke secure boot key 1
SECURE_BOOT_KEY_REVOKE2unstable
Revoke secure boot key 2
SECURE_BOOT_SHA384_ENunstable
Enable secure boot using SHA-384
SECURE_VERSIONunstable
Secure version for anti-rollback
SEC_DPA_LEVELunstable
SPA secure level (clock random divide mode)
SOFT_DIS_JTAGunstable
Soft-disable JTAG (odd = disabled, even = enabled)
SPI_BOOT_CRYPT_CNTunstable
Enables flash encryption counter
SPI_DOWNLOAD_MSPI_DISunstable
Disable SPI0 during boot_mode_download
SYS_DATA_PART0_2unstable
Third 32-bit word of zeroth system data block
SYS_DATA_PART1_4unstable
First-part system data word 4
SYS_DATA_PART1_5unstable
First-part system data word 5
SYS_DATA_PART1_6unstable
First-part system data word 6
SYS_DATA_PART1_7unstable
First-part system data word 7
SYS_DATA_PART2_1unstable
Second-part system data word 1
SYS_DATA_PART2_2unstable
Second-part system data word 2
SYS_DATA_PART2_3unstable
Second-part system data word 3
SYS_DATA_PART2_4unstable
Second-part system data word 4
SYS_DATA_PART2_5unstable
Second-part system data word 5
TEMPunstable
Max ambient temperature
UART_PRINT_CONTROLunstable
UART print control (00=force on, 01=GPIO8 low, 10=GPIO8 high, 11=force off)
USB_DEVICE_DREFHunstable
USB device single-end input high threshold (1.76–2V, 80mV steps)
USB_DEVICE_DREFLunstable
USB device single-end input low threshold (0.8–1.04V, 80mV steps)
USB_DEVICE_EXCHG_PINSunstable
Enable USB device D+/D- pin swap
WAFER_VERSION_MAJORunstable
Major chip version
WAFER_VERSION_MINORunstable
Minor chip version
WDT_DELAY_SELunstable
RTC watchdog STG0 timeout multiplier
WR_DISunstable
Disable programming of individual eFuses
XTS_DPA_CLK_ENABLEunstable
Enable XTS clock anti-DPA attack
XTS_DPA_PSEUDO_LEVELunstable
XTS pseudo-round anti-DPA level (0 = register-controlled)

Functions§

base_mac_addressunstable
Returns the base MAC address programmed into eFuse during manufacturing.
block_versionunstable
Returns the eFuse block version.
chip_revision
Returns the hardware revision.
flash_encryptionunstable
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_versionunstable
Returns the major hardware revision.
minor_chip_versionunstable
Returns the minor hardware revision.
override_mac_addressunstable
Overrides the base MAC address used by interface_mac_address.
read_bitunstable
Reads bit value.
read_field_leunstable
Reads field value in a little-endian order.
rtc_calib_versionunstable
Returns the version of RTC calibration block.
rwdt_multiplierunstable
Returns the multiplier for the timeout value of the RWDT STAGE 0 register.