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"
}
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"
}
2 changes: 1 addition & 1 deletion builder/frameworks/arduino
Submodule arduino updated 2 files
+1 −1 .gitmodules
+1 −1 mbed-core
10 changes: 10 additions & 0 deletions examples/arduino-blink/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ 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
5 changes: 5 additions & 0 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
"owner": "platformio",
"version": "~3.1.1"
},
"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
8 changes: 6 additions & 2 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ 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"
self.packages["tool-adafruit-nrfutil"]["optional"] = False
if board in ("xiaoblesense", "xiaoble"):
self.frameworks["arduino"]["package"] = "framework-arduino-mbed-seeed"
else:
self.frameworks["arduino"]["package"] = "framework-arduino-mbed"
self.frameworks["arduino"][
"script"
] = "builder/frameworks/arduino/mbed-core/arduino-core-mbed.py"
Expand Down