ESP32 same MAC Address for 500 units

nucleon
Posts: 3
Joined: Wed Oct 28, 2020 7:11 am

ESP32 same MAC Address for 500 units

Postby nucleon » Wed Oct 28, 2020 7:21 am

Hello,

We purchased 400-500 units of (ESP32-WROOM-32D) from the parts distributor Mouser and when reading the efuse containing the MAC it seems that they are all the same. Is this a normal case scenario or should it these fuses be burned unique?

Thank you,

nucleon

ESP_Angus
Posts: 2227
Joined: Sun May 08, 2016 4:11 am

Re: ESP32 same MAC Address for 500 units

Postby ESP_Angus » Wed Oct 28, 2020 8:47 am

Hi nucleon,

Thanks for letting us know about this. The MAC addresses should be unique.

Could you give an example of how you're reading the MAC and what the value you read is, please?

Angus

nucleon
Posts: 3
Joined: Wed Oct 28, 2020 7:11 am

Re: ESP32 same MAC Address for 500 units

Postby nucleon » Wed Oct 28, 2020 9:10 am

Hello,

I am using <soc/efuse_reg.h>

Code: Select all

uint32_t mac = REG_GET_FIELD(EFUSE_BLK0_RDATA2_REG, EFUSE_RD_WIFI_MAC_CRC_HIGH);

printf("0x%X", mac);

0xBF8CAA
Thank you,

nucleon

ESP_Angus
Posts: 2227
Joined: Sun May 08, 2016 4:11 am

Re: ESP32 same MAC Address for 500 units

Postby ESP_Angus » Wed Oct 28, 2020 11:26 am

Hi nucleon,

The high bytes (first bytes) of the 6 byte MAC will be the same for devices from the same batch. They will likely all share the same OUI (organizational identifier) at minimum. I think in the case of the MAC you have the OUI will be 8C-AA-B5 (the B5 is one of the lower 4 bytes so not shown in your output, the other byte in your output is the MAC CRC).

If you also read the lower 4 bytes of the MAC (register EFUSE_BLK0_RDATA1_REG, field EFUSE_RD_WIFI_MAC_CRC_LOW) then you should find the total address is unique.

ESP-IDF also has an API to read the MAC as a byte array, esp_read_mac(). (Each interface in the ESP32 has a unique sequential MAC and the eFuse holds the base MAC, the exact algorithm is described here).

esptool also prints the MAC when it connects to the device to flash it or for another purpose, so you can cross-reference this value for an easy check of the MAC.

nucleon
Posts: 3
Joined: Wed Oct 28, 2020 7:11 am

Re: ESP32 same MAC Address for 500 units

Postby nucleon » Wed Oct 28, 2020 2:53 pm

Thank you

Who is online

Users browsing this forum: No registered users and 15 guests