Chapter 2. API Reference
• RS. EFUSE_BLK1 - EFUSE_BLK10 use Reed-Solomon coding scheme that supports up to 5 bytes of au-
tomatic error correction. Software will encode the 32-byte EFUSE_BLKx using RS (44, 32) to generate a
12-byte check code, and then burn the EFUSE_BLKx and the check code into eFuse at the same time. The
eFuse Controller automatically decodes the RS encoding and applies error correction when reading back the
eFuse block. Because the RS check codes are generated across the entire 256-bit eFuse block, each block can
only be written to one time.
To write some fields into one block, or different blocks in one time, you need to use the batch writ-
ing
mode.
Firstly set this mode through
some fields as usual using the esp_efuse_write_... functions.
esp_efuse_batch_write_commit()
batch recording mode.
eFuse API
Access to the fields is via a pointer to the description structure. API functions have some basic operation:
•
esp_efuse_read_field_blob()
•
esp_efuse_read_field_cnt()
•
esp_efuse_write_field_blob()
•
esp_efuse_write_field_cnt()
•
esp_efuse_get_field_size()
•
esp_efuse_read_reg()
•
esp_efuse_write_reg()
•
esp_efuse_get_coding_scheme()
•
esp_efuse_read_block()
•
esp_efuse_write_block()
•
esp_efuse_batch_write_begin()
•
esp_efuse_batch_write_commit()
batch writing mode.
•
esp_efuse_batch_write_cancel()
•
esp_efuse_get_key_dis_read()
•
esp_efuse_set_key_dis_read()
•
esp_efuse_get_key_dis_write()
•
esp_efuse_set_key_dis_write()
•
esp_efuse_get_key_purpose()
•
esp_efuse_write_key()
•
esp_efuse_write_keys()
•
esp_efuse_find_purpose()
•
esp_efuse_get_keypurpose_dis_write()
for an eFuse key block (for esp32 always true).
•
esp_efuse_key_block_unused()
For frequently used fields, special functions are made, like this esp_efuse_get_chip_ver(),
esp_efuse_get_pkg_ver().
eFuse API for keys
EFUSE_BLK_KEY0 - EFUSE_BLK_KEY5 are intended to keep up to 6 keys with a length of 256-bits. Each
key has an ESP_EFUSE_KEY_PURPOSE_x field which defines the purpose of these keys. The purpose field is
described in esp_efuse_purpose_t.
The purposes like ESP_EFUSE_KEY_PURPOSE_XTS_AES_... are used for flash encryption.
The purposes like ESP_EFUSE_KEY_PURPOSE_SECURE_BOOT_DIGEST... are used for secure boot.
There are some eFuse APIs useful to work with states of keys.
•
esp_efuse_get_purpose_field()
•
esp_efuse_get_key()
Espressif Systems
esp_efuse_batch_write_begin()
function. It burns prepared data to the eFuse blocks and disables the
- returns an array of read eFuse bits.
- returns the number of bits programmed as "1".
- writes an array.
- writes a required count of bits as "1".
- returns the number of bits by the field name.
- returns value of eFuse register.
- writes value to eFuse register.
- returns eFuse coding scheme for blocks.
- reads key to eFuse block starting at the offset and the required size.
- writes key to eFuse block starting at the offset and the required size.
- set the batch mode of writing fields.
- writes all prepared data for batch writing mode and reset the
- reset the batch writing mode and prepared data.
- Returns a read protection for the key block.
- Sets a read protection for the key block.
- Returns a write protection for the key block.
- Sets a write protection for the key block.
- Returns the current purpose set for an eFuse key block.
- Programs a block of key data to an eFuse block
- Programs keys to unused eFuse blocks
- Finds a key block with the particular purpose set.
- Returns a write protection of the key purpose field
- Returns true if the key block is unused, false otherwise.
- Returns a pointer to a key purpose for an eFuse key block.
- Returns a pointer to a key block.
808
Submit Document Feedback
function then write
At the end to burn them, call the
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?