Serial Bootload - Chip Detection - Documentation

a2800276
Posts: 78
Joined: Sat Jan 23, 2016 1:59 pm

Serial Bootload - Chip Detection - Documentation

Postby a2800276 » Thu Mar 10, 2022 9:12 am

I'm playing around a bit with serial communication with the bootloader and I'm wondering whether I'm missing a crucial bit of documentation, specifically where the CHIP_DETECT register is described ...

After connecting to the bootloader, esptool (and others) read register 0x40001000 (named CHIP_DETECT_MAGIC_REG_ADDR in esptool.py) to determine which chip they've connected to.

Each chip contains a different identifier:

Code: Select all

8266 :  0xfff0c101
ESP32: 0x00f01d83
S2   : 0x000007c6
S3   : 0x9
C3   : 0x6921506f, 0x1b31506f
C2   : 0x6f51306f
I'm having some difficulty finding where these values are documented? So far the most definitive documentation I've found is the esptool.py source: CHIP_DETECT_MAGIC_REG_ADDR and CHIP_DETECT_MAGIC_VALUE

I've search through the ESP32 and 8266 Technical Reference and Datasheets and have come up empty (or more likely overlooked something) Since I've been able to scrounge together most of the other register locations, fuses, etc. I'm hoping that I've missed some magical document that would make my live easy :)

Or am I correct that the CHIP DETECT register and MAGIC values are not documented outside of source code?

ESP_Sprite
Posts: 9607
Joined: Thu Nov 26, 2015 4:08 am

Re: Serial Bootload - Chip Detection - Documentation

Postby ESP_Sprite » Thu Mar 10, 2022 9:24 am

It's a location that falls somewhere in the ROM of those chips. It points to a random set of 4 bytes of code that simply happens to be different for each of the chips.

a2800276
Posts: 78
Joined: Sat Jan 23, 2016 1:59 pm

Re: Serial Bootload - Chip Detection - Documentation

Postby a2800276 » Thu Mar 10, 2022 10:42 am

ESP_Sprite wrote:
Thu Mar 10, 2022 9:24 am
It's a location that falls somewhere in the ROM of those chips. It points to a random set of 4 bytes of code that simply happens to be different for each of the chips.
Fantastic! :lol: That never occured to me! D'oh. Very simple and pragmatic solution... Thanks, you made my day!

Who is online

Users browsing this forum: No registered users and 61 guests