0

I have a simple initialization of my Arduino sketch, which I compile and run from PlatformIO on Esp32.

void setup() {
    Serial.flush();
    Serial.begin(921600);
    Serial.println();
    Serial.println("Started");
}

the problem is that when I press "Upload and Monitor", I get a lot of garbage in the output, of which I cannot find the origin.

COM port garbage output

Note that "Started" properly shows, as I would expect, because the baud rate of the terminal and Serial are both set to 921600. I tried various baud rates, but all with the same result. Any ideas where this is coming from?

0

3 Answers 3

2

I have similar issue with an ESP32 board from AI Thinker. The issue is caused by the EN pin which has startup issue.

By adding a capacitor of 0.1µF or lager between EN and GND pin, it fixes cold start issue and also make the garbage from serial output disappear completely.

Boards from Espressif do not have any of these issues.

Sign up to request clarification or add additional context in comments.

Comments

1

Had the same issue and solved mine by setting up a few things.

In setup I start/clear the Serial connection. I'm also explicit about using SERIAL_8N1.

void setup() {
  Serial.begin(115200, SERIAL_8N1);
  Serial.end();
  Serial.begin(115200, SERIAL_8N1);
}

The only speed that works consistently is 115200 for me. I thought that slower speeds would work more consistently but 9600, 19200 and others still have this issue. I'm assuming it's some sort of internal ESP32 interference but not really sure.

In platformio.ini make sure to set the corresponding speed.

[env]
monitor_speed = 115200

Comments

0

That's output from the bootloader which uses 115200 baud. Just ignore it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.