Page 1 of 1

ESP32C6 burning fuses

Posted: Wed Jan 24, 2024 2:56 pm
by stefano664
Hi all,
I need to read and write fuses directly from the application, but I have some issue.

The couple of functions esp_efuse_read_block/esp_efuse_write_block works fine for BLOCK4/BLOCK5/BLOCK6 but if I try on BLOCK0 it returns everytime ESP_ERR_INVALID_ARG. Someone can help me?

Inside the functions, for example in esp_efuse_api.c@211 there is a control that returns this error everytime if the block is BLOCK0.

Code: Select all

esp_err_t esp_efuse_read_block(esp_efuse_block_t blk, void* dst_key, size_t offset_in_bits, size_t size_bits)
{
    esp_err_t err = ESP_OK;
    if (blk == EFUSE_BLK0 || blk >= EFUSE_BLK_MAX || dst_key == NULL || size_bits == 0) {
        err = ESP_ERR_INVALID_ARG;
    } else {
        const esp_efuse_desc_t field_desc[] = {
            {blk, offset_in_bits, size_bits},
        };

        const esp_efuse_desc_t* field[] = {
            &field_desc[0],
            NULL
        };
        err = esp_efuse_read_field_blob(field, dst_key, size_bits);
    }
    return err;
}
Why? On the documentation I cannot find any indication that forbit these actions.

Thanks a lot,
Stefano

Re: ESP32C6 burning fuses

Posted: Wed Jan 24, 2024 5:55 pm
by joseMiguel
Hello,

Perhaps you need to be in a privileged mode or something like that (Machine mode, ...).

Hope it will help you

José Michel