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
Using ESP logging with Adafruit ESP32-S2 Feather
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- bobbertolino
- Posts: 8
- Joined: Thu Dec 01, 2022 1:16 pm
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Using ESP logging with Adafruit ESP32-S2 Feather
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.
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")
- bobbertolino
- Posts: 8
- Joined: Thu Dec 01, 2022 1:16 pm
Re: Using ESP logging with Adafruit ESP32-S2 Feather
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.
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.
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Using ESP logging with Adafruit ESP32-S2 Feather
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
https://github.com/espressif/arduino-esp32/issues
- bobbertolino
- Posts: 8
- Joined: Thu Dec 01, 2022 1:16 pm
Re: Using ESP logging with Adafruit ESP32-S2 Feather
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.
Although the output isn't flushed on each write, the logging does effectively work.
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Using ESP logging with Adafruit ESP32-S2 Feather
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.
Please be positive and constructive with your questions and comments.