From da6bb15bacd3f4ecf99f6a8b334eca601d15ffd6 Mon Sep 17 00:00:00 2001 From: Maximilian Gerhardt Date: Sat, 23 Sep 2023 13:17:52 +0200 Subject: [PATCH 1/3] Add package --- platform.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform.json b/platform.json index 11e3249..311f82b 100644 --- a/platform.json +++ b/platform.json @@ -55,6 +55,12 @@ "owner": "platformio", "version": "~1.10500.0" }, + "framework-arduinoraknrf52": { + "type": "framework", + "optional": true, + "owner": "platformio", + "version": "~1.10303.0" + }, "framework-arduinonordicnrf5": { "type": "framework", "optional": true, From 941c560329863b58b25c7aedb8da552ae308d2a0 Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Sat, 23 Sep 2023 13:34:36 +0200 Subject: [PATCH 2/3] Add RAK4631 --- .gitmodules | 3 +- boards/wiscore_rak4631.json | 72 +++++++++++++++++++ builder/frameworks/arduino | 2 +- examples/arduino-blink/platformio.ini | 5 ++ .../arduino-bluefruit-bleuart/platformio.ini | 6 ++ platform.json | 2 +- platform.py | 8 ++- 7 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 boards/wiscore_rak4631.json diff --git a/.gitmodules b/.gitmodules index b1d534f..1ea919f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [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 + branch = patch-3 diff --git a/boards/wiscore_rak4631.json b/boards/wiscore_rak4631.json new file mode 100644 index 0000000..d5cb3c9 --- /dev/null +++ b/boards/wiscore_rak4631.json @@ -0,0 +1,72 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v6.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [ + [ + "0x239A", + "0x8029" + ], + [ + "0x239A", + "0x0029" + ], + [ + "0x239A", + "0x002A" + ], + [ + "0x239A", + "0x802A" + ] + ], + "usb_product": "WisCore RAK4631 Board", + "mcu": "nrf52840", + "variant": "WisCore_RAK4631_Board", + "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": "WisCore RAK4631 Board", + "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.rakwireless.com", + "vendor": "RAKwireless" +} \ No newline at end of file diff --git a/builder/frameworks/arduino b/builder/frameworks/arduino index 9e9dd6e..f133d8b 160000 --- a/builder/frameworks/arduino +++ b/builder/frameworks/arduino @@ -1 +1 @@ -Subproject commit 9e9dd6e8cf81e0d0000748f15172c487e7907f56 +Subproject commit f133d8bca5fdf0a2465c1faa383ecbbc1091edf0 diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index 3f01755..4a9e512 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -43,3 +43,8 @@ platform = nordicnrf52 framework = arduino board = stct_nrf52_minidev build_flags = -DNRF52_S132 + +[env:wiscore_rak4631] +platform = nordicnrf52 +framework = arduino +board = wiscore_rak4631 diff --git a/examples/arduino-bluefruit-bleuart/platformio.ini b/examples/arduino-bluefruit-bleuart/platformio.ini index 955918b..a73a97c 100644 --- a/examples/arduino-bluefruit-bleuart/platformio.ini +++ b/examples/arduino-bluefruit-bleuart/platformio.ini @@ -48,3 +48,9 @@ platform = nordicnrf52 framework = arduino board = adafruit_ledglasses_nrf52840 monitor_speed = 115200 + +[env:wiscore_rak4631] +platform = nordicnrf52 +framework = arduino +board = wiscore_rak4631 +monitor_speed = 115200 diff --git a/platform.json b/platform.json index 311f82b..091b7e2 100644 --- a/platform.json +++ b/platform.json @@ -59,7 +59,7 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~1.10303.0" + "version": "https://github.com/maxgerhardt/RAK-nRF52-Arduino/archive/refs/heads/1.3.3.zip" }, "framework-arduinonordicnrf5": { "type": "framework", diff --git a/platform.py b/platform.py index e477696..468ae0b 100644 --- a/platform.py +++ b/platform.py @@ -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 ("wiscore_rak4631"): + self.frameworks["arduino"][ + "package"] = "framework-arduinoraknrf52" + else: + self.frameworks["arduino"][ + "package"] = "framework-arduinoadafruitnrf52" self.packages["framework-cmsis"]["optional"] = False self.packages["tool-adafruit-nrfutil"]["optional"] = False From 2c07b9979fe8dd51363807ba217e89f32921b66d Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Sat, 23 Sep 2023 14:20:15 +0200 Subject: [PATCH 3/3] Use spaces in board def --- boards/wiscore_rak4631.json | 142 ++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/boards/wiscore_rak4631.json b/boards/wiscore_rak4631.json index d5cb3c9..8d820fc 100644 --- a/boards/wiscore_rak4631.json +++ b/boards/wiscore_rak4631.json @@ -1,72 +1,72 @@ { - "build": { - "arduino": { - "ldscript": "nrf52840_s140_v6.ld" - }, - "core": "nRF5", - "cpu": "cortex-m4", - "extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA", - "f_cpu": "64000000L", - "hwids": [ - [ - "0x239A", - "0x8029" - ], - [ - "0x239A", - "0x0029" - ], - [ - "0x239A", - "0x002A" - ], - [ - "0x239A", - "0x802A" - ] - ], - "usb_product": "WisCore RAK4631 Board", - "mcu": "nrf52840", - "variant": "WisCore_RAK4631_Board", - "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": "WisCore RAK4631 Board", - "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.rakwireless.com", - "vendor": "RAKwireless" -} \ No newline at end of file + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v6.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [ + [ + "0x239A", + "0x8029" + ], + [ + "0x239A", + "0x0029" + ], + [ + "0x239A", + "0x002A" + ], + [ + "0x239A", + "0x802A" + ] + ], + "usb_product": "WisCore RAK4631 Board", + "mcu": "nrf52840", + "variant": "WisCore_RAK4631_Board", + "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": "WisCore RAK4631 Board", + "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.rakwireless.com", + "vendor": "RAKwireless" +}