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§

ACTIVE_HP_DBIASunstable
Active HP DBIAS of fixed voltage
ACTIVE_LP_DBIASunstable
Active LP DBIAS of fixed voltage
ADC1_AVE_INIT_CODE_ATTEN0unstable
Average initcode of ADC1 atten0
ADC1_AVE_INIT_CODE_ATTEN1unstable
Average initcode of ADC1 atten1
ADC1_AVE_INIT_CODE_ATTEN2unstable
Average initcode of ADC1 atten2
ADC1_AVE_INIT_CODE_ATTEN3unstable
Average initcode of ADC1 atten3
ADC1_CH0_ATTEN0_INITCODE_DIFFunstable
Gap between ADC1 CH0 and average initcode
ADC1_CH1_ATTEN0_INITCODE_DIFFunstable
Gap between ADC1 CH1 and average initcode
ADC1_CH2_ATTEN0_INITCODE_DIFFunstable
Gap between ADC1 CH2 and average initcode
ADC1_CH3_ATTEN0_INITCODE_DIFFunstable
Gap between ADC1 CH3 and average initcode
ADC1_HI_DOUT_ATTEN0unstable
HI_DOUT of ADC1 atten0
ADC1_HI_DOUT_ATTEN1unstable
HI_DOUT of ADC1 atten1
ADC1_HI_DOUT_ATTEN2unstable
HI_DOUT of ADC1 atten2
ADC1_HI_DOUT_ATTEN3unstable
HI_DOUT of ADC1 atten3
BLK_VERSION_MAJORunstable
BLK_VERSION_MAJOR of BLOCK2
BLK_VERSION_MINORunstable
BLK_VERSION_MINOR of BLOCK2
BLOCK_KEY0unstable
Key0 or user data
BLOCK_KEY1unstable
Key1 or user data
BLOCK_KEY2unstable
Key2 or user data
BLOCK_KEY3unstable
Key3 or user data
BLOCK_KEY4unstable
Key4 or user data
BLOCK_KEY5unstable
Key5 or user data
BLOCK_SYS_DATA2unstable
System data part 2 (reserved)
BLOCK_USR_DATAunstable
User data
BOOTLOADER_ANTI_ROLLBACK_ENunstable
Represents whether the ani-rollback check for the 2nd stage bootloader is enabled.1: Enabled0: Disabled
BOOTLOADER_ANTI_ROLLBACK_SECURE_VERSIONunstable
Represents the anti-rollback secure version of the 2nd stage bootloader used by the ROM bootloader
BOOTLOADER_ANTI_ROLLBACK_UPDATE_IN_ROMunstable
Represents whether the ani-rollback SECURE_VERSION will be updated from the ROM bootloader.1: Enable0: Disable
CUSTOM_MACunstable
Custom MAC
DISABLE_BLK_VERSION_MAJORunstable
Disables check of blk version major
DISABLE_WAFER_VERSION_MAJORunstable
Disables check of wafer version major
DIS_DIRECT_BOOTunstable
Represents whether direct boot mode is disabled or enabled. 1. Disable 0: Enable
DIS_DOWNLOAD_MANUAL_ENCRYPTunstable
Represents whether flash encrypt function is disabled or enabled(except in SPI boot mode). 1: disabled 0: enabled
DIS_DOWNLOAD_MODEunstable
Represents whether Download mode is disable or enable. 1. Disable 0: Enable
DIS_FORCE_DOWNLOADunstable
Represents whether the function that forces chip into download mode is disabled or enabled. 1: disabled 0: enabled
DIS_ICACHEunstable
Represents whether cache is disabled. 1: Disabled 0: Enabled.
DIS_PAD_JTAGunstable
Represents whether JTAG is disabled in the hard way(permanently). 1: disabled 0: enabled
DIS_USB_JTAGunstable
Represents whether the function of usb switch to jtag is disabled or enabled. 1: disabled 0: enabled
DIS_USB_SERIAL_JTAGunstable
Represents whether USB-Serial-JTAG is disabled or enabled. 1: disabled 0: enabled
DIS_USB_SERIAL_JTAG_DOWNLOAD_MODEunstable
Represents whether the USB-Serial-JTAG download function is disabled or enabled. 1: Disable 0: Enable
DIS_USB_SERIAL_JTAG_ROM_PRINTunstable
Represents whether print from USB-Serial-JTAG is disabled or enabled. 1. Disable 0: Enable
DIS_WIFI6unstable
Represents whether the WIFI6 feature is enable or disabled. 1: WIFI6 is disable; 0: WIFI6 is enabled
DSLP_LP_DBGunstable
DSLP LP DBG of fixed voltage
DSLP_LP_DBIASunstable
DSLP LP DBIAS of fixed voltage
ECC_FORCE_CONST_TIMEunstable
Represents whether to force ecc to use const-time calculation mode. 1: Enable. 0: Disable
ECDSA_DISABLE_P192unstable
Represents whether to disable P192 curve in ECDSA. 1: Disabled. 0: Not disabled
ENABLE_SECURITY_DOWNLOADunstable
Represents whether security download is enabled or disabled. 1: Enable 0: Disable
FLASH_CAPunstable
Flash capacity
FLASH_TPUWunstable
Represents the flash waiting time after power-up; in unit of ms. When the value less than 15; the waiting time is programmed value. Otherwise; the waiting time is 2 times the programmed value
FLASH_VENDORunstable
Flash vendor
FORCE_SEND_RESUMEunstable
Represents whether ROM code is forced to send a resume command during SPI boot
HYS_EN_PADunstable
Set bits to enable hysteresis function of PAD0~27
JTAG_SEL_ENABLEunstable
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_0unstable
Represents the purpose of Key0
KEY_PURPOSE_1unstable
Represents the purpose of Key1
KEY_PURPOSE_2unstable
Represents the purpose of Key2
KEY_PURPOSE_3unstable
Represents the purpose of Key3
KEY_PURPOSE_4unstable
Represents the purpose of Key4
KEY_PURPOSE_5unstable
Represents the purpose of Key5
LP_HP_DBIAS_VOL_GAPunstable
DBIAS gap between LP and HP
LSLP_HP_DBGunstable
LSLP HP DBG of fixed voltage
LSLP_HP_DBIASunstable
LSLP HP DBIAS of fixed voltage
MAC0unstable
MAC address
MAC1unstable
MAC address
OCODEunstable
ADC OCode calibration
OPTIONAL_UNIQUE_IDunstable
Optional unique 128-bit ID
PKG_VERSIONunstable
Package version
PSRAM_CAPunstable
PSRAM capacity
PSRAM_VENDORunstable
PSRAM vendor
RD_DISunstable
Disable reading from BlOCK4-10
RECOVERY_BOOTLOADER_FLASH_SECTORunstable
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
REPEAT_DATA4unstable
Reserved
RESERVED_1_121unstable
reserved
RESERVED_2_241unstable
reserved
RESERVED_3_192unstable
reserved
RESERVED_3_248unstable
reserved
RESERVE_0_61unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_0_146unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_0_184unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_1_48unstable
Reserved; it was created by set_missed_fields_in_regs func
SECURE_BOOT_AGGRESSIVE_REVOKEunstable
Represents whether revoking aggressive secure boot is enabled or disabled.
SECURE_BOOT_DISABLE_FAST_WAKEunstable
Represents whether FAST_VERIFY_ON_WAKE is disable or enable when Secure Boot is enable
SECURE_BOOT_ENunstable
Represents whether secure boot is enabled or disabled. 1. Enable 0: Disable
SECURE_BOOT_KEY_REVOKE0unstable
Revoke 1st secure boot key
SECURE_BOOT_KEY_REVOKE1unstable
Revoke 2nd secure boot key
SECURE_BOOT_KEY_REVOKE2unstable
Revoke 3rd secure boot key
SECURE_VERSIONunstable
Represents the version used by ESP-IDF anti-rollback feature
SEC_DPA_LEVELunstable
Represents the spa secure level by configuring the clock random divide mode
SPI_BOOT_CRYPT_CNTunstable
Enables flash encryption when 1 or 3 bits are set and disables otherwise
SPI_DOWNLOAD_MSPI_DISunstable
Represents whether SPI0 controller during boot_mode_download is disabled or enabled. 1: disabled 0: enabled
SYS_DATA_PART0_1unstable
Represents the first 14-bit of zeroth part of system data
SYS_DATA_PART0_2unstable
Represents the second 32-bit of zeroth part of system data
TEMPunstable
Temperature
TEMPERATURE_SENSORunstable
Temperature calibration data
UART_PRINT_CONTROLunstable
Represents the types of UART printing
USB_DREFHunstable
Represents the single-end input threshold vrefh of USB_SERIAL_JTAG PHY; 1.76 V to 2 V with step of 80 mV
USB_DREFLunstable
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_PINSunstable
Represents whether the D+ and D- pins of USB_SERIAL_JTAG PHY is exchanged. 1: exchanged 0: not exchanged
VDD_SPI_AS_GPIOunstable
Represents whether vdd spi pin is functioned as gpio. 1: functioned 0: not functioned
WAFER_VERSION_MAJORunstable
Major chip version
WAFER_VERSION_MINORunstable
Minor chip version
WDT_DELAY_SELunstable
lp wdt timeout threshold at startup = initial timeout value * (2 ^ (EFUSE_WDT_DELAY_SEL + 1))
WR_DISunstable
Disable programming of individual eFuses
XTS_DPA_CLK_ENABLEunstable
Represents whether xts-aes anti-dpa attack clock is enabled. 1. Enable. 0: Disable.
XTS_DPA_PSEUDO_LEVELunstable
Represents the pseudo round level of xts-aes anti-dpa attack. 3: High. 2: Moderate 1. Low 0: Disabled

Functions§

base_mac_addressunstable
Returns the base MAC address programmed into eFuse during manufacturing.
block_versionunstable
Get efuse block version
chip_revision
Returns the hardware revision.
flash_encryptionunstable
Get status of SPI boot encryption.
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
Read bit value.
read_field_leunstable
Read field value in a little-endian order
rtc_calib_versionunstable
Get version of RTC calibration block
rwdt_multiplierunstable
Get the multiplier for the timeout value of the RWDT STAGE 0 register.