Win 10 programs don't receive data from the virtual serial port

Hi,

I have a Nano 33BLE sense, and I've encountered some issues with it's USB virtual serial port: Many Windows 10 programs can't receive data from it. (Linux programs work fine, though).

To test what's going on, I wrote a simple test sketch:

/* Arduino Nano 33 BLE USB serial port test sketch.
 * The builtin yellow LED incdicates that the main loop is running 
 * The builtin red LED indicates that serial data is sent out
 * If working properly, both the red and yellow LEDs should blink about every second. 
 * When only the yellow LED blinks, no serial data is sent.
 * When no LED blinks, the serial port could not be initialized, and the main loop doesn't run.
 */

int LEDY = LED_BUILTIN;        // builtin LED is yellow

void setup() {
  pinMode(LEDY, OUTPUT);       // define pin for yellow LED as output
  pinMode(LEDR, OUTPUT);       // define pin for red LED as output
  digitalWrite(LEDR, HIGH);    // Switch off red LED (LED is low active)
           // start serial port at 9600 baud
  while (!Serial) Serial.begin(9600);              // wait until port is ready
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(LEDY, HIGH);   // yellow LED on (loop activity LED)
  
  if (Serial) {               // check if serial port is ready
    digitalWrite(LEDR, LOW);  // turn red LED on (TX indicator)
    Serial.println("Hi!");    // send string
    delay(200);               // wait some time for better visibility of LED
    digitalWrite(LEDR, HIGH); // turn red LED off (TX indicator)
  }
  
  delay(200);                 // wait some time for better visibility of LED
  digitalWrite(LEDY, LOW);    // yellow LED on (loop activity LED)
  delay(1000);                // delay until next loop
}

When opening the port with the Arduino serial monitor, everything works fine, both LEDs blink, and serial data is received. Putty on Windows 10 also works.

But: Every other Windows program that I've tested so far doesn't. I've tested several serial terminals and serial data visualizers, including StampPlot, SerialComInstruments, etc., and they all show the same symptoms: They can open the port, but no data is received. When the board is freshly started, no LED blinks, so the serial port isn't even initialized, and the main loop doesn't run. When the port was opened before with the Arduino IDE or putty, the yellow LED is blinking, but the red one stays off, indicating that the board can't send data.

Does anybody know what's going on here?

Thanks Uhrheber

Uhrheber:  while (!Serial) Serial.begin(9600);              // wait until port is ready

I think this could be problematic. You should only call Serial.begin() once:

 Serial.begin(9600);
  while (!Serial);              // wait until port is ready

I started with

Serial.begin(9600);
  while (!Serial);

The while (!Serial) Serial.begin(9600); 

was just an experiment, but it doesn’t make any difference.
Anyways, it’s only executed at the beginning, and as I wrote, the problem also occurs when the port was opened with the Arduino serial monitor at first, and then with a Windows 10 program.
The setup() loop is long gone then, and never executed again.

What should be mentioned is, that I have several other nRF52840 boards here, including the pca10056 and pca10059 development boards from Nordic, and I never encountered a problem like this, so I think it may have something todo with Arduino's (resp. mBed's) USB CDC ACM implementation.

This problem still persists. I have the same problem.

I need to log the data with timestamp AND send data.

Sadly the Arduino Terminal has no logging option!

But Terminal from br@y is not working !! Neither is HTerm. Nor Termite. Nor Eltima.

Realtearm is the only one that works but configuration is not saved and sending a little uncomfortable (sending does not empty input)

I had the same issue Look at the terminal options related to: RTS /CTS DSR /DTR Nano BLE USB serial expects the other end reports READY state.