Skip to content

Serial USB CDC JTAG S3 crashes when end() is called twice  #8326

Closed
@SuGlider

Description

@SuGlider

Board

ESP32-S3

Device Description

Just the S3 devkit - using USB CDC/JTAG port

Hardware Configuration

None

Version

other

IDE Name

1.8.15

Operating System

Win11

Flash frequency

40MHz

PSRAM enabled

yes

Upload speed

115200

Description

When using USB JTAG/CDC as default Serial port the S3 will crash is Serial.end() is called twice.

It may also happen with 2.0.9. Crash happens with 3.0.0.

Sketch

// MUST USE USB Mode "CDC/JTAG" and "CDC on Boot: Enabled"
void setup() {
  Serial.begin();
  delay(500);
  Serial.println("First Print Testing");
  Serial.flush();
  
  Serial.end();
  Serial.end();  // Second end() causes crash.

  Serial.begin();
  delay(500);
  Serial.println("Second Print Testing");
  Serial.flush();
}

void loop() {
}

Debug Message

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403798c2
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3818,len:0x498
load:0x403c9700,len:0x4
load:0x403c9704,len:0xad0
load:0x403cc700,len:0x2a84
entry 0x403c9880
First Print Testing

assert failed: xQueueGenericCreate queue.c:430 (uxQueueLength > ( UBaseType_t ) 0)


Backtrace: 0x403779aa:0x3fca0300 0x4037b701:0x3fca0320 0x4038129d:0x3fca0340 0x4037b95f:0x3fca0470 0x42002ed2:0x3fca0490 0x42002f2d:0x3fca04b0 0x42001b77:0x3fca04d0 0x420033aa:0x3fca04f0 0x4037e25e:0x3fca0510

Other Steps to Reproduce

Set USB JTAG/CDC mode. Enable CDC on Boot. Run the sketch.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions