PlatformIO Community

Support for Seeeduino XIAO BLE board

Hi, I have this XIAO BLE board with nRF52 processor, and it seems that PlatformIO is not currently supporting it. I tried to follow the instructions of the following link https://medium.com/@alwint3r/working-with-seeed-xiao-ble-sense-and-platformio-ide-5c4da3ab42a3
to add XIAO BLE but after adding the following line to platform.py in .platformio/platforms/nordicnrf52 directory:
if board in (“nano33ble”, “nicla_sense_me”,“xiaoblesense”):
I get the error when starting PlatformIO:
Could not load recent projects
Server error: {“type”:“IndentationError”,“args”:[“unindent does not match any outer indentation level”,[“C:\Users\heikk\.platformio\platforms\nordicnrf52\platform.py”,63,56," if board in (“nano33ble”, “nicla_sense_me”):\n"]],“message”:“unindent does not match any outer indentation level (platform.py, line 63)”}
What is wrong here, I am not familiar with python script ?
Would it be possible to officially add support for this BLE board in the next release of PlatformIO ?

You have not correctly indented the code with spaces like the surrounding code. If you look in the source code you see that line 63 is indented with 12 spaces to the left. That has to be conserved.

This is officially tracked in Board Request Seeedstudio XIAO BLE · Issue #142 · platformio/platform-nordicnrf52 · GitHub.

Thanks for help ( I did not know indentation matters in pyton !)
However now when I try compile and download my code I get this “File is not a zip file” message:

Building in release mode
Checking size .pio\build\xiaoblesense\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  28.7% (used 68160 bytes from 237568 bytes)
Flash: [====      ]  40.1% (used 325380 bytes from 811008 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, nrfjprog, nrfutil, sam-ba
CURRENT: upload_protocol = nrfutil
Looking for upload port...
Auto-detected: COM10
Forcing reset using 1200bps open/close on port COM10
Waiting for the new upload port...
Uploading .pio\build\xiaoblesense\firmware.hex
Traceback (most recent call last):
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\adafruit-nrfutil.py", line 12, in <module>
    cli()
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\click\core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\click\core.py", line 1062, in main    rv = self.invoke(ctx)
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\click\core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\click\core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\click\core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\nordicsemi\__main__.py", line 290, in serial
    dfu = Dfu(package, dfu_transport=serial_backend)
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\nordicsemi\dfu\dfu.py", line 66, in __init__
    self.manifest = Package.unpack_package(self.zip_file_path, self.unpacked_zip_path)
  File "C:\Users\heikk\.platformio\packages\tool-adafruit-nrfutil\site-packages\nordicsemi\dfu\package.py", line 361, in unpack_package
    with ZipFile(package_path, 'r') as pkg:
  File "C:\Users\heikk\.platformio\python3\lib\zipfile.py", line 1257, in __init__
    self._RealGetContents()
  File "C:\Users\heikk\.platformio\python3\lib\zipfile.py", line 1324, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
*** [upload] Error 1
=========================================== [FAILED] Took 8.69 seconds ===========================================The terminal process "C:\Users\heikk\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1. 

Help ?

That’s weird. Please open a CLI and execute

pio run -t dfu -v

What does it output?

strong textOutput from that command: (If this is issue is not easy to solve, I can wait until we get official support for XIAO BLE (+Sense) boards )

PS C:\Arduino\MassageXIAO> pio run -t dfu -v
Processing xiaoblesense (platform: nordicnrf52; board: xiaoblesense; framework: arduino; lib_deps: arduino-libraries/ArduinoBLE@^1.3.1, pololu/DRV8835MotorShield@^2.1.0)
------------------------------------------------------------------------------------------------------------------CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/xiaoblesense.html
PLATFORM: Nordic nRF52 (8.3.0) > Seeed XIAO BLE Sense
HARDWARE: NRF52840 64MHz, 232KB RAM, 792KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink)
PACKAGES:

  • framework-arduino-mbed @ 2.4.1
  • tool-adafruit-nrfutil @ 1.503.0 (5.3)
  • tool-sreccat @ 1.164.0 (1.64)
  • toolchain-gccarmnoneeabi @ 1.80201.190214 (8.2.1)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Framework incompatible library C:\Users\heikk.platformio\packages\framework-arduino-mbed\libraries\LittleVGL
    More details about “Library Compatibility Mode”: Redirecting...
    Found 36 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- ArduinoBLE @ 1.3.1 (License: Unknown, Path: C:\Arduino\MassageXIAO.pio\libdeps\xiaoblesense\ArduinoBLE)
    |-- DRV8835MotorShield @ 2.1.0 (License: Unknown, Path: C:\Arduino\MassageXIAO.pio\libdeps\xiaoblesense\DRV8835MotorShield)
    |-- SPI (License: Unknown, Path: C:\Users\heikk.platformio\packages\framework-arduino-mbed\libraries\SPI)
    Building in release mode
    *** Do not know how to make File target `dfu’ (C:\Arduino\MassageXIAO\dfu). Stop.
    =========================================== [FAILED] Took 1.99 seconds ===========================================

Hm I see. I’ll test this personally and adapt as needed.

I’ve added support and created a pull request into the main PlatformIO repo.

Can you remove your

  • C:\Users\heikk\.platformio\packages\framework-arduino-mbed
  • C:\Users\heikk\.platformio\platforms\nordicnrf52

folders and use the platformio.ini in https://github.com/platformio/platform-nordicnrf52/pull/151?

Note that Git should be installed for this to work.

1 Like

Note that if you have the regular Xiao BLE nRF52840 board with no “Sense” attached (so no IMU and microphone on the board), you should use board = xiaoble instead of board = xiaoblesense.

Thanks for your help ! It works perfectly now. Tested with XIAO BLE boad download

1 Like