Skip to content

Commit c3b3a1d

Browse files
committed
Update ESP.getChipModel() to support ESP32-S2
1 parent a62979d commit c3b3a1d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: cores/esp32/Esp.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,17 @@ const char * EspClass::getChipModel(void)
270270
return "Unknown";
271271
}
272272
#elif CONFIG_IDF_TARGET_ESP32S2
273-
return "ESP32-S2";
273+
uint32_t pkg_ver = REG_GET_FIELD(EFUSE_RD_MAC_SPI_SYS_3_REG, EFUSE_PKG_VERSION);
274+
switch (pkg_ver) {
275+
case 0:
276+
return "ESP32-S2";
277+
case 1:
278+
return "ESP32-S2FH16";
279+
case 2:
280+
return "ESP32-S2FH32";
281+
default:
282+
return "ESP32-S2 (Unknown)";
283+
}
274284
#elif CONFIG_IDF_TARGET_ESP32S3
275285
return "ESP32-S3";
276286
#elif CONFIG_IDF_TARGET_ESP32C3

0 commit comments

Comments
 (0)