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§

ChipTypeunstable
Representing different types of ESP32 chips.
InterfaceMacAddress
Interface selection for interface_mac_address.
SetMacErrorunstable
Error indicating issues with setting the MAC address.

Constants§

ABS_DONE_0unstable
Secure boot V1 is enabled for bootloader image
ABS_DONE_1unstable
Secure boot V2 is enabled for bootloader image
ADC1_TP_HIGHunstable
ADC1 Two Point calibration high point. Only valid if EFUSE_RD_BLK3_PART_RESERVE
ADC1_TP_LOWunstable
ADC1 Two Point calibration low point. Only valid if EFUSE_RD_BLK3_PART_RESERVE
ADC2_TP_HIGHunstable
ADC2 Two Point calibration high point. Only valid if EFUSE_RD_BLK3_PART_RESERVE
ADC2_TP_LOWunstable
ADC2 Two Point calibration low point. Only valid if EFUSE_RD_BLK3_PART_RESERVE
ADC_VREFunstable
True ADC reference voltage
BLK3_PART_RESERVEunstable
BLOCK3 partially served for ADC calibration data
BLK3_RESERVED_2unstable
read for BLOCK3
BLK3_RESERVED_6unstable
read for BLOCK3
BLK3_RESERVED_7unstable
read for BLOCK3
BLOCK1unstable
Flash encryption key
BLOCK2unstable
Security boot key
CHIP_CPU_FREQ_LOWunstable
If set alongside EFUSE_RD_CHIP_CPU_FREQ_RATED; the ESP32’s max CPU frequency is rated for 160MHz. 240MHz otherwise
CHIP_CPU_FREQ_RATEDunstable
If set; the ESP32’s maximum CPU frequency has been rated
CHIP_PACKAGEunstable
Chip package identifier
CHIP_PACKAGE_4BITunstable
Chip package identifier #4bit
CHIP_VER_REV1unstable
bit is set to 1 for rev1 silicon
CHIP_VER_REV2unstable
CLK8M_FREQunstable
8MHz clock freq override
CODING_SCHEMEunstable
Efuse variable block length scheme
CONSOLE_DEBUG_DISABLEunstable
Disable ROM BASIC interpreter fallback
CUSTOM_MACunstable
Custom MAC address
CUSTOM_MAC_CRCunstable
CRC8 for custom MAC address
DISABLE_APP_CPUunstable
Disables APP CPU
DISABLE_BTunstable
Disables Bluetooth
DISABLE_DL_CACHEunstable
Disable flash cache in UART bootloader
DISABLE_DL_DECRYPTunstable
Disable flash decryption in UART bootloader
DISABLE_DL_ENCRYPTunstable
Disable flash encryption in UART bootloader
DISABLE_SDIO_HOSTunstable
DIS_CACHEunstable
Disables cache
FLASH_CRYPT_CNTunstable
Flash encryption is enabled if this field has an odd number of bits set
FLASH_CRYPT_CONFIGunstable
Flash encryption config (key tweak bits)
JTAG_DISABLEunstable
Disable JTAG
KEY_STATUSunstable
Usage of efuse block 3 (reserved)
MAC0unstable
MAC address
MAC1unstable
MAC address
MAC_CRCunstable
CRC8 for MAC address
MAC_VERSIONunstable
Version of the MAC field
RD_DISunstable
Disable reading from BlOCK1-3
RESERVED_0_28unstable
reserved
RESERVED_3_56unstable
reserved
RESERVED_3_160unstable
reserved
RESERVE_0_88unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_0_112unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_0_141unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_0_145unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_0_181unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_0_186unstable
Reserved; it was created by set_missed_fields_in_regs func
RESERVE_0_203unstable
Reserved; it was created by set_missed_fields_in_regs func
SECURE_VERSIONunstable
Secure version for anti-rollback
SPI_PAD_CONFIG_CLKunstable
Override SD_CLK pad (GPIO6/SPICLK)
SPI_PAD_CONFIG_CS0unstable
Override SD_CMD pad (GPIO11/SPICS0)
SPI_PAD_CONFIG_Dunstable
Override SD_DATA_1 pad (GPIO8/SPID)
SPI_PAD_CONFIG_HDunstable
read for SPI_pad_config_hd
SPI_PAD_CONFIG_Qunstable
Override SD_DATA_0 pad (GPIO7/SPIQ)
UART_DOWNLOAD_DISunstable
Disable UART download mode. Valid for ESP32 V3 and newer; only
VOL_LEVEL_HP_INVunstable
This field stores the voltage level for CPU to run at 240 MHz; or for flash/PSRAM to run at 80 MHz.0x0: level 7; 0x1: level 6; 0x2: level 5; 0x3: level 4. (RO)
WAFER_VERSION_MINORunstable
WR_DISunstable
Efuse write disable mask
XPD_SDIO_FORCEunstable
Ignore MTDI pin (GPIO12) for VDD_SDIO on reset
XPD_SDIO_REGunstable
read for XPD_SDIO_REG
XPD_SDIO_TIEHunstable
If XPD_SDIO_FORCE & XPD_SDIO_REG

Functions§

base_mac_addressunstable
Returns the base MAC address programmed into eFuse during manufacturing.
chip_revision
Returns the hardware revision.
chip_typeunstable
Returns the CHIP_VER_PKG eFuse value.
core_countunstable
Returns the number of CPUs available on the chip.
flash_encryptionunstable
Get status of SPI boot encryption.
interface_mac_address
Returns the MAC address for a specific interface, derived from the base MAC.
is_bluetooth_enabledunstable
Returns the CHIP_VER_DIS_BT eFuse value.
major_chip_versionunstable
Returns the major hardware revision
max_cpu_frequencyunstable
Returns the maximum rated clock of the CPU in MHz.
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