Skip to content

Cannot print to serial1 on ESP32-S2 #5651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
calcut opened this issue Sep 9, 2021 · 1 comment
Closed

Cannot print to serial1 on ESP32-S2 #5651

calcut opened this issue Sep 9, 2021 · 1 comment

Comments

@calcut
Copy link

calcut commented Sep 9, 2021

Hardware:

Board: Adafruit ESP32-S2 Metro
Core Installation version: 2.0.0
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: yes
Upload Speed: 921600
Computer OS: MacOS

Description:

I'd like to be able to read debug/print messages from a hardware serial port (not USB).
I have connected a serial cable to the 'debug' serial port on the board. (RXD0 and TXD0 pins on the module)
https://www.adafruit.com/product/954

I can see that the connections are OK because messages are printed on every reset, but I haven't been able to print to it in the code. Am I missing something obvious?
This may be a similar issue to #5463

Sketch:

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop() {
  Serial.println("Serial 00");
  Serial1.println("Serial 01");
  delay(1000);
}

Debug Messages:

On serial port /dev/cu.usbmodem01
As expected I get:

12:18:51.523 -> Serial 00
...etc.

On serial port /dev/cu.SLAB_USBtoUART
I see lots of boot/debug messages, but no print messages

ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x9 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x1af8
load:0x4004c000,len:0x2170
load:0x40050000,len:0x1c08
entry 0x4004c4cc
I (46) boot: ESP-IDF v4.3-dev-1197-g8bc19ba89 2nd stage bootloader
I (46) boot: compile time 08:34:03
I (46) boot: chip revision: 0
I (50) qio_mode: Enabling default flash chip QIO
I (55) boot.esp32s2: SPI Speed      : 80MHz
I (59) boot.esp32s2: SPI Mode       : QIO
I (64) boot.esp32s2: SPI Flash Size : 4MB
I (69) boot: Enabling RNG early entropy source...
I (74) boot: Partition Table:
I (78) boot: ## Label            Usage          Type ST Offset   Length
I (85) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (93) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (100) boot:  2 ota_0            OTA app          00 10 00010000 00160000
I (108) boot:  3 ota_1            OTA app          00 11 00170000 00160000
I (115) boot:  4 uf2              factory app      00 00 002d0000 00040000
I (123) boot:  5 ffat             Unknown data     01 81 00310000 000f0000
I (130) boot: End of partition table
I (635) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x0b830 ( 47152) map
I (644) esp_image: segment 1: paddr=0x0001b858 vaddr=0x3ffbfbe0 size=0x01f24 (  7972) load
I (646) esp_image: segment 2: paddr=0x0001d784 vaddr=0x40024000 size=0x02894 ( 10388) load
I (655) esp_image: segment 3: paddr=0x00020020 vaddr=0x40080020 size=0x224b8 (140472) map
I (687) esp_image: segment 4: paddr=0x000424e0 vaddr=0x40026894 size=0x09348 ( 37704) load
I (696) esp_image: segment 5: paddr=0x0004b830 vaddr=0x50000000 size=0x00010 (    16) load
I (703) boot: Loaded app from partition at offset 0x10000
I (703) boot: Disabling RNG early entropy source...
[     0][D][esp32-hal-tinyusb.c:580] tinyusb_enable_interface(): Interface CDC enabled
[  1240][D][esp32-hal-tinyusb.c:441] tinyusb_load_enabled_interfaces(): Load Done: if_num: 2, descr_len: 75, if_mask: 0x10
[  1457][D][esp32-hal-psram.c:84] psramInit(): PSRAM enabled
@me-no-dev
Copy link
Member

Use Serial0 when USB is Serial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants