ESP_LOG not working on Wemos-S2-Mini but fine on S3 Devkit?

In the category of “other things I burned half a day trying to figure out on my own”… ESP_LOG messages not printing out to monitor with Wemos_S2_Mini.

Since I have been chasing my tail for several weeks trying to get ULP stuff going and have loaded all sorts of expressif stuff, I decided to do a clean reinstall of I did a clean re-install of VSC and PlatformIO. (I removed the VSC app, deleted my c:\users\myname.platformio and .vscode directories, rebooted, and reinstalled VSC using VSCodeUserSetup-x64-1.80.0.exe) I then added in my usual extensions: PlatformIO, Better C++ Syntax, C/C++, C/C++ Extension Pack (which includes: C/C++ Themes, CMake, CMake Tools), Colorful Comments, Diff Tool, indent-rainbow, and Remove Comments.

Now I am running code using the same platformio.ini I usually use and suddenly none of my ESP_LOG messages display on the monitor yet Serial.println() works fine. I am running a Wemos_S2_Mini for which everything else works fine.

So, after first writing this, I decided to try an S3-Devkit card and, with the appropriate platformio.ini, ESP_LOG messages display just fine.

Here is the test code for the Wemos_S2_Mini (which comes up as lolin_s2_mini when starting a new project and selecting the Wemos_S2_Mini. Is there something special about the S2 that I’m not finding on the internet which would keep the ESP_LOG messages from printing?

platformio.ini:

[env:lolin_s2_mini]
platform = espressif32
board = lolin_s2_mini
framework = arduino
monitor_speed = 115200
build_flags = 
	-DCORE_DEBUG_LEVEL=5

Minimal code example:

void setup()
{
  Serial.begin(115200);
  while (!Serial)
  {
  }

  delay(5000); // give me time to start the monitor
}

void loop()
{
  static const char *TAG = "loop";
  delay(1000);
  ESP_LOGD(TAG, "LogD");
  ESP_LOGE(TAG, "LogE");
  ESP_LOGI(TAG, "LogI");
  Serial.println("Just a Serial.println");
}

This displays (onlY):

Just a Serial.println
Just a Serial.println
Just a Serial.println
Just a Serial.println

Any clues? Thank you.

It could be the case that the default debug serial is different on an S2 or S3, or their build flags are different (e.g., one might do UART output to a usb-to-serial chip, the other one might be doing native USB CDC).

In any case, just like with the Arduino ESP8266 core, a HardwareSerial type object has the

function, so maybe you just need to call

Serial.setDebugOutput(true);

in setup() to make output appear there?