Using ESP logging with Adafruit ESP32-S2 Feather

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
bobbertolino
 
Posts: 8
Joined: Thu Dec 01, 2022 1:16 pm

Using ESP logging with Adafruit ESP32-S2 Feather

Post by bobbertolino »

Good morning,
I can't seem to get native ESP logging (e.g. log_i or ESP_LOGE) on the Adafruit ESP32-S2 Feather. This worked with other boards.
e.g.

esp_log_level_set("*", ESP_LOG_ERROR);
log_i("Hello!");
ESP_LOGE("Hello2");

Any advice?
Thank you,
Bob

User avatar
mikeysklar
 
Posts: 14165
Joined: Mon Aug 01, 2016 8:10 pm

Re: Using ESP logging with Adafruit ESP32-S2 Feather

Post by mikeysklar »

The logging library is supported with the ESP32-S2 chips.

https://github.com/espressif/arduino-esp32

Which version of the ESP arduino core do you have installed? Is it 2.0.7 the latest?

It does look as though this is a flag that needs to be included at compile time so make sure you see that in your verbose compilation output.

Code: Select all

target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE")

User avatar
bobbertolino
 
Posts: 8
Joined: Thu Dec 01, 2022 1:16 pm

Re: Using ESP logging with Adafruit ESP32-S2 Feather

Post by bobbertolino »

Hello. Thank you for the response. Yes, I'm using 2.0.7. I confess I'm building with the Arduino IDE. I did edit .\packages\esp32\hardware\esp32\2.0.7\platform.txt to include the LOG_LOCAL_LEVEL setting just to be safe; however, I the setting under Tools->"Core Debug Level" was also set to INFO.

I have no problem with Serial.print() statements. I just can't seem to get log_i() or ESP_LOGI working after setting esp_log_level_set("*", ESP_LOG_ERROR); as it does on another board I'm using.

User avatar
mikeysklar
 
Posts: 14165
Joined: Mon Aug 01, 2016 8:10 pm

Re: Using ESP logging with Adafruit ESP32-S2 Feather

Post by mikeysklar »

Since it works with another board and is supposed to be supported with the ESP32-S2 you might want to open an issue with the espressif arduino core.

https://github.com/espressif/arduino-esp32/issues

User avatar
bobbertolino
 
Posts: 8
Joined: Thu Dec 01, 2022 1:16 pm

Re: Using ESP logging with Adafruit ESP32-S2 Feather

Post by bobbertolino »

Seems Serial.setDebugOutput(true) is required. I also encountered and identified another issue that has been reported and patched. See https://github.com/espressif/arduino-esp32/pull/7284

Although the output isn't flushed on each write, the logging does effectively work.

User avatar
mikeysklar
 
Posts: 14165
Joined: Mon Aug 01, 2016 8:10 pm

Re: Using ESP logging with Adafruit ESP32-S2 Feather

Post by mikeysklar »

Oh, thank you for the setDebug flag. At least we know it can work until the flushing issue comes up. It doesn’t look like the patch code was fully accepted yet if I’m reading that issue correctly.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”