Skip to content

CDC Serial send blocks when host closes connection #6

@NicoHood

Description

@NicoHood

Hi,
I'd also like to point to the following issue, as it also applies to Arduino:
abcminiuser/lufa#106

I've already posted fixes for the LUFA core, something similar ca be implemented for Arduino. The main question for me is, if this behavior can be reproduced with other linux kernels or mac/windows. I currently have no other OS available, so someone else could maybe test the posted code.

Steps to reproduce:

  • Upload the code
  • Open Serial Monitor
  • Close it
  • Check if Led still blinks every 1s
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
  //Serial.print("testegorogkrhtrhkhprtkpj\n"); <-- This works fine
  for(uint8_t i = 0; i<100;i++){
      Serial.write('a');  // <- This also crashes
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions