How to Check the Revision Level of Your ESP32

Introduction: How to Check the Revision Level of Your ESP32

About: Small electronic projects , tutorials, and reviews for sensors, ESP8266, Arduino, Raspberry Pi, and ESP32

Up till now, Espressif released two chip revisions: Last September Rev 0 and in February, Rev 1. And there are rumors, that Espressif sells its old revision 0 chips cheap, and some of our manufacturers make a profit by selling them to us… So, let’s check!

Step 1: Watch the Video

First watch the video inf you want the details.

The revision number is stored in an eFuse on the chip. Many other parameters are also “programmed” in these eFuse blocks.

Step 2: The Fuses...

What is a fuse in a microcontroller? Fuses are usually bits which can be set only once. This is, why sometimes people talk about “burning” fuses, not “programming” fuses. They are used to store data, which is chip-specific, but not the same for all chips. The MAC address is an example. Each chip has a different MAC address, and it keeps it till the end of life. So, during manufacturing, this address is “burned” into the fuses block.

And the warning in the ESP32 documentation is clear: You cannot undo this step! Different than with our ATTinys, where we still had a chance to undo the change with a special programmer using 12 volt programming voltage.

But today, we do not want to change a fuse, just read its content. So, no danger.

Step 3: How to Extract the Revision Number

The revision information is in EFUSE_BLK0_RDATA3_REG

at the 16th place. The proposed formula to read the information is rather complicated: We read the whole register, shift it to the right by 12 places, and OR it with the number 7. The easier solution could be to just shift it to the right by 15 places. Then, the revision bit would stand at the last digit. Maybe Espressif has a particular numbering scheme in mind for the future. Who cares. We know, how we get the information. And here it is:

Step 4: The Sketch

After testing my boards, I can confirm,

that two boards from last year were, obviously, revision 0. Most of the ones bought over the last few months were revision one. The only exception was this part purchased from Aliexpress. So, I cannot confirm, that sellers still ship cheap old versions. At least not mine. Mostly fake news!

Step 5: What Are the Differences?

See the bugs of the different versions on page 2

Be the First to Share

    Recommendations

    • Raspberry Pi Contest

      Raspberry Pi Contest
    • One Board Contest

      One Board Contest
    • Knitting and Crochet Speed Challenge

      Knitting and Crochet Speed Challenge

    14 Comments

    0
    Gilbert54
    Gilbert54

    2 days ago

    As commented by others, the chip revision number is shown when you upload the sketch. If your app depends on the chip revision number (in my case I need min rev. level 2 in order to use the embedded CAN controller for a low-speed CAN bus) you can also get the chip revision number using the esp system API function esp_chip_info(chip_info). This function and the struct esp_chip_info_t chip_info are defined in esp_system.h.

    https://github.com/husarnet/esp-idf/blob/master/co...

    /**
    * @brief The structure represents information about the chip
    */
    typedef struct {
    esp_chip_model_t model; //!< chip model, one of esp_chip_model_t
    uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags
    uint8_t cores; //!< number of CPU cores
    uint8_t revision; //!< chip revision number
    } esp_chip_info_t;

    Sample code:
    #include <esp_system.h>
    esp_chip_info_t chip_info[sizeof(esp_cesp_chip_infohip_info_t)]; // reserve memory for chip information struct
    esp_chip_info(chip_info); // get the ESP32 chip information
    esp_chip_model_t chip_Model = chip_info->model; // ESP32 chip model
    uint8_t chip_Cores = chip_info->cores; // ESP32 nr of cores
    uint8_t chip_Revision = chip_info->revision; // ESP32 revision nr
    const char * espIdfVersion = esp_get_idf_version(); // get ESP Development Framework version

    Kind regards from Belgium

    0
    BitSand
    BitSand

    Question 1 year ago

    Where is: "soc/efuse_reg.h" ?

    You kept it simple but not the above.

    Thanks for the work.

    Anthony

    Edit: Please ignore, I figured it out.
    Thanks.


    0
    Andreas Spiess
    Andreas Spiess

    Reply 5 months ago

    It got even easier: The Arduino IDE shows the chip and its revision every time when you upload a sketch.

    0
    gabrielfaber
    gabrielfaber

    5 months ago

    I tried to compile this (Arduino 1.8.13 with 'Board Manager: https://raw.githubusercontent.com/espressif/arduin... and I got errors:
    H:\projects\arduino\ESP32_version\ESP32_version.ino: In function 'int getChipRevision()':
    ESP32_version:12:47: error: 'EFUSE_RD_CHIP_VER_RESERVE_S' was not declared in this scope
    return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> (EFUSE_RD_CHIP_VER_RESERVE_S)&&EFUSE_RD_CHIP_VER_RESERVE_V) ;
    ESP32_version:12:77: error: 'EFUSE_RD_CHIP_VER_RESERVE_V' was not declared in this scope
    return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> (EFUSE_RD_CHIP_VER_RESERVE_S)&&EFUSE_RD_CHIP_VER_RESERVE_V) ;
    Checking the library source, I found the names have changed:
    EFUSE_RD_CHIP_VER_REV1_V
    and
    EFUSE_RD_CHIP_VER_REV1_S

    Now it works:
    REG_READ(EFUSE_BLK0_RDATA3_REG) 1010000000000000
    EFUSE_RD_CHIP_VER_REV1_S 1111
    EFUSE_RD_CHIP_VER_REV1_V 1

    Chip Revision (official version): 1
    Chip Revision from shift Operation 1 (<- had typo, fixed)

    0
    Andreas Spiess
    Andreas Spiess

    Reply 5 months ago

    Thanks for the info. You do no more need this script. It shows the chip and its revision when you upload a sketch with the Arduino IDE

    0
    jcasalotti
    jcasalotti

    1 year ago

    Many thanks Andreas!
    This is an "old" post, and as pointed out by razibu, Arduino IDE now provides the info when uploading every sketch.
    But I'm the kind of guy who likes to better understand the "details", so every chunk of info is valuable.
    And your posts and videos are really nice, clear, and concise.
    Thanks, Guy with the Swiss Accent!

    0
    razibu
    razibu

    3 years ago

    Things are getting simpler: The Arduino IDE 1.85 together with esp32 board is giving now the revision when uploading every sketch.

    0
    Rudy Trujillo
    Rudy Trujillo

    4 years ago

    What does this mean?

    C:\Users\me\Downloads\ESP32_Version\ESP32_Version.ino:8:27: fatal error: soc/efuse_reg.h: No such file or directory

    #include "soc/efuse_reg.h"

    ^

    compilation terminated.

    exit status 1

    Error compiling for board Generic ESP8266 Module.

    0
    ssinst
    ssinst

    Reply 3 years ago

    I also need the answer to this. It seems there is a step missing to set up library paths?

    0
    mjrovai
    mjrovai

    4 years ago

    Thanks, Andreas. I wrote a couple of Instructables using a Doit Dev Kit bought at Aliexpress few weeks ago and I confirmed that in my case was version 0. I do not find problems on this version at least with what I have tested so far. I read the document with the bugs and see that I could have problems on some specific tasks.

    0
    Andreas Spiess
    Andreas Spiess

    Reply 4 years ago

    The only one I can think of is that the chip does not restart if it had a brownout (low voltage condition)

    0
    mjrovai
    mjrovai

    Reply 4 years ago

    Thanks a lot, Andreas.

    0
    tytower
    tytower

    4 years ago

    Interesting . Thanks for posting this