Skip to content

PlatformIO flash causes XIAO nRF52840 to disconnect after upload (doesn’t reconnect to normal port) #4

@YumTaha

Description

@YumTaha

I’m using the Seeed XIAO nRF52840 (non-Sense model) and encountering an issue when flashing via PlatformIO. After uploading code, the board doesn’t reconnect to the normal serial port automatically. Instead, it disconnects and is only accessible again if I manually enter bootloader mode.

🔧 Setup:

platformio.ini

[env:seeed_xiao_nrf52840]
platform = https://github.com/Seeed-Studio/platform-seeedboards.git
board = seeed-xiao-afruitnrf52-nrf52840
framework = arduino
lib_archive = no

main.cpp

#include <Arduino.h>

void setup() {
}

void loop() {
    // Do nothing
}

⚙️ Behavior:

  • Arduino IDE: Flashing works as expected. The board switches from normal mode → bootloader → back to normal mode (CDC serial).

  • PlatformIO: Flashing causes the board to switch to bootloader mode, flash successfully, but then it does not reconnect to the normal serial port. The board appears disconnected.

The only way to reconnect is to double-tap the reset button to manually enter bootloader mode again.

✅ Expected:

After flashing in PlatformIO, the board should reset and reconnect to the normal mode port just like it does with the Arduino IDE.

🧪 Additional Notes:

This behavior happens even with a minimal sketch (empty setup() and loop()).

I’m using the Adafruit BSP and bootloader, as recommended.

This makes iterative development difficult without manually resetting after every upload.

Is there a workaround or fix for this behavior in PlatformIO?

Thanks!

Here are 2 videos from Arduino and PlatformIO:

Arduino:

20250516-1245-31.4648269.mp4

PlatformIO:

20250516-1246-47.2490848.mp4

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions