Skip to content

ESP.getChipModel() and ESP.getChipCores() #3847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Read efuse for chipmodel
  • Loading branch information
Martijn Scheepers authored and Martijn Scheepers committed Mar 26, 2020
commit 4aabaa61db062d24a0f8f1ff7ce637586dfe1452
22 changes: 11 additions & 11 deletions cores/esp32/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,18 @@ uint8_t EspClass::getChipRevision(void)

const char * EspClass::getChipModel(void)
{
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
switch (chip_info.model) {
case 0:
return "ESP32D0WDQ6";
case 1:
return "ESP32D0WDQ5";
case 2:
return "ESP32D2WDQ5";
case 4:
uint32_t chip_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
uint32_t pkg_ver = chip_ver & 0x7;
switch (pkg_ver) {
case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ6 :
return "ESP32-D0WDQ6";
case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ5 :
return "ESP32-D0WDQ5";
case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5 :
return "ESP32-D2WDQ5";
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2 :
return "ESP32-PICO-D2";
case 5:
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4 :
return "ESP32-PICO-D4";
default:
return "Unknown";
Expand Down