How to Visually Tell New from Old Silicon?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: How to Visually Tell New from Old Silicon?

Postby ESP_igrr » Tue Apr 25, 2017 11:28 am

The getChipRevision function in Arduino has a bug, by the way, as it has "&& EFUSE_RD_CHIP_VER_RESERVE_V" instead of "& EFUSE_RD_CHIP_VER_RESERVE_V". Also, the 8-bit EFUSE_RD_CHIP_VER_RESERVE field is used to encode a bunch of different things.
Lower 3 bits encode the package (0 = D0WDQ6, 1 = D0WDQ5, 2 = D2WDQ5), next 4 bits are reserved, the MSB is used for silicon version (0 = rev0, 1 = rev1).
We will have a function to check the chip revision/package in IDF soon and the updated efuse_reg.h file with these bit fields.

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: How to Visually Tell New from Old Silicon?

Postby rudi ;-) » Tue Apr 25, 2017 11:34 am

Ah, thank you Ivan,
now we get some more "new" details
we can test if the parcel delivery earliest next week ;) ....

best wishes
rudi ;-)

btw "new" details:
Who always keeps such information back to the end,
The silicon vallery, the manufacturer, the developer, the "discoverer" .....

love this "Salami tactics" :mrgreen:
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

ikerbelloso
Posts: 20
Joined: Wed Jul 27, 2016 7:34 am

Re: How to Visually Tell New from Old Silicon?

Postby ikerbelloso » Tue Apr 25, 2017 11:40 am

Thank you to both

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: How to Visually Tell New from Old Silicon?

Postby BuddyCasino » Tue Apr 25, 2017 12:08 pm

Saw that piece of code being used in a driver, so I guess they are confident the method itself (which is similar to what rudi posted) works:

Code: Select all

uint32_t is_rev0 = (GET_PERI_REG_BITS2(EFUSE_BLK0_RDATA3_REG, 1, 15) == 0);
Source: https://github.com/espressif/esp-idf/bl ... clk.c#L133

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: How to Visually Tell New from Old Silicon?

Postby rudi ;-) » Tue Apr 25, 2017 4:22 pm

ESP_igrr wrote:
The getChipRevision function in Arduino has a bug, by the way, as it has "&& EFUSE_RD_CHIP_VER_RESERVE_V" instead of "& EFUSE_RD_CHIP_VER_RESERVE_V". ....
btw: LoL

https://github.com/espressif/arduino-es ... p.cpp#L120

Code: Select all

uint8_t EspClass::getChipRevision(void)
{
    return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> EFUSE_RD_CHIP_VER_RESERVE_S) && EFUSE_RD_CHIP_VER_RESERVE_V;
}
https://github.com/loboris/Lua-RTOS-ESP ... /cpu.c#L98

Code: Select all

int cpu_revission() {
	return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> EFUSE_RD_CHIP_VER_RESERVE_S) && EFUSE_RD_CHIP_VER_RESERVE_V;
}
Interesting
One writes the same "error" from the other :)

More Interesting:
@Mike
the snippet code read register comes in esp-idf in past 14 days ( 2017 April 11 )
https://github.com/espressif/esp-idf/co ... b9e4abR133

the arduino got this "error" version on 2017 Feb 23 by "third party"
- added function to retrieve chip revision from eFuse
https://github.com/espressif/arduino-es ... 32/Esp.cpp

...

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

testato
Posts: 6
Joined: Sat Dec 05, 2015 9:04 pm

Re: How to Visually Tell New from Old Silicon?

Postby testato » Sat Oct 07, 2017 4:49 am

I pushed a PR
https://github.com/espressif/arduino-esp32/pull/704

May the efuse be changed ?
I mean, can a fraudolent seller change the efuse bit and so sell old rev 0 for a rev 1 ?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: How to Visually Tell New from Old Silicon?

Postby kolban » Mon Oct 16, 2017 4:12 am

Reading through exposed APIs, I seem to find an ESP-IDF API called "esp_chip_info" which now reports a variety of items include:

* model
* features
* number of cores
* revision

I believe the revision fields is the silicon revision described in this post. This is a high level API and is probably more consumable that some of the other bit twiddlings.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

pataga
Posts: 73
Joined: Sat Aug 12, 2017 5:53 am

Re: How to Visually Tell New from Old Silicon?

Postby pataga » Sun Nov 12, 2017 6:34 am

I purchased a WROOM32 module a month ago after reading some reviews from buyers that mentioned they had received a rev 1 chip.
Looking for code to check the revision, I found Arduino code on instructables (and the same in a youtube video series on the ESP32)

http://www.instructables.com/id/How-to- ... our-ESP32/

Code: Select all

int getChipRevision()
{
  return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> (EFUSE_RD_CHIP_VER_RESERVE_S)&&EFUSE_RD_CHIP_VER_RESERVE_V) ;
}
I run this and it returns a chip revision of 0. Am pissed off, but then see that the code is obviously wrong - it's using a logical && instead of a bitmask &.

RTFM right ? So I downloaded the latest TRM and in Table 64, I see that the bitfield chip_version is in bits 12:9 of register EFUSE_BLK0_RDATA3_REG

So I run my own arduino code

Code: Select all

#include "soc/efuse_reg.h"

void setup() {
  Serial.begin(115200);
  uint32_t reg =  REG_READ(EFUSE_BLK0_RDATA3_REG);
  Serial.printf("\r\nEFUSE_BLK0_RDATA3_REG = %08X\r\n", reg );

  uint8_t chipRevision = (uint8_t)((REG_READ(EFUSE_BLK0_RDATA3_REG) >> 9 ) & 0x0F);    
  Serial.printf("Chip revision = %X\r\n"  , chipRevision );
  }

void loop() {
  }
which gives me

Code: Select all

EFUSE_BLK0_RDATA3_REG = 00008000
Chip revision = 0
Still pissed off that I have a rev 0 chip. But I then find this page

https://github.com/espressif/esptool/issues/206

and on running 'python espefuse.py -p COM4 summary' I get the result

Code: Select all

CHIP_VERSION           Chip version                                      = 8 R/W (0x8)
CHIP_PACKAGE           Chip package identifier                           = 0 R/W (0x0)
which tells me (phew) that I do have a ESP32-D0WDQ6 silicon revision 1 chip.

On running espefuse.py with a WROOM32 module I purchased last year, I found that it is a revision 0 chip, and my code returns

Code: Select all

EFUSE_BLK0_RDATA3_REG = 00000000
Chip revision = 0
So i'm guessing the chip_version bitfield is bit 15:12, not 12:9

sshaikh
Posts: 1
Joined: Thu Jul 19, 2018 5:03 pm

Re: How to Visually Tell New from Old Silicon?

Postby sshaikh » Thu Jul 19, 2018 5:13 pm

For those who might be confused (like I was), here are the respective expected outputs as of 19th July 2018. Unfortunately I don't have a v0 chip to compare, but I presume the below all indicate that mine is a v1.

From instructables, after using the new shift globals:

Code: Select all

int getChipRevision()
{
  return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> (EFUSE_CHIP_VER_REV1_S)&&EFUSE_CHIP_VER_REV1_V) ;
}
result:

Code: Select all

REG_READ(EFUSE_BLK0_RDATA3_REG) 1010000000000000
EFUSE_CHIP_VER_REV1_S 1111
EFUSE_CHIP_VER_REV1_V 1

Chip Revision (official version): 1
Chip Revision from shift Opration 1
From espefuse.py:

Code: Select all

Identity fuses:
MAC                    MAC Address
  = aa:aa:aa:aa:aa:aa (CRC 23 OK) R/W
CHIP_VER_REV1          Silicon Revision 1                                = 1 R/W (0x1)
CHIP_VERSION           Reserved for future chip versions                 = 2 R/W (0x2)
CHIP_PACKAGE           Chip package identifier                           = 0 R/W (0x0)
From esptool.py chip_info:

Code: Select all

esptool.py v2.5.0
Serial port COM3
Connecting........__
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: aa:aa:aa:aa:aa:aa
Uploading stub...
Running stub...
Stub running...
Warning: ESP32 has no Chip ID. Reading MAC instead.
MAC: aa:aa:aa:aa:aa:aa
Hard resetting via RTS pin...

testato
Posts: 6
Joined: Sat Dec 05, 2015 9:04 pm

Re: How to Visually Tell New from Old Silicon?

Postby testato » Thu Oct 25, 2018 7:13 pm

kolban wrote:Reading through exposed APIs, I seem to find an ESP-IDF API called "esp_chip_info" which now reports a variety of items include:
* model
* features
* number of cores
* revision
I believe the revision fields is the silicon revision described in this post. This is a high level API and is probably more consumable that some of the other bit twiddlings.
yep, the actually merged function use this method, so now the getChipRevision() return the correct hw revision
https://github.com/espressif/arduino-esp32/pull/704

Who is online

Users browsing this forum: MicroController and 100 guests