nRF52840 Feather Express, USB serial strange behavior

Hello,
I’m having a problem with a Adafruit nRF52840 Feather Express. Sometimes the serial transmission doesn’t seem to work when I run this simple code:

#include <bluefruit.h>
void setup()
{
  Serial.begin(115200);
  while ( !Serial ) delay(10);   // wait for native usb

  Serial.print("Hello world");
}

void loop {}

9 times out of 10, the serial terminal does not display anything, and somethimes it works. When I put the Serial.prinln() in the loop with a delay. The serial message is displayed but the delay is in the middle of the message.

For example: Hel [delay] lo world Hello [delay] world H [delay] ello world

What I tried:

  • Change the “Reopen Serial Monitor Delay” setting
  • Change the baudrate of the bus

Does anyone have any idea where the problem might come from?

Thanks

No line ending my be troublesome. Does the problem appear with Serial.println() as well? Does delaying a little bit after the while loop is exited help? Does a Serial.flush(); call after the print help?

Yes it changes nothing.

Oh yeah great, it resolve the problem of the cutted messages :+1:

No it doesn’t chage anything.

But I believe I found the solution ! The opening of a new Serial Monitor doesn’t reset the nRF52840. Only the switch on the board can reset the uC. If I press the reset button and then open a new Serial monitor it works ! :slight_smile:

Edit: false alarm
it seemed to work but no, the problem with the serial monitor is always there :frowning: