3

I'm new to micro-controllers. I've got an ESP32-S3-DevKitC-1 and I'm trying to do a simple hello world with the Serial. I'm using the Arduino IDE for flashing and serial monitoring. My code is:

/**
 * As simple as it gets, right? Setup the Serial, wait on it. The periodically print during the loop.
 */
void setup() {
  Serial.begin(9600);   // Initialize serial communications with the PC
  while (!Serial);      
}

void loop() {
  Serial.println("Hello World");
  delay(1000);
}

I've tried various baud rates. I've also tried a few different configurations for flashing-- this includes flashing over the UART port with upload mode 'UART0/Hardware CDC' and 'USB-OTG CDC (TinyUSB)'. I'm basically at guess and check right now and am looking for some tips or resources to understand the ports. My serial always shows gibberish. I've even tried miniterm like this:

pyserial-miniterm /dev/cu.usbserial-1410 9600

Spina
  • 129
  • 3
  • 1
    How do you install the Arduino-ESP32 core on your IDE? Arduino-ESP32 is still only support the ESP32-S3 on "development" release only, if you installed the ESP32-S3 with the "stable" release, it won't work with ESP32-S3 yet. See the [installing](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html). – hcheung Apr 28 '22 at 03:58

1 Answers1

3

The USB port connects directly to the D+/D- pins of the ESP32, which allows it to act as a USB host. CircuitPython, for instance, uses this functionality to look like a USB flash drive. You could also write software that might have the ESP32 mimic a keyboard or mouse or other simple USB devices over this port. You generally will not use it to program the board, though CircuitPython does install its own firmware updates from files written to the USB flash drive its boot loader presents.

The UART port connects to a USB/serial chip which is connected to the RX and TX pins of the ESP32. If you want to flash firmware to the board in a traditional way (using esptool.py) you'd use this connector. You may need to press the BOOT button to get the device into firmware download mode.

The ESP32 defaults to 115200 baud, which is why you'd see gibberish at 9600 baud - that would be the boot loader messages.

You'll need to ensure that the firmware you're trying to flash to it is built for the correct model CPU and also for the amount of PSRAM on your board. I would stick with 115200 baud for the serial speed so that you'll be able to see the boot loader messages as well as any output of your program, if it's correctly built and flashed to the board. [edit: as @hcheung pointed out there is no official stable support for the S3 in the Arduino Core at the time this question was asked]

You can learn more about your device by reading the official Espressif documentation on it.

romkey
  • 1,394
  • 6
  • 10