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§

AdcCalibUnitunstable
Selects which ADC we are interested in the efuse calibration data for
InterfaceMacAddress
Interface selection for interface_mac_address.
RtcCalibParamunstable
Parameter selected from the ESP32-S2 RTC calibration table
SetMacErrorunstable
Error indicating issues with setting the MAC address.

Constants§

ADC_CALIBunstable
4 bit of ADC calibration
BLK_VERSION_MAJORunstable
BLK_VERSION_MAJOR
BLK_VERSION_MINORunstable
BLK_VERSION_MINOR of BLOCK2
BLOCK0_VERSIONunstable
BLOCK0 efuse version
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
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_BOOT_REMAPunstable
Disables capability to Remap RAM to ROM address space
DIS_DCACHEunstable
Set this bit to disable Dcache
DIS_DOWNLOAD_DCACHEunstable
Disables Dcache when SoC is in Download mode
DIS_DOWNLOAD_ICACHEunstable
Disables Icache when SoC is in Download mode
DIS_DOWNLOAD_MANUAL_ENCRYPTunstable
Disables flash encryption when in download boot modes
DIS_DOWNLOAD_MODEunstable
Set this bit to disable all download boot modes
DIS_FORCE_DOWNLOADunstable
Set this bit to disable the function that forces chip into download mode
DIS_ICACHEunstable
Set this bit to disable Icache
DIS_LEGACY_SPI_BOOTunstable
Set this bit to disable Legacy SPI boot mode
DIS_RTC_RAM_BOOTunstable
Reserved
DIS_TWAIunstable
Set this bit to disable the TWAI Controller function
DIS_USBunstable
Set this bit to disable USB OTG function
DIS_USB_DOWNLOAD_MODEunstable
Set this bit to disable use of USB OTG in UART download boot mode
ENABLE_SECURITY_DOWNLOADunstable
Set this bit to enable secure UART download mode (read/write flash only)
FLASH_TPUWunstable
Configures flash startup delay after SoC power-up; in unit of (ms/2). When the value is 15; delay is 7.5 ms
FLASH_TYPEunstable
SPI flash type
FLASH_VERSIONunstable
Flash version
FORCE_SEND_RESUMEunstable
If set; forces ROM code to send an SPI flash resume command during SPI boot
HARD_DIS_JTAGunstable
Hardware disables JTAG permanently
KEY_PURPOSE_0unstable
Purpose of KEY0
KEY_PURPOSE_1unstable
Purpose of KEY1
KEY_PURPOSE_2unstable
Purpose of KEY2
KEY_PURPOSE_3unstable
Purpose of KEY3
KEY_PURPOSE_4unstable
Purpose of KEY4
KEY_PURPOSE_5unstable
Purpose of KEY5
KEY_PURPOSE_6unstable
Purpose of KEY6
MAC0unstable
MAC address
MAC1unstable
MAC address
OPTIONAL_UNIQUE_IDunstable
Optional unique 128-bit ID
PIN_POWER_SELECTIONunstable
Set default power supply for GPIO33-GPIO37; set when SPI flash is initialized
PKG_VERSIONunstable
Package version
PSRAM_VERSIONunstable
PSRAM version
RD_DISunstable
Disable reading from BlOCK4-10
RESERVED_0_162unstable
reserved
RESERVED_1_123unstable
reserved
RESERVED_1_135unstable
reserved
RESERVED_3_192unstable
reserved
RESERVED_3_248unstable
reserved
RPT4_RESERVED1unstable
Reserved (used for four backups method)
RPT4_RESERVED2unstable
Reserved (used for four backups method)
RPT4_RESERVED3unstable
Reserved (used for four backups method)
RPT4_RESERVED5unstable
Reserved (used for four backups method)
RTCCALIB_V1IDX_A10Hunstable
RTCCALIB_V1IDX_A10Lunstable
RTCCALIB_V1IDX_A11Hunstable
RTCCALIB_V1IDX_A11Lunstable
RTCCALIB_V1IDX_A12Hunstable
RTCCALIB_V1IDX_A12Lunstable
RTCCALIB_V1IDX_A13Hunstable
RTCCALIB_V1IDX_A13Lunstable
RTCCALIB_V1IDX_A20Hunstable
RTCCALIB_V1IDX_A20Lunstable
RTCCALIB_V1IDX_A21Hunstable
RTCCALIB_V1IDX_A21Lunstable
RTCCALIB_V1IDX_A22Hunstable
RTCCALIB_V1IDX_A22Lunstable
RTCCALIB_V1IDX_A23Hunstable
RTCCALIB_V1IDX_A23Lunstable
SECURE_BOOT_AGGRESSIVE_REVOKEunstable
Set this bit to enable aggressive secure boot key revocation mode
SECURE_BOOT_ENunstable
Set this bit to enable secure boot
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
Secure version (used by ESP-IDF anti-rollback feature)
SOFT_DIS_JTAGunstable
Software disables JTAG. When software disabled; JTAG can be activated temporarily by HMAC peripheral
SPI_BOOT_CRYPT_CNTunstable
Enables flash encryption when 1 or 3 bits are set and disabled otherwise
SPI_PAD_CONFIG_CLKunstable
SPI_PAD_configure CLK
SPI_PAD_CONFIG_CSunstable
SPI_PAD_configure CS
SPI_PAD_CONFIG_Dunstable
SPI_PAD_configure D(D0)
SPI_PAD_CONFIG_D4unstable
SPI_PAD_configure D4
SPI_PAD_CONFIG_D5unstable
SPI_PAD_configure D5
SPI_PAD_CONFIG_D6unstable
SPI_PAD_configure D6
SPI_PAD_CONFIG_D7unstable
SPI_PAD_configure D7
SPI_PAD_CONFIG_DQSunstable
SPI_PAD_configure DQS
SPI_PAD_CONFIG_HDunstable
SPI_PAD_configure HD(D3)
SPI_PAD_CONFIG_Qunstable
SPI_PAD_configure Q(D1)
SPI_PAD_CONFIG_WPunstable
SPI_PAD_configure WP(D2)
SYS_DATA_PART0_2unstable
Stores the second part of the zeroth part of system data
TEMP_CALIBunstable
Temperature calibration data
UART_PRINT_CHANNELunstable
Selects the default UART for printing boot messages
UART_PRINT_CONTROLunstable
Set the default UART boot message output mode
USB_DREFHunstable
Controls single-end input threshold vrefh; 1.76 V to 2 V with step of 80 mV; stored in eFuse
USB_DREFLunstable
Controls single-end input threshold vrefl; 0.8 V to 1.04 V with step of 80 mV; stored in eFuse
USB_EXCHG_PINSunstable
Set this bit to exchange USB D+ and D- pins
USB_EXT_PHY_ENABLEunstable
Set this bit to enable external USB PHY
USB_FORCE_NOPERSISTunstable
If set; forces USB BVALID to 1
VDD_SPI_DCAPunstable
Prevents SPI regulator from overshoot
VDD_SPI_DCURLIMunstable
Tunes the current limit threshold of SPI regulator when tieh=0; about 800 mA/(8+d)
VDD_SPI_DREFHunstable
SPI regulator high voltage reference
VDD_SPI_DREFLunstable
SPI regulator low voltage reference
VDD_SPI_DREFMunstable
SPI regulator medium voltage reference
VDD_SPI_ENCURLIMunstable
Set SPI regulator to 1 to enable output current limit
VDD_SPI_EN_INITunstable
Set SPI regulator to 0 to configure init[1:0]=0
VDD_SPI_FORCEunstable
Set this bit to use XPD_VDD_PSI_REG and VDD_SPI_TIEH to configure VDD_SPI LDO
VDD_SPI_INITunstable
Adds resistor from LDO output to ground
VDD_SPI_MODECURLIMunstable
SPI regulator switches current limit mode
VDD_SPI_TIEHunstable
If VDD_SPI_FORCE is 1; determines VDD_SPI voltage
VDD_SPI_XPDunstable
If VDD_SPI_FORCE is 1; this value determines if the VDD_SPI regulator is powered on
WAFER_VERSION_MAJORunstable
WAFER_VERSION_MAJOR
WAFER_VERSION_MINOR_HIunstable
WAFER_VERSION_MINOR most significant bit
WAFER_VERSION_MINOR_LOunstable
WAFER_VERSION_MINOR least significant bits
WDT_DELAY_SELunstable
RTC watchdog timeout threshold; in unit of slow clock cycle
WR_DISunstable
Disable programming of individual eFuses

Functions§

base_mac_addressunstable
Returns the base MAC address programmed into eFuse during manufacturing.
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
Get ADC reference point digital code for specified attenuation
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_readingunstable
Reads a parsed RTC calibration table value.
rtc_calib_versionunstable
Get version of RTC calibration block
rwdt_multiplierunstable
Get the multiplier for the timeout value of the RWDT STAGE 0 register.