Hi everyone,
I’m trying to use SeeedStudio XIAO-nRF52840 Sense with platformIO framework.
I’ve setup the project successfully using this instruction, but now I’m running into a pretty problematic issue.
Every time when I’m changing the code, after uploading it to the board it unplugs and then requires a reset (via double-click on the button on the board).
This essentially means that I cannot communicate over the serial port, since after flashing the port closes and I need to reset it every time to continue working.
I’m using a macOS 13.4.1 with 2,2 GHz 6-Core Intel Core i7 and a USB-C to USB-C connector from Amazon (this one).
I also have the XIAO-nRF52840 (without Sense capabilities), and it pretty much runs into the same issue.
Some other clues that I have (step-by-step):
- hard-resetting the device and then connecting it to the USB-C - the port becomes visible:
> ls -la /dev/{tty,cu}.*
/dev/cu.usbmodem14101
/dev/tty.usbmodem14101
-
Also, the device is visible as a disk
-
After flashing (platformIO → build), the port closes, and the disk ejects:
> ls -la /dev/{tty,cu}.*
# no output
- The disk also ejects after flashing.
The upload log from platformIO:
* Executing task: platformio run --target upload --upload-port /dev/cu.usbmodem14101
Processing adafruit_feather_nrf52840 (platform: nordicnrf52; board: xiao_ble_sense; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/xiao_ble_sense.html
PLATFORM: Nordic nRF52 (9.6.0) > Seeed Xiao BLE Sense
HARDWARE: NRF52840 64MHz, 243KB RAM, 796KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES:
- framework-arduinoadafruitnrf52 @ 1.10300.0 (1.3.0)
- framework-cmsis @ 2.50700.210515 (5.7.0)
- tool-adafruit-nrfutil @ 1.503.0 (5.3)
- tool-bossac-nordicnrf52 @ 1.10901.201022 (1.9.1)
- tool-openocd @ 2.1100.211028 (11.0)
- tool-sreccat @ 1.164.0 (1.64)
- toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 14 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/adafruit_feather_nrf52840/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 1.2% (used 3084 bytes from 248832 bytes)
Flash: [ ] 2.6% (used 21036 bytes from 815104 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, nrfjprog, nrfutil, stlink
CURRENT: upload_protocol = nrfutil
Looking for upload port...
Using manually specified: /dev/cu.usbmodem14101
Forcing reset using 1200bps open/close on port /dev/cu.usbmodem14101
Waiting for the new upload port...
Uploading .pio/build/adafruit_feather_nrf52840/firmware.zip
Upgrading target on /dev/cu.usbmodem14101 with DFU package /Users/renarde/Documents/PlatformIO/Projects/sample_nrf52840/.pio/build/adafruit_feather_nrf52840/firmware.zip. Flow control is disabled, Single bank, Touch disabled
########################################
##
Activating new firmware
Device programmed.
==================================================== [SUCCESS] Took 9.35 seconds ====================================================
* Terminal will be reused by tasks, press any key to close it.
Would be nice to get some clear guidance on whenever this is expected behaviour, or if something is misconfigured.