Available on crate feature
unstable only.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.
The Efuse struct represents the eFuse peripheral and is responsible for
reading various eFuse fields and values.
§Examples
§Read data from the eFuse storage.
use esp_hal::efuse::{Efuse, SECURE_VERSION};
let mac_address = Efuse::read_base_mac_address();
println!(
"MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
mac_address[0],
mac_address[1],
mac_address[2],
mac_address[3],
mac_address[4],
mac_address[5]
);
println!("MAC address {:02x?}", Efuse::mac_address());
println!("Flash Encryption {:?}", Efuse::flash_encryption());
// Besides the helper methods, various eFuse field constants can also be read with a lower-level API:
println!(
"Secure version {:?}",
Efuse::read_field_le::<u16>(SECURE_VERSION)
);Structs§
- Efuse
- A struct representing the eFuse functionality of the chip.
- Efuse
Field - The bit field for get access to efuse data
Enums§
- AdcCalib
Unit - Selects which ADC we are interested in the efuse calibration data for
- SetMac
Error - Error indicating issues with setting the MAC address.
Constants§
- ADC1_
CAL_ VOL_ ATTE N0 - ADC1 calibration voltage at atten0
- ADC1_
CAL_ VOL_ ATTE N3 - ADC1 calibration voltage at atten3
- ADC1_
INIT_ CODE_ ATTE N0 - ADC1 init code at atten0
- ADC1_
INIT_ CODE_ ATTE N3 - ADC1 init code at atten3
- ADC_
CALIBRATION_ 3 - Store the bit [86:96] of ADC calibration data
- BLK2_
RESERVED_ DATA_ 0 - Store the bit [0:20] of block2 reserved data
- BLK2_
RESERVED_ DATA_ 1 - Store the bit [21:52] of block2 reserved data
- BLK_
VERSION_ MAJOR - Major version of BLOCK2
- BLK_
VERSION_ MINOR - Minor version of BLOCK2
- BLOCK_
KEY0 - BLOCK_KEY0 - 256-bits. 256-bit key of Flash Encryption
- CUSTOM_
MAC - Custom MAC address
- CUSTOM_
MAC_ USED - True if MAC_CUSTOM is burned
- DIG_
DBIAS_ HVT - BLOCK2 digital dbias when hvt
- DIG_
LDO_ ACT_ DBIA S26 - BLOCK2 DIG_LDO_ACT_DBIAS26
- DIG_
LDO_ ACT_ STEP D10 - BLOCK2 DIG_LDO_ACT_STEPD10
- DIG_
LDO_ SLP_ DBIA S2 - BLOCK2 DIG_LDO_DBG0_DBIAS2
- DIG_
LDO_ SLP_ DBIA S26 - BLOCK2 DIG_LDO_DBG0_DBIAS26
- DISABLE_
BLK_ VERSION_ MAJOR - Disables check of blk version major
- DISABLE_
WAFER_ VERSION_ MAJOR - Disables check of wafer version major
- DIS_
DIRECT_ BOOT - This bit set means disable direct_boot mode
- DIS_
DOWNLOAD_ ICACHE - The bit be set to disable icache in download mode
- DIS_
DOWNLOAD_ MANUAL_ ENCRYPT - The bit be set to disable manual encryption
- DIS_
DOWNLOAD_ MODE - Set this bit to disable download mode (boot_mode[3:0] = 0; 1; 2; 4; 5; 6; 7)
- DIS_
PAD_ JTAG - Set this bit to disable pad jtag
- ENABLE_
SECURITY_ DOWNLOAD - Set this bit to enable secure UART download mode
- FLASH_
TPUW - Configures flash waiting time after power-up; in unit of ms. If the value is less than 15; the waiting time is the configurable value. Otherwise; the waiting time is twice the configurable value
- FORCE_
SEND_ RESUME - Set this bit to force ROM code to send a resume command during SPI boot
- MAC0
- MAC address
- MAC1
- MAC address
- OCODE
- OCode
- PKG_
VERSION - EFUSE_PKG_VERSION
- RD_DIS
- Disable reading from BlOCK3
- RESERVED_
0_ 8 - RESERVED_
0_ 61 - reserved
- RESERVED_
1_ 48 - reserved
- RESERVED_
2_ 171 - reserved
- RTC_
LDO_ ACT_ DBIA S13 - BLOCK2 DIG_LDO_ACT_DBIAS13
- RTC_
LDO_ ACT_ DBIA S31 - BLOCK2 DIG_LDO_ACT_DBIAS31
- RTC_
LDO_ SLP_ DBIA S13 - BLOCK2 DIG_LDO_SLP_DBIAS13
- RTC_
LDO_ SLP_ DBIA S29 - BLOCK2 DIG_LDO_SLP_DBIAS29
- RTC_
LDO_ SLP_ DBIA S31 - BLOCK2 DIG_LDO_SLP_DBIAS31
- SECURE_
BOOT_ EN - The bit be set to enable secure boot
- SECURE_
VERSION - Secure version for anti-rollback
- SPI_
BOOT_ CRYPT_ CNT - Enables flash encryption when 1 or 3 bits are set and disables otherwise
- SYSTEM_
DATA2 - Stores the bits [64:87] of system data
- TEMP_
CALIB - Temperature calibration data
- UART_
PRINT_ CONTROL - Set the default UARTboot message output mode
- WAFER_
VERSION_ MAJOR - WAFER_VERSION_MAJOR
- WAFER_
VERSION_ MINOR - WAFER_VERSION_MINOR
- WDT_
DELAY_ SEL - RTC watchdog timeout threshold; in unit of slow clock cycle
- WR_DIS
- Disable programming of individual eFuses
- XTS_
KEY_ LENGTH_ 256 - Flash encryption key length