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::Bluetooth);
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§

AdcCalibUnitunstable
Selects which ADC we are interested in the efuse calibration data for
InterfaceMacAddress
Interface selection for interface_mac_address.
SetMacErrorunstable
Error indicating issues with setting the MAC address.

Constants§

ACTIVE_HP_DBIASunstable
Stores the PMU active hp dbias
ACTIVE_LP_DBIASunstable
Stores the PMU active lp dbias
ADC1_AVE_INITCODE_ATTEN0unstable
ADC1 calibration data
ADC1_AVE_INITCODE_ATTEN1unstable
ADC1 calibration data
ADC1_AVE_INITCODE_ATTEN2unstable
ADC1 calibration data
ADC1_AVE_INITCODE_ATTEN3unstable
ADC1 calibration data
ADC1_CH0_ATTEN0_INITCODE_DIFFunstable
ADC1 calibration data
ADC1_CH1_ATTEN0_INITCODE_DIFFunstable
ADC1 calibration data
ADC1_CH2_ATTEN0_INITCODE_DIFFunstable
ADC1 calibration data
ADC1_CH3_ATTEN0_INITCODE_DIFFunstable
ADC1 calibration data
ADC1_CH4_ATTEN0_INITCODE_DIFFunstable
ADC1 calibration data
ADC1_HI_DOUT_ATTEN0unstable
ADC1 calibration data
ADC1_HI_DOUT_ATTEN1unstable
ADC1 calibration data
ADC1_HI_DOUT_ATTEN2unstable
ADC1 calibration data
ADC1_HI_DOUT_ATTEN3unstable
ADC1 calibration data
BLK_VERSION_MAJORunstable
BLK_VERSION_MAJOR of BLOCK2
BLK_VERSION_MINORunstable
BLK_VERSION_MINOR of BLOCK2. 1: RF Calibration data in BLOCK1
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
CRYPT_DPA_ENABLEunstable
Represents whether anti-dpa attack is enabled. 1:enabled. 0: disabled
CUSTOM_MACunstable
Custom MAC
DBIAS_VOL_GAPunstable
Stores the low 1 bit of dbias_vol_gap
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: disabled. 0: enabled
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 disabled or enabled. 1: disabled. 0: enabled
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 icache is disabled or enabled. 1: disabled. 0: enabled
DIS_PAD_JTAGunstable
Represents whether JTAG is disabled in the hard way(permanently). 1: disabled. 0: enabled
DIS_TWAIunstable
Represents whether TWAI function is disabled or enabled. 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: disabled. 0: enabled
DIS_USB_SERIAL_JTAG_ROM_PRINTunstable
Set this bit to disable USB-Serial-JTAG print during rom boot
DSLP_DBIASunstable
Stores the PMU sleep dbias
ECC_FORCE_CONST_TIMEunstable
Set this bit to permanently turn on ECC const-time mode
ECDSA_CURVE_MODEunstable
Configures the curve of ECDSA calculation: 0: only enable P256. 1: only enable P192. 2: both enable P256 and P192. 3: only enable P256
ENABLE_SECURITY_DOWNLOADunstable
Represents whether security download is enabled or disabled. 1: enabled. 0: disabled
FLASH_CAPunstable
Stores the flash cap
FLASH_TEMPunstable
Stores the flash temp
FLASH_TPUWunstable
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_VENDORunstable
Stores the flash vendor
FORCE_SEND_RESUMEunstable
Represents whether ROM code is forced to send a resume command during SPI boot. 1: forced. 0:not forced
HYS_EN_PAD0unstable
Set bits to enable hysteresis function of PAD0~5
HYS_EN_PAD1unstable
Set bits to enable hysteresis function of PAD6~27
JTAG_SEL_ENABLEunstable
Set this bit to enable selection between usb_to_jtag and pad_to_jtag through strapping gpio25 when both EFUSE_DIS_PAD_JTAG and EFUSE_DIS_USB_JTAG are equal to 0
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
MAC0unstable
MAC address
MAC1unstable
MAC address
MAC_EXTunstable
Stores the extended bits of MAC address
MAC_RESERVED_2unstable
Reserved
OPTIONAL_UNIQUE_IDunstable
Optional unique 128-bit ID
PKG_VERSIONunstable
Package version
POWERGLITCH_ENunstable
Represents whether power glitch function is enabled. 1: enabled. 0: disabled
POWERGLITCH_EN1unstable
Set these bits to enable power glitch function when chip power on
RD_DISunstable
Disable reading from BlOCK4-10
RESERVED_0_123unstable
reserved
RESERVED_1_131unstable
reserved
RESERVED_2_128unstable
reserved
RESERVED_2_245unstable
reserved
RESERVED_3_192unstable
reserved
RESERVED_3_248unstable
reserved
RESERVE_0_114unstable
Reserved
RPT4_RESERVED0_4unstable
Reserved
RPT4_RESERVED1_1unstable
Reserved
RPT4_RESERVED3_5unstable
Reserved
RPT4_RESERVED4_0unstable
Reserved
RPT4_RESERVED4_1unstable
Reserved
RXIQ_0unstable
Stores RF Calibration data. RXIQ data 0
RXIQ_1unstable
Stores RF Calibration data. RXIQ data 1
RXIQ_VERSIONunstable
Stores RF Calibration data. RXIQ version
SECURE_BOOT_AGGRESSIVE_REVOKEunstable
Represents whether revoking aggressive secure boot is enabled or disabled. 1: enabled. 0: disabled
SECURE_BOOT_DISABLE_FAST_WAKEunstable
Represents whether FAST VERIFY ON WAKE is disabled or enabled when Secure Boot is enabled. 1: disabled. 0: enabled
SECURE_BOOT_ENunstable
Represents whether secure boot is enabled or disabled. 1: enabled. 0: disabled
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
SOFT_DIS_JTAGunstable
Represents whether JTAG is disabled in soft way. Odd number: disabled. Even number: enabled
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_2unstable
Stores the second 32 bits of the zeroth part of system data
TEMP_CALIBunstable
Temperature calibration data
UART_PRINT_CONTROLunstable
Set the default UARTboot message output mode
USB_DREFHunstable
Represents the single-end input threshold vrefh; 1.76 V to 2 V with step of 80 mV
USB_DREFLunstable
Represents the single-end input threshold vrefl; 1.76 V to 2 V with step of 80 mV
USB_EXCHG_PINSunstable
Represents whether the D+ and D- pins 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
Stores the wafer version major
WAFER_VERSION_MINORunstable
Stores the wafer version minor
WDT_DELAY_SELunstable
Represents whether RTC watchdog timeout threshold is selected at startup. 1: selected. 0: not selected
WR_DISunstable
Disable programming of individual eFuses
XTS_DPA_PSEUDO_LEVELunstable
Set this bit to control the xts pseudo-round anti-dpa attack function: 0: controlled by register. 1-3: the higher the value is; the more pseudo-rounds are inserted to the xts-aes calculation

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_cal_codeunstable
Returns the call code
rtc_calib_cal_mvunstable
Get ADC reference point voltage for specified attenuation in millivolts
rtc_calib_init_codeunstable
Get ADC initial code for specified attenuation from efuse
rtc_calib_versionunstable
Get version of RTC calibration block
rwdt_multiplierunstable
Get the multiplier for the timeout value of the RWDT STAGE 0 register.