Re: working with efuses
Posted: Thu Jul 25, 2019 5:48 am
Hi mzimmers!
1. Your ESP_FUSE3 fuse3 is:
struct ESP_FUSE3 {
uint8_t crc;
uint8_t macAddr[6];
uint8_t reserved[8];
uint8_t version;
};
This structure is 8+8*6+8+8 = 72 bits. But in your code you do `rc = esp_efuse_read_block(EFUSE_BLK3, &fuse3, 0, 192);`. You have to use your real size of fuse3.
The right way is esp_efuse_read_block(EFUSE_BLK3, &fuse3, 0, sizeof(fuse3);
2. Please see the efuse table here: https://github.com/espressif/esp-idf/bl ... sv#L25-L27
Your ESP_FUSE3 does not fit this table.
You can read by one of these fields, look as an example: https://github.com/espressif/esp-idf/bl ... .c#L79-L98
3. The fuse3.version is wrong. It was read from the wrong offset.
Your struct must look as :
struct ESP_FUSE3 {
uint8_t crc; // , 0, 8, CRC8 for custom MAC address.
uint8_t macAddr[6]; // 8, 48, Custom MAC
uint8_t reserved[16]; <------------------------------------------------- increased
uint8_t version; //184, 8, Custom MAC version
};
4. Your ESP32 already has programmed the CUSTOM_MAC: `efuse BLK3 MAC field is programmed as 00:a0:d0:00:00:00.`
You can write a new CUSTOM MAC address only once.
5. Run command to see all efuse fields:
./../esp-idf/components/esptool_py/esptool/espefuse.py summary
./../esp-idf/components/esptool_py/esptool/espefuse.py dump
1. Your ESP_FUSE3 fuse3 is:
struct ESP_FUSE3 {
uint8_t crc;
uint8_t macAddr[6];
uint8_t reserved[8];
uint8_t version;
};
This structure is 8+8*6+8+8 = 72 bits. But in your code you do `rc = esp_efuse_read_block(EFUSE_BLK3, &fuse3, 0, 192);`. You have to use your real size of fuse3.
The right way is esp_efuse_read_block(EFUSE_BLK3, &fuse3, 0, sizeof(fuse3);
2. Please see the efuse table here: https://github.com/espressif/esp-idf/bl ... sv#L25-L27
Your ESP_FUSE3 does not fit this table.
You can read by one of these fields, look as an example: https://github.com/espressif/esp-idf/bl ... .c#L79-L98
3. The fuse3.version is wrong. It was read from the wrong offset.
Your struct must look as :
struct ESP_FUSE3 {
uint8_t crc; // , 0, 8, CRC8 for custom MAC address.
uint8_t macAddr[6]; // 8, 48, Custom MAC
uint8_t reserved[16]; <------------------------------------------------- increased
uint8_t version; //184, 8, Custom MAC version
};
4. Your ESP32 already has programmed the CUSTOM_MAC: `efuse BLK3 MAC field is programmed as 00:a0:d0:00:00:00.`
You can write a new CUSTOM MAC address only once.
5. Run command to see all efuse fields:
./../esp-idf/components/esptool_py/esptool/espefuse.py summary
./../esp-idf/components/esptool_py/esptool/espefuse.py dump