PlatformIO Community

Adafruit Clue Board

I’m trying to compile for the AdaFruit Clue but Platformio doesn’t seem to be able to find the board. Here’s my env entry:

[env:clue]
platform = nordicnrf52
board = adafruit_cluenrf52840

Error: Unknown board ID ‘adafruit_cluenrf52840’

I’m running PlatformIO, version 4.3.4 and I ran “pio update” and it says that everything (including framework-arduinonordicnrf5) is current.

The board is listed in framework-arduinoadafruitnrf52/boards.txt.

I tried it with and without the “adafruit_” prefix.

Do I need to run something to update the board database?

That’s the Arduino board definitions. PlatformIO needs JSON definitions of the boards to work with, as seen in the platform’s board list https://github.com/platformio/platform-nordicnrf52/blob/develop/boards/. The available values for board = are the file names in there (also cross-reference https://platformio.org/boards).

You can open an issue or pull-request at https://github.com/platformio/platform-nordicnrf52/issues to get the board added by the devs.

You can also directly try this board configruation. Create a new folder boards/ in your project and fill the file boards/adafruit_cluenrf52840.json with this content

{
  "build": {
    "arduino":{
      "ldscript": "nrf52840_s140_v6.ld"
    },
    "core": "nRF5",
    "cpu": "cortex-m4",
    "extra_flags": "-DARDUINO_NRF52840_CLUE -DNRF52840_XXAA -DNRF52840_CLUE",
    "f_cpu": "64000000L",
    "hwids": [
      [
        "0x239A",
        "0x8072"
      ],
      [
        "0x239A",
        "0x0072"
      ],
      [
        "0x239A",
        "0x0071"
      ],
      [
        "0x239A",
        "0x8071"
      ]
    ],
    "usb_product": "CLUE",
    "mcu": "nrf52840",
    "variant": "clue_nrf52840",
    "bsp": {
      "name": "adafruit"
    },
    "softdevice": {
      "sd_flags": "-DS140",
      "sd_name": "s140",
      "sd_version": "6.1.1",
      "sd_fwid": "0x00B6"
    },
    "bootloader": {
      "settings_addr": "0xFF000"
    }
  },
  "connectivity": [
    "bluetooth"
  ],
  "debug": {
    "jlink_device": "nRF52840_xxAA",
    "svd_path": "nrf52840.svd"
  },
  "frameworks": [
    "arduino"
  ],
  "name": "Adafruit CLUE",
  "upload": {
    "maximum_ram_size": 248832,
    "maximum_size": 815104,
    "speed": 115200,
    "protocol": "nrfutil",
    "protocols": [
      "jlink",
      "nrfjprog",
      "nrfutil",
      "stlink"
    ],
    "use_1200bps_touch": true,
    "require_upload_port": true,
    "wait_for_upload_port": true
  },
  "url": "https://www.adafruit.com/product/4500",
  "vendor": "Adafruit"
}

which is pretty much the converted version from https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/master/boards.txt#L284-L336.

Then refer to the board as you already do in the platformio.ini as adafruit_cluenrf52840. Try and get a simple blinky code working. Also, you need to add

framework = arduino

otherwise you won’t compile in Arduino.

Thank you so much for the super-speedy and super-helpful response. I added the local board definition and it works perfectly. I’ve submitted a request for official support on the issue tracker but the local board definition allowed me get started on my project right away.

I should have mentioned that I have “framework = arduino” declared globally in a [env] entry in my platformio.ini file so I don’t need it in my [env:clue] entry.

Thanks again!

Board was added per https://github.com/platformio/platform-nordicnrf52/commit/4b1ad5a425031f7a97acd3ff88b6e8e3adfa1173 and will be included as adafruit_clue_nrf52840 in the next nRF52 platform release.

Wow, that was quick! Thank you so much!