error: 'CHIP_ESP32S2' was not declared in this scope
Posted: Thu Oct 15, 2020 3:09 pm
by Gilbert
#include <esp_system.h>
... some code ...
esp_chip_info_t chip_info[sizeof(esp_chip_info_t)]; // reserve memory for chip information
esp_chip_info(chip_info); // get the ESP chip information
esp_chip_model_t chip_Model = chip_info->model;
... some code ...
switch(chip_Model) {
case CHIP_ESP32:
json_chipInfo["Model"] = "ESP32";
break;
case CHIP_ESP32S2:
json_chipInfo["Model"] = "ESP32-S2";
break;
case CHIP_ESP32S3:
json_chipInfo["Model"] = "ESP32-S3";
break;
default:
json_chipInfo["Model"] = "Undefined";
break;
}
I have included <esp_system.h>, but the switch (chip_Model) produces a compiler error for case CHIP_ESP32S2 and case CHIP_ESP32S3. The strange thing is that the compiler is happy with the case CHIP_ESP32.
What is wrong? Is the file esp_system.h not the one published here:
https://github.com/espressif/esp-idf/bl ... p_system.h ?
Re: error: 'CHIP_ESP32S2' was not declared in this scope
Posted: Thu Oct 15, 2020 3:13 pm
by lbernstone
Are you using the esp32s2 branch? arduino-esp32 v1.0.4 uses IDF 3, which pre-dates the esp32s2.
Re: error: 'CHIP_ESP32S2' was not declared in this scope
Posted: Thu Oct 15, 2020 3:18 pm
by Gilbert
Not sure what you mean by esp32s2 branch. My chip is ESP32, Arduino is version 1.8.13, selected board is DOIT ESP32 DEVKIT V1.
But IMHO all of that shouldn't matter, should it? When I'm including esp system.h then all the definitions in that file should apply ? After all, it's just an enum value, regardless which chip I'm using.
I just checked the build files. They all refer to C:\Users\Gilbert\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/include/...
Re: error: 'CHIP_ESP32S2' was not declared in this scope
Posted: Thu Oct 15, 2020 3:39 pm
by Gilbert
OK, now I get it. My included files appear to be older than the ones published on
https://github.com/espressif/esp-idf.
I found the esp_system.h file in my cache and it only defines CHIP_ESP32. So there is nothing wrong, except for the fact that for a newcomer to ESP32 it is not obvious that the Arduino IDE doesn't always have the latest version of the ESP supporting files.
Is there an easy way to consult the documentation for version 1.0.4?