Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Xiao nRF52840 (Sense) board support #151

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "builder/frameworks/arduino"]
path = builder/frameworks/arduino
url = https://github.com/platformio/builder-framework-arduino-nrf5.git
url = https://github.com/maxgerhardt/builder-framework-arduino-nrf5.git
60 changes: 60 additions & 0 deletions boards/xiaoble.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"build": {
"arduino": {
"ldscript": "linker_script.ld"
},
"core": "arduino",
"cpu": "cortex-m4",
"extra_flags": "-DSEEED_XIAO_NRF52840 -DARDUINO_ARCH_NRF52840",
"f_cpu": "64000000L",
"hwids": [
[
"0x2886",
"0x0045"
],
[
"0x2886",
"0x8045"
]
],
"mcu": "nrf52840",
"variant": "SEEED_XIAO_NRF52840",
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "7.3.0",
"sd_fwid": "0x0123"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"openocd_target": "nrf52.cfg",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Seeed XIAO BLE nRF52840",
"upload": {
"maximum_ram_size": 237568,
"maximum_size": 811008,
"protocol": "nrfutil",
"speed": 115200,
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://wiki.seeedstudio.com/XIAO_BLE",
"vendor": "Seeed Studio"
}
64 changes: 64 additions & 0 deletions boards/xiaoble_adafruit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v7.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_Seeed_XIAO_nRF52840 -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x2886",
"0x8044"
],
[
"0x2886",
"0x0044"
]
],
"mcu": "nrf52840",
"variant": "Seeed_XIAO_nRF52840",
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "7.3.0",
"sd_fwid": "0x0123"
},
"bsp": {
"name": "adafruit"
},
"usb_product": "XIAO nRF52840"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"openocd_target": "nrf52.cfg",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Seeed XIAO BLE nRF52840",
"upload": {
"maximum_ram_size": 237568,
"maximum_size": 811008,
"protocol": "nrfutil",
"speed": 115200,
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://wiki.seeedstudio.com/XIAO_BLE",
"vendor": "Seeed"
}
60 changes: 60 additions & 0 deletions boards/xiaoblesense.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"build": {
"arduino": {
"ldscript": "linker_script.ld"
},
"core": "arduino",
"cpu": "cortex-m4",
"extra_flags": "-DSEEED_XIAO_NRF52840_SENSE -DARDUINO_ARCH_NRF52840",
"f_cpu": "64000000L",
"hwids": [
[
"0x2886",
"0x0045"
],
[
"0x2886",
"0x8045"
]
],
"mcu": "nrf52840",
"variant": "SEEED_XIAO_NRF52840_SENSE",
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "7.3.0",
"sd_fwid": "0x0123"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"openocd_target": "nrf52.cfg",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Seeed XIAO BLE Sense",
"upload": {
"maximum_ram_size": 237568,
"maximum_size": 811008,
"protocol": "nrfutil",
"speed": 115200,
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://wiki.seeedstudio.com/XIAO_BLE",
"vendor": "Seeed Studio"
}
64 changes: 64 additions & 0 deletions boards/xiaoblesense_adafruit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v7.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_Seeed_XIAO_nRF52840_Sense -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x2886",
"0x8045"
],
[
"0x2886",
"0x0045"
]
],
"mcu": "nrf52840",
"variant": "Seeed_XIAO_nRF52840_Sense",
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "7.3.0",
"sd_fwid": "0x0123"
},
"bsp": {
"name": "adafruit"
},
"usb_product": "XIAO nRF52840 Sense"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"openocd_target": "nrf52.cfg",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Seeed XIAO BLE Sense",
"upload": {
"maximum_ram_size": 237568,
"maximum_size": 811008,
"protocol": "nrfutil",
"speed": 115200,
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://wiki.seeedstudio.com/XIAO_BLE",
"vendor": "Seeed"
}
2 changes: 1 addition & 1 deletion builder/frameworks/arduino
Submodule arduino updated 3 files
+1 −1 .gitmodules
+3 −1 adafruit.py
+1 −1 mbed-core
20 changes: 20 additions & 0 deletions examples/arduino-blink/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,23 @@ platform = nordicnrf52
framework = arduino
board = stct_nrf52_minidev
build_flags = -DNRF52_S132

[env:xiaoblesense]
platform = nordicnrf52
framework = arduino
board = xiaoblesense

[env:xiaoble]
platform = nordicnrf52
framework = arduino
board = xiaoble

[env:xiaoblesense_adafruit]
platform = nordicnrf52
framework = arduino
board = xiaoblesense_adafruit

[env:xiaoble_adafruit]
platform = nordicnrf52
framework = arduino
board = xiaoble_adafruit
12 changes: 12 additions & 0 deletions examples/arduino-bluefruit-bleuart/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,15 @@ platform = nordicnrf52
framework = arduino
board = adafruit_ledglasses_nrf52840
monitor_speed = 115200

[env:xiaoblesense_adafruit]
platform = nordicnrf52
framework = arduino
board = xiaoblesense_adafruit
monitor_speed = 115200

[env:xiaoble_adafruit]
platform = nordicnrf52
framework = arduino
board = xiaoble_adafruit
monitor_speed = 115200
11 changes: 11 additions & 0 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
"owner": "platformio",
"version": "~1.10300.0"
},
"framework-arduinoadafruitnrf52-seeed": {
"type": "framework",
"optional": true,
"owner": "platformio",
"version": "https://github.com/maxgerhardt/framework-arduinoadafruitnrf52-seeed.git"
},
"framework-arduinonordicnrf5": {
"type": "framework",
"optional": true,
Expand All @@ -70,6 +76,11 @@
"owner": "platformio",
"version": "~3.5.4"
},
"framework-arduino-mbed-seeed": {
"type": "framework",
"optional": true,
"version": "https://github.com/maxgerhardt/framework-mbed-seeed.git"
},
"framework-cmsis": {
"type": "framework",
"optional": true,
Expand Down
17 changes: 13 additions & 4 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ def configure_default_packages(self, variables, targets):

if self.board_config(board).get("build.bsp.name",
"nrf5") == "adafruit":
self.frameworks["arduino"][
"package"] = "framework-arduinoadafruitnrf52"
if board in ("xiaoblesense_adafruit", "xiaoble_adafruit"):
self.frameworks["arduino"][
"package"] = "framework-arduinoadafruitnrf52-seeed"
else:
self.frameworks["arduino"][
"package"] = "framework-arduinoadafruitnrf52"
self.packages["framework-cmsis"]["optional"] = False
self.packages["tool-adafruit-nrfutil"]["optional"] = False

Expand All @@ -59,9 +63,14 @@ def configure_default_packages(self, variables, targets):
if not IS_WINDOWS:
self.packages["tool-gperf"]["optional"] = False

if board in ("nano33ble", "nicla_sense_me"):
if board in ("nano33ble", "nicla_sense_me", "xiaoblesense", "xiaoble"):
maxgerhardt marked this conversation as resolved.
Show resolved Hide resolved
self.packages["toolchain-gccarmnoneeabi"]["version"] = "~1.80201.0"
self.frameworks["arduino"]["package"] = "framework-arduino-mbed"
if board in ("xiaoblesense", "xiaoble"):
self.frameworks["arduino"]["package"] = "framework-arduino-mbed-seeed"
# needed to build the ZIP file
self.packages["tool-adafruit-nrfutil"]["optional"] = False
else:
self.frameworks["arduino"]["package"] = "framework-arduino-mbed"
self.frameworks["arduino"][
"script"
] = "builder/frameworks/arduino/mbed-core/arduino-core-mbed.py"
Expand Down