Delete ARM_Tag_FW/Newton_M3_nRF52811/$PROJECT_DIR directory

This commit is contained in:
Vstudio LAB
2024-02-26 22:55:48 +01:00
committed by GitHub
parent 0ffd0fbf0e
commit e4ed0b13db
219 changed files with 0 additions and 106696 deletions

View File

@@ -1 +0,0 @@
{"02e88e962c847bfe939c1bb40d987adc8d63670d": 1707865898}

View File

@@ -1 +0,0 @@
{"Location": "https://dl.registry.platformio.org/platforms/f9/01/aa69e6679006fd89fa87f69be7020acf824bf55906470913255cc92fb904/nordicnrf52-9.6.0.tar.gz", "X-PIO-Content-SHA256": "369c2b87a3cebc1fa4e56119142f1bdd851038c8ced36383f9e9c4deb3f9138b"}

View File

@@ -1 +0,0 @@
{"page":1,"limit":10,"total":1,"items":[{"id":8027,"type":"platform","tier":"community","owner":{"username":"platformio"},"name":"nordicnrf52","description":"The nRF52 Series are built for speed to carry out increasingly complex tasks in the shortest possible time and return to sleep, conserving precious battery power. They have a Cortex-M4F processor which makes them quite capable Bluetooth Smart SoCs.","keywords":["dev-platform","arm","cortex-m","nordic semiconductor","nrf52"],"license":"Apache-2.0","updated_at":"2023-12-27T12:36:37Z","stars_count":97,"popularity_rank":10,"popularity_trend":-1,"version":{"id":58469,"name":"10.3.0","unpacked_size":4056659,"released_at":"2023-12-27T12:36:37Z","files":[{"name":"nordicnrf52-10.3.0.tar.gz","size":227117,"checksum":{"sha256":"93e8df081f3f3904cfe721729c637ba2b53defce7c3353a2d8ae7c8604172a88"},"system":"*","download_url":"https://dl.registry.platformio.org/download/platformio/platform/nordicnrf52/10.3.0/nordicnrf52-10.3.0.tar.gz"}]}}]}

View File

@@ -1,3 +0,0 @@
1707869494=6c0ef23b0efd357015981f40a36d2dbe43ea4cbb
1707869494=d9b2b5424a82e5546c1e0ec036a67ad8ea713a46
1707869497=65de00e60c97cea514dcefaf46fa501065001087

View File

@@ -1 +0,0 @@
{"last_version": "6.1.13", "cid": "cc0f5072-b0a1-565e-a9f2-f001750b3689", "created_at": 1707865903}

View File

@@ -1,43 +0,0 @@
name: Examples
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
example:
- "examples/arduino-blink"
- "examples/arduino-ble-led"
- "examples/arduino-bluefruit-bleuart"
- "examples/arduino-nina-b1-generic-example"
- "examples/arduino-serial-plotter"
- "examples/mbed-rtos-ble-thermometer"
- "examples/mbed-rtos-blink-baremetal"
- "examples/mbed-rtos-nfc"
- "examples/mbed-legacy-examples/mbed-ble-thermometer"
- "examples/mbed-legacy-examples/mbed-nfc"
- "examples/mbed-legacy-examples/mbed-rtos"
- "examples/zephyr-ble-beacon"
- "examples/zephyr-blink"
- "examples/zephyr-net-echo-client"
- "examples/zephyr-subsys-nvs"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: "3.7"
- name: Install dependencies
run: |
pip install -U https://github.com/platformio/platformio/archive/develop.zip
pip3 install adafruit-nrfutil
pio pkg install --global --platform symlink://.
- name: Build examples
run: |
pio run -d ${{ matrix.example }}

View File

@@ -1,3 +0,0 @@
*.pyc
.piolibdeps
.pio

View File

@@ -1,3 +0,0 @@
[submodule "builder/frameworks/arduino"]
path = builder/frameworks/arduino
url = https://github.com/platformio/builder-framework-arduino-nrf5.git

View File

@@ -1 +0,0 @@
{"type": "platform", "name": "nordicnrf52", "version": "9.6.0", "spec": {"owner": "platformio", "id": 8027, "name": "nordicnrf52", "requirements": null, "uri": null}}

View File

@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -1,35 +0,0 @@
# Nordic nRF52: development platform for [PlatformIO](https://platformio.org)
[![Build Status](https://github.com/platformio/platform-nordicnrf52/workflows/Examples/badge.svg)](https://github.com/platformio/platform-nordicnrf52/actions)
The nRF52 Series are built for speed to carry out increasingly complex tasks in the shortest possible time and return to sleep, conserving precious battery power. They have a Cortex-M4F processor which makes them quite capable Bluetooth Smart SoCs.
* [Home](https://registry.platformio.org/platforms/platformio/nordicnrf52) (home page in the PlatformIO Registry)
* [Documentation](https://docs.platformio.org/page/platforms/nordicnrf52.html) (advanced usage, packages, boards, frameworks, etc.)
# Usage
1. [Install PlatformIO](https://platformio.org)
2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file:
## Stable version
```ini
[env:stable]
platform = nordicnrf52
board = ...
...
```
## Development version
```ini
[env:development]
platform = https://github.com/platformio/platform-nordicnrf52.git
board = ...
...
```
# Configuration
Please navigate to [documentation](https://docs.platformio.org/page/platforms/nordicnrf52.html).

View File

@@ -1,31 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52832"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"zephyr"
],
"name": "96Boards Nitrogen",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic"
]
},
"url": "https://www.96boards.org/product/nitrogen/",
"vendor": "96Boards"
}

View File

@@ -1,70 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_CLUE -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8071"
],
[
"0x239A",
"0x0071"
],
[
"0x239A",
"0x8072"
]
],
"usb_product": "CLUE nRF52840",
"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 nRF52840",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.adafruit.com/product/4500",
"vendor": "Adafruit"
}

View File

@@ -1,70 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_CIRCUITPLAY -DNRF52840_XXAA -DNRF52840_CIRCUITPLAY",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8045"
],
[
"0x239A",
"0x0045"
],
[
"0x239A",
"0x8046"
]
],
"usb_product": "Circuit Playground Bluefruit",
"mcu": "nrf52840",
"variant": "circuitplayground_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": "Circuit Playground Bluefruit",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.adafruit.com/product/4333",
"vendor": "Adafruit"
}

View File

@@ -1,73 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52832_s132_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DNRF52832_XXAA -DNRF52",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
],
[
"0x239A",
"0x802A"
]
],
"usb_product": "Feather nRF52832 Express",
"mcu": "nrf52832",
"variant": "feather_nrf52832",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS132",
"sd_name": "s132",
"sd_version": "6.1.1",
"sd_fwid": "0x00B7"
},
"zephyr": {
"variant": "nrf52_adafruit_feather"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino",
"zephyr"
],
"name": "Adafruit Bluefruit nRF52832 Feather",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"require_upload_port": true,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
]
},
"url": "https://www.adafruit.com/product/3406",
"vendor": "Adafruit"
}

View File

@@ -1,75 +0,0 @@
{
"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": "Feather nRF52840 Express",
"mcu": "nrf52840",
"variant": "feather_nrf52840_express",
"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",
"zephyr"
],
"name": "Adafruit Feather nRF52840 Express",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.adafruit.com/product/4062",
"vendor": "Adafruit"
}

View File

@@ -1,74 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER_SENSE -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8087"
],
[
"0x239A",
"0x0087"
],
[
"0x239A",
"0x0088"
],
[
"0x239A",
"0x8088"
]
],
"usb_product": "Feather Bluefruit Sense",
"mcu": "nrf52840",
"variant": "feather_nrf52840_sense",
"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 Feather Bluefruit Sense",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.adafruit.com/product/4516",
"vendor": "Adafruit"
}

View File

@@ -1,74 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_ITSYBITSY -DNRF52840_XXAA -DARDUINO_NRF52_ITSYBITSY",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8051"
],
[
"0x239A",
"0x0051"
],
[
"0x239A",
"0x0052"
],
[
"0x239A",
"0x8052"
]
],
"usb_product": "ItsyBitsy nRF52840 Express",
"mcu": "nrf52840",
"variant": "itsybitsy_nrf52840_express",
"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": "ItsyBitsy nRF52840 Express",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.adafruit.com/product/4062",
"vendor": "Adafruit"
}

View File

@@ -1,75 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_LED_GLASSES -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x810D"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x010D"
],
[
"0x239A",
"0x810E"
]
],
"usb_product": "Adafruit LED Glasses",
"mcu": "nrf52840",
"variant": "ledglasses_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",
"zephyr"
],
"name": "Adafruit LED Glasses Driver nRF52840",
"upload": {
"maximum_ram_size": 237568,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.adafruit.com/product/5217",
"vendor": "Adafruit"
}

View File

@@ -1,74 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DARDUINO_NRF52840_METRO -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x803F"
],
[
"0x239A",
"0x003F"
],
[
"0x239A",
"0x0040"
],
[
"0x239A",
"0x8040"
]
],
"usb_product": "Metro nRF52840 Express",
"mcu": "nrf52840",
"variant": "metro_nrf52840_express",
"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": "Metro nRF52840 Express",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.adafruit.com/product/4062",
"vendor": "Adafruit"
}

View File

@@ -1,50 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52833_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_BBC_MICROBIT_V2 -DNRF52833_XXAA",
"f_cpu": "64000000L",
"mcu": "nrf52833",
"variant": "BBCmicrobitV2",
"zephyr": {
"variant": "bbc_microbit_v2"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52.svd",
"openocd_extra_args": [
"-c",
"transport select swd;"
],
"jlink_device": "nRF52833_xxAA"
},
"frameworks": [
"arduino",
"zephyr"
],
"name": "BBC micro:bit V2",
"upload": {
"maximum_ram_size": 131072,
"maximum_size": 524288,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://microbit.org/new-microbit/",
"vendor": "BBC"
}

View File

@@ -1,38 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_ELECTRONUT_BLUEY",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "bluey"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino"
],
"name": "Bluey nRF52832 IoT",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"cmsis-dap",
"blackmagic"
]
},
"url": "https://electronut.in/portfolio/bluey/",
"vendor": "Electronut Labs"
}

View File

@@ -1,43 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_GENERIC",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "Generic"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino",
"mbed"
],
"name": "Delta DFBM-NQ620",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"blackmagic",
"cmsis-dap",
"stlink",
"mbed"
]
},
"url": "https://developer.mbed.org/platforms/Delta-DFBM-NQ620/",
"vendor": "Delta"
}

View File

@@ -1,46 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_DWM1001_DEV",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "DWM1001-DEV"
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"jlink"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino"
],
"name": "decaWave DWM1001 Module Development Board",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://www.decawave.com/product/dwm1001-development-board/",
"vendor": "decaWave"
}

View File

@@ -1,41 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"zephyr": {
"variant": "nrf52840_blip"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"blackmagic"
],
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"blackmagic"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "ElectronutLabs Blip",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "blackmagic",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap"
]
},
"url": "https://github.com/electronut/ElectronutLabs-blip",
"vendor": "ElectronutLabs"
}

View File

@@ -1,41 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"zephyr": {
"variant": "nrf52840_papyr"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"blackmagic"
],
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"blackmagic"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "ElectronutLabs Papyr",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "blackmagic",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap"
]
},
"url": "https://docs.electronut.in/papyr",
"vendor": "ElectronutLabs"
}

View File

@@ -1,38 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_ELECTRONUT_HACKABLE",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "hackaBLE"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino"
],
"name": "hackaBLE",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"cmsis-dap",
"blackmagic"
]
},
"url": "https://electronut.in/portfolio/hackaBLE/",
"vendor": "Electronut Labs"
}

View File

@@ -1,32 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52832"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"zephyr"
],
"name": "Holyiot YJ-16019",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap"
]
},
"url": "http://www.holyiot.com/eacp_view.asp?id=306",
"vendor": "Holyiot"
}

View File

@@ -1,43 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"zephyr": {
"variant": "bl652_dvk"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"cmsis-dap",
"jlink"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"zephyr"
],
"name": "BL652 Development Kit",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://www.lairdconnect.com/wireless-modules/bluetooth-modules/bluetooth-5-modules/bl652-series-bluetooth-v5-nfc",
"vendor": "Laird Connectivity"
}

View File

@@ -1,43 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52833",
"zephyr": {
"variant": "bl653_dvk"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52833_xxAA",
"onboard_tools": [
"cmsis-dap",
"jlink"
],
"svd_path": "nrf52833.svd"
},
"frameworks": [
"zephyr"
],
"name": "BL653 Development Kit",
"upload": {
"maximum_ram_size": 131072,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://www.lairdconnect.com/wireless-modules/bluetooth-modules/bluetooth-5-modules/bl653-series-bluetooth-51-802154-nfc-module",
"vendor": "Laird Connectivity"
}

View File

@@ -1,43 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"zephyr": {
"variant": "bl654_dvk"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"cmsis-dap",
"jlink"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "BL654 Development Kit",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://www.lairdconnect.com/wireless-modules/bluetooth-modules/bluetooth-5-modules/bl654-series-bluetooth-module-nfc",
"vendor": "Laird Connectivity"
}

View File

@@ -1,36 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"zephyr": {
"variant": "pinnacle_100_dvk"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "Laird Connectivity Pinnacle 100 DVK",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://www.lairdconnect.com/wireless-modules/cellular-solutions/pinnacle-100-cellular-modem",
"vendor": "Laird Connectivity"
}

View File

@@ -1,53 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "linker_script.ld"
},
"core": "arduino",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_NRF52840",
"f_cpu": "64000000L",
"hwids": [
[
"0x2341",
"0x005a"
],
[
"0x2341",
"0x805a"
]
],
"mcu": "nrf52840",
"variant": "ARDUINO_NANO33BLE"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"openocd_target": "nrf52.cfg",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Arduino Nano 33 BLE",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 983040,
"protocol": "sam-ba",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://store.arduino.cc/arduino-nano-33-ble",
"vendor": "Arduino"
}

View File

@@ -1,58 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "linker_script.ld"
},
"core": "arduino",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NICLA -DARDUINO_ARCH_NRF52832",
"f_cpu": "64000000L",
"hwids": [
[
"0x2341",
"0x0060"
]
],
"mcu": "nrf52832",
"variant": "NICLA"
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"cmsis-dap"
],
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52.svd",
"openocd_target": "nrf52.cfg",
"openocd_extra_args": [
"-c",
"transport select swd;"
]
},
"frameworks": [
"arduino"
],
"name": "Arduino Nicla Sense ME",
"upload": {
"maximum_ram_size": 64288,
"maximum_size": 527616,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"sam-ba",
"blackmagic"
],
"use_1200bps_touch": false,
"require_upload_port": true
},
"url": "https://docs.arduino.cc/hardware/nicla-sense-me",
"vendor": "Arduino"
}

View File

@@ -1,39 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52832"
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"cmsis-dap"
],
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"zephyr"
],
"name": "Makerdiary nRF52832-MDK",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://wiki.makerdiary.com/nrf52832-mdk/",
"vendor": "Makerdiary"
}

View File

@@ -1,43 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52833",
"zephyr": {
"variant": "nrf52833dk_nrf52833"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52833_xxAA",
"onboard_tools": [
"cmsis-dap",
"jlink"
],
"svd_path": "nrf52833.svd"
},
"frameworks": [
"zephyr"
],
"name": "Nordic nRF52833-DK",
"upload": {
"maximum_ram_size": 131072,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://www.nordicsemi.com/Products/Development-hardware/nrf52833-dk",
"vendor": "Nordic"
}

View File

@@ -1,51 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52_DK",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"variant": "nRF52DK",
"zephyr": {
"variant": "nrf52840dk_nrf52840"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"cmsis-dap",
"jlink"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino",
"mbed",
"zephyr"
],
"name": "Nordic nRF52840-DK",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://os.mbed.com/platforms/Nordic-nRF52840-DK/",
"vendor": "Nordic"
}

View File

@@ -1,62 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
]
],
"usb_product": "NRF52 DK",
"mcu": "nrf52840",
"variant": "pca10056",
"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",
"onboard_tools": [
"jlink"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino"
],
"name": "Nordic nRF52840-DK (Adafruit BSP)",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"require_upload_port": true,
"speed": 115200,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"cmsis-dap",
"blackmagic"
]
},
"url": "https://os.mbed.com/platforms/Nordic-nRF52840-DK/",
"vendor": "Nordic"
}

View File

@@ -1,39 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840"
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"cmsis-dap"
],
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "Makerdiary nRF52840-MDK",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://wiki.makerdiary.com/nrf52840-mdk",
"vendor": "Makerdiary"
}

View File

@@ -1,51 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52_DK",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "nRF52DK",
"zephyr": {
"variant": "nrf52dk_nrf52832"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"cmsis-dap",
"jlink"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino",
"mbed",
"zephyr"
],
"name": "Nordic nRF52-DK",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://developer.mbed.org/platforms/Nordic-nRF52-DK/",
"vendor": "Nordic"
}

View File

@@ -1,34 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "Particle Argon",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"require_upload_port": true,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"blackmagic"
]
},
"url": "https://docs.particle.io/argon",
"vendor": "Particle"
}

View File

@@ -1,34 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "Particle Boron",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"require_upload_port": true,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"cmsis-dap",
"blackmagic"
]
},
"url": "https://docs.particle.io/boron",
"vendor": "Particle"
}

View File

@@ -1,61 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
]
],
"usb_product": "Particle Xenon",
"mcu": "nrf52840",
"variant": "particle_xenon",
"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",
"zephyr"
],
"name": "Particle Xenon",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"require_upload_port": true,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
]
},
"url": "https://docs.particle.io/xenon",
"vendor": "Particle"
}

View File

@@ -1,70 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_MDBT50Q_RX -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x810B"
],
[
"0x239A",
"0x010B"
],
[
"0x239A",
"0x810C"
]
],
"usb_product": "Raytac MDBT50Q - RX",
"mcu": "nrf52840",
"variant": "raytac_mdbt50q_rx",
"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": "Raytac MDBT50Q-RX Dongle",
"upload": {
"maximum_ram_size": 248832,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap",
"blackmagic"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://www.raytac.com/product/ins.php?index_id=89",
"vendor": "Raytac"
}

View File

@@ -1,46 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_RB_BLE_NANO_2",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "RedBear_BLENano2",
"zephyr": {
"variant": "nrf52_blenano2"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino",
"mbed",
"zephyr"
],
"name": "RedBearLab BLE Nano 2",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap"
]
},
"url": "https://redbear.cc/product/ble-nano-2-soldered.html",
"vendor": "RedBearLab"
}

View File

@@ -1,41 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_RB_BLEND_2",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "RedBear_Blend2"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino"
],
"name": "RedBearLab Blend 2",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap"
]
},
"url": "https://redbear.cc/product/ble/blend-2.html",
"vendor": "RedBearLab"
}

View File

@@ -1,45 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"hwids": [
[
"0x0D28",
"0x0204"
]
],
"zephyr": {
"variant": "reel_board"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "PHYTEC reel board",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"blackmagic",
"cmsis-dap",
"stlink",
"mbed"
]
},
"url": "https://www.phytec.eu/reelboard",
"vendor": "PHYTEC"
}

View File

@@ -1,45 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"hwids": [
[
"0x0D28",
"0x0204"
]
],
"zephyr": {
"variant": "reel_board_v2"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "PHYTEC reel board v2",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"blackmagic",
"cmsis-dap",
"stlink",
"mbed"
]
},
"url": "https://www.phytec.eu/reelboard",
"vendor": "PHYTEC"
}

View File

@@ -1,36 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"zephyr": {
"variant": "ruuvi_ruuvitag"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"zephyr"
],
"name": "Ruuvi Tag",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://ruuvi.com/",
"vendor": "Ruuvi"
}

View File

@@ -1,37 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52_DK",
"f_cpu": "64000000L",
"mcu": "nrf52832"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"mbed"
],
"name": "SDT52832B",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "mbed",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://os.mbed.com/platforms/SDT52832B/",
"vendor": "Sigma Delta Technologies"
}

View File

@@ -1,38 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_STCT_NRF52_minidev",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "Taida_Century_nRF52_minidev"
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino"
],
"name": "Taida Century nRF52 mini board",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"cmsis-dap",
"blackmagic"
]
},
"url": "http://taida-century.com/en/index.asp",
"vendor": "Taida Century"
}

View File

@@ -1,35 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"zephyr": {
"variant": "thingy52_nrf52832"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"svd_path": "nrf52.svd"
},
"frameworks": [
"zephyr"
],
"name": "Nordic Thingy:52 (nRF52-PCA20020)",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap"
]
},
"url": "https://www.nordicsemi.com/Software-and-Tools/Prototyping-platforms/Nordic-Thingy-52",
"vendor": "Nordic"
}

View File

@@ -1,44 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"zephyr": {
"variant": "ubx_bmd345eval_nrf52840"
}
},
"connectivity": [
"bluetooth",
"nfc"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"cmsis-dap",
"jlink"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"zephyr"
],
"name": "u-blox BMD-345-EVAL",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "jlink",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"nrfjprog",
"mbed",
"stlink"
]
},
"url": "https://www.u-blox.com/en/product/bmd-34-series-open-cpu",
"vendor": "u-blox"
}

View File

@@ -1,44 +0,0 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_GENERIC",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"variant": "Generic"
},
"connectivity": [
"bluetooth",
"nfc"
],
"debug": {
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"jlink"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"arduino",
"mbed"
],
"name": "u-blox EVK-NINA-B1",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://os.mbed.com/platforms/u-blox-EVK-NINA-B1/",
"vendor": "u-blox"
}

View File

@@ -1,41 +0,0 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "64000000L",
"mcu": "nrf52832",
"zephyr": {
"variant": "nrf52_vbluno52"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"cmsis-dap"
],
"jlink_device": "nRF52832_xxAA",
"onboard_tools": [
"cmsis-dap"
],
"svd_path": "nrf52.svd"
},
"frameworks": [
"zephyr"
],
"name": "VNG VBLUno52",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 524288,
"protocol": "cmsis-dap",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap"
]
},
"url": "https://vngiotlab.github.io/",
"vendor": "VNG"
}

View File

@@ -1,71 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Default flags for bare-metal programming (without any framework layers)
#
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
env.Append(
ASFLAGS=[
"-mthumb",
],
ASPPFLAGS=[
"-x", "assembler-with-cpp",
],
CCFLAGS=[
"-Os", # optimize for size
"-ffunction-sections", # place each function in its own section
"-fdata-sections",
"-Wall",
"-mthumb",
"-nostdlib"
],
CXXFLAGS=[
"-fno-rtti",
"-fno-exceptions"
],
CPPDEFINES=[
("F_CPU", "$BOARD_F_CPU")
],
LINKFLAGS=[
"-Os",
"-Wl,--gc-sections,--relax",
"-mthumb",
"--specs=nano.specs",
"--specs=nosys.specs"
],
LIBS=["c", "gcc", "m", "stdc++", "nosys"]
)
if "BOARD" in env:
env.Append(
ASFLAGS=[
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
],
CCFLAGS=[
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
],
LINKFLAGS=[
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
]
)

View File

@@ -1,31 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Arduino
Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.
"""
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
board = env.BoardConfig()
if board.get("build.bsp.name", "nrf5") == "adafruit":
env.SConscript("arduino/adafruit.py")
else:
env.SConscript("arduino/nrf5.py")

View File

@@ -1,3 +0,0 @@
[submodule "mbed-core"]
path = mbed-core
url = https://github.com/platformio/builder-framework-arduino-core-mbed.git

View File

@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -1,2 +0,0 @@
# builder-framework-arduino-nrf5
Arduino (Nordic nRF5) build script for PlatformIO Build System

View File

@@ -1,278 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Arduino
Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.
"""
from os import listdir
from os.path import isdir, join
from SCons.Script import DefaultEnvironment
import re
env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()
variant = board.get("build.variant")
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoadafruitnrf52")
assert isdir(FRAMEWORK_DIR)
CMSIS_DIR = platform.get_package_dir("framework-cmsis")
assert isdir(CMSIS_DIR)
CORE_DIR = join(FRAMEWORK_DIR, "cores", board.get("build.core"))
assert isdir(CORE_DIR)
NORDIC_DIR = join(CORE_DIR, "nordic")
assert isdir(NORDIC_DIR)
default_bsp_version = "0.21.0"
default_softdevice_version = "6.1.1"
default_bootloader_version = "0.5.0"
# Read defaults from build.txt/platform.txt/programmers.txt
with open(join(FRAMEWORK_DIR, "platform.txt"), "r") as fp:
for line in fp:
match = re.search(r"^version=(\d+\.\d+.\d+)", line)
if match:
default_bsp_version = match.group(1)
match = re.search(r"_bootloader-(\d+\.\d+.\d+)_", line)
if match:
default_bootloader_version = match.group(1)
with open(join(FRAMEWORK_DIR, "boards.txt"), "r") as fp:
for line in fp:
match = re.search(r"build.sd_version=(\d+\.\d+.\d+)", line)
if match:
default_softdevice_version = match.group(1)
bsp_version = board.get("build.bsp.version", default_bsp_version)
softdevice_version = board.get("build.softdevice.sd_version", default_softdevice_version)
bootloader_version = board.get("build.bootloader.version", default_bootloader_version)
machine_flags = [
"-mthumb",
"-mcpu=%s" % board.get("build.cpu"),
]
env.Append(
ASFLAGS=machine_flags,
ASPPFLAGS=[
"-x", "assembler-with-cpp",
],
CFLAGS=["-std=gnu11"],
CCFLAGS=machine_flags + [
"-Ofast",
"-ffunction-sections", # place each function in its own section
"-fdata-sections",
"-Wall",
"-nostdlib",
"--param", "max-inline-insns-single=500"
],
CXXFLAGS=[
"-fno-rtti",
"-fno-exceptions",
"-std=gnu++11",
"-fno-threadsafe-statics"
],
CPPDEFINES=[
("F_CPU", board.get("build.f_cpu")),
("ARDUINO", 10804),
"ARDUINO_ARCH_NRF52",
("ARDUINO_BSP_VERSION", '\\"%s\\"' % bsp_version),
"ARDUINO_NRF52_ADAFRUIT",
"NRF52_SERIES",
("LFS_NAME_MAX", 64),
"DX_CC_TEE"
],
LIBPATH=[
join(CORE_DIR, "linker"),
join(CMSIS_DIR, "CMSIS", "DSP", "Lib", "GCC"),
],
CPPPATH=[
join(CMSIS_DIR, "CMSIS", "Core", "Include"),
join(CMSIS_DIR, "CMSIS", "DSP", "Include"),
NORDIC_DIR,
join(NORDIC_DIR, "nrfx"),
join(NORDIC_DIR, "nrfx", "hal"),
join(NORDIC_DIR, "nrfx", "mdk"),
join(NORDIC_DIR, "nrfx", "soc"),
join(NORDIC_DIR, "nrfx", "drivers", "include"),
join(NORDIC_DIR, "nrfx", "drivers", "src")
],
LINKFLAGS=machine_flags + [
"-Ofast",
"-Wl,--gc-sections,--relax",
"--specs=nano.specs",
"--specs=nosys.specs",
"-Wl,--check-sections",
"-Wl,--unresolved-symbols=report-all",
"-Wl,--warn-common",
"-Wl,--warn-section-align",
"-Wl,--wrap=malloc",
"-Wl,--wrap=free"
],
LIBSOURCE_DIRS=[join(FRAMEWORK_DIR, "libraries")],
LIBS=["m", "arm_cortexM4lf_math"]
)
if board.get("build.cpu") == "cortex-m4":
env.Append(
ASFLAGS=[
"-mfloat-abi=hard",
"-mfpu=fpv4-sp-d16",
],
CCFLAGS=[
"-mfloat-abi=hard",
"-mfpu=fpv4-sp-d16",
"-u", "_printf_float"
],
LINKFLAGS=[
"-mfloat-abi=hard",
"-mfpu=fpv4-sp-d16",
"-u", "_printf_float"
]
)
# Process softdevice options
softdevice_name = board.get("build.softdevice.sd_name")
board_name = board.get("build.bootloader.hex_filename", board.get("build.variant"))
if softdevice_name:
env.Append(
CPPPATH=[
join(NORDIC_DIR, "softdevice",
"%s_nrf52_%s_API" % (softdevice_name, softdevice_version), "include"),
join(NORDIC_DIR, "softdevice",
"%s_nrf52_%s_API" % (softdevice_name, softdevice_version), "include", "nrf52")
],
CPPDEFINES=[
"SOFTDEVICE_PRESENT"
]
)
hex_path = join(FRAMEWORK_DIR, "bootloader", board_name)
if isdir(hex_path):
for f in listdir(hex_path):
if f == "{0}_bootloader-{1}_{2}_{3}.hex".format(
variant, bootloader_version, softdevice_name, softdevice_version):
env.Append(DFUBOOTHEX=join(hex_path, f))
if not board.get("build.ldscript", ""):
# Update linker script:
ldscript_dir = join(CORE_DIR, "linker")
ldscript_name = board.get("build.arduino.ldscript", "")
if ldscript_name:
env.Append(LIBPATH=[ldscript_dir])
env.Replace(LDSCRIPT_PATH=ldscript_name)
else:
print("Warning! Cannot find an appropriate linker script for the "
"required softdevice!")
freertos_path = join(CORE_DIR, "freertos")
if isdir(freertos_path):
env.Append(
CPPPATH=[
join(freertos_path, "Source", "include"),
join(freertos_path, "config"),
join(freertos_path, "portable", "GCC", "nrf52"),
join(freertos_path, "portable", "CMSIS", "nrf52")
]
)
sysview_path = join(CORE_DIR, "sysview")
if isdir(sysview_path):
env.Append(
CPPPATH=[
join(sysview_path, "SEGGER"),
join(sysview_path, "Config")
]
)
usb_path = join(FRAMEWORK_DIR, "libraries", "Adafruit_TinyUSB_Arduino")
if isdir(usb_path):
if env.subst("$BOARD") != "adafruit_feather_nrf52832":
env.Append(
CPPDEFINES=[
"USBCON",
"USE_TINYUSB"
]
)
env.Append(CPPPATH=[join(usb_path, "src", "arduino")])
if "build.usb_product" in env.BoardConfig():
env.Append(
CPPDEFINES=[
("USB_VID", board.get("build.hwids")[0][0]),
("USB_PID", board.get("build.hwids")[0][1]),
("USB_PRODUCT", '\\"%s\\"' % board.get("build.usb_product", "").replace('"', "")),
("USB_MANUFACTURER", '\\"%s\\"' % board.get("vendor", "").replace('"', ""))
]
)
env.Append(
CPPPATH=[
join(CORE_DIR)
]
)
cpp_flags = env.Flatten(env.get("CPPDEFINES", []))
if "CFG_DEBUG" not in cpp_flags:
env.Append(CPPDEFINES=[("CFG_DEBUG", 0)])
#
# Target: Build Core Library
#
libs = []
if "build.variant" in board:
variants_dir = join(
"$PROJECT_DIR", board.get("build.variants_dir")) if board.get(
"build.variants_dir", "") else join(FRAMEWORK_DIR, "variants")
env.Append(
CPPPATH=[
join(variants_dir, board.get("build.variant"))
]
)
libs.append(env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduinoVariant"),
join(variants_dir, board.get("build.variant"))
))
libs.append(
env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduino"),
join(CORE_DIR)))
env.Prepend(LIBS=libs)

View File

@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -1,224 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Arduino
Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.
https://github.com/arduino/ArduinoCore-mbed
"""
import os
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()
FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-mbed")
assert os.path.isdir(FRAMEWORK_DIR)
def load_flags(filename):
if not filename:
return []
file_path = os.path.join(FRAMEWORK_DIR, "variants", board.get(
"build.variant"), "%s.txt" % filename)
if not os.path.isfile(file_path):
print("Warning: Couldn't find file '%s'" % file_path)
return []
with open(file_path, "r") as fp:
return [f.strip() for f in fp.readlines() if f.strip()]
def configure_flash_layout(board_config):
# Currently only Portenta, Opta, Nicla Vision boards need this functionality
board_id = env.subst("$BOARD")
if not board_id.startswith(("portenta_h7", "opta", "nicla_vision")):
return
flash_layout = board_config.get("build.arduino.flash_layout", "50_50")
defines = []
if flash_layout == "50_50":
defines.append(("CM4_BINARY_START", "0x08100000"))
if board_id in ("portenta_h7_m4", "opta_m4", "nicla_vision_m4"):
defines.append(("CM4_BINARY_END", "0x08200000"))
elif flash_layout == "75_25":
defines.append(("CM4_BINARY_START", "0x08180000"))
if board_id in ("portenta_h7_m4", "opta_m4", "nicla_vision_m4"):
board_config.update("upload.offset_address", "0x08180000")
defines.append(("CM4_BINARY_END", "0x08200000"))
elif flash_layout == "100_0":
defines.append(("CM4_BINARY_START", "0x60000000"))
if board_id == "portenta_h7_m4":
defines.extend(
[("CM4_BINARY_END", "0x60040000"), ("CM4_RAM_END", "0x60080000")]
)
env.Append(
LINKFLAGS=["-D%s=%s" % (name, value) for name, value in defines],
CPPDEFINES=defines,
)
def configure_fpu_flags(board_config):
board_cpu = board_config.get("build.cpu", "")
if board_cpu not in ("cortex-m4", "cortex-m7"):
return
fpv_version = "4-sp" if board_cpu == "cortex-m4" else "5"
env.Append(
ASFLAGS=[
"-mfloat-abi=soft",
"-mfpu=fpv%s-d16" % fpv_version
],
CCFLAGS=[
"-mfloat-abi=soft",
"-mfpu=fpv%s-d16" % fpv_version
],
LINKFLAGS=[
"-mfloat-abi=soft",
"-mfpu=fpv%s-d16" % fpv_version
]
)
cflags = set(load_flags("cflags"))
cxxflags = set(load_flags("cxxflags"))
ccflags = cflags.intersection(cxxflags)
env.Append(
ASFLAGS=[f for f in ccflags if isinstance(f, str) and f.startswith("-m")],
ASPPFLAGS=["-x", "assembler-with-cpp"],
CFLAGS=sorted(list(cflags - ccflags)),
CCFLAGS=sorted(list(ccflags)),
CPPDEFINES=[d.replace("-D", "") for d in load_flags("defines")],
CXXFLAGS=sorted(list(cxxflags - ccflags)),
LIBPATH=[
os.path.join(FRAMEWORK_DIR, "variants", board.get("build.variant")),
os.path.join(FRAMEWORK_DIR, "variants", board.get("build.variant"), "libs")
],
LINKFLAGS=load_flags("ldflags"),
LIBSOURCE_DIRS=[os.path.join(FRAMEWORK_DIR, "libraries")],
LIBS=["mbed"]
)
if board.get("build.mcu", "").startswith("nrf52840"):
env.Append(LIBS=["cc_310_core", "cc_310_ext", "cc_310_trng"])
env.Append(
# Due to long path names "-iprefix" hook is required to avoid toolchain crashes
CCFLAGS=[
"-iprefix" + os.path.join(FRAMEWORK_DIR, "cores", board.get("build.core")),
"@%s" % os.path.join(FRAMEWORK_DIR, "variants", board.get(
"build.variant"), "includes.txt"),
"-nostdlib"
],
CPPDEFINES=[
("ARDUINO", 10810),
"ARDUINO_ARCH_MBED"
],
CPPPATH=[
os.path.join(FRAMEWORK_DIR, "cores", board.get("build.core")),
os.path.join(FRAMEWORK_DIR, "cores", board.get(
"build.core"), "api", "deprecated"),
os.path.join(FRAMEWORK_DIR, "cores", board.get(
"build.core"), "api", "deprecated-avr-comp")
],
LINKFLAGS=[
"--specs=nano.specs",
"--specs=nosys.specs",
"-Wl,--as-needed"
]
)
#
# Configure dynamic memory layout
#
configure_flash_layout(board)
#
# Configure FPU flags
#
configure_fpu_flags(board)
#
# Linker requires preprocessing with specific defines
#
if not board.get("build.ldscript", ""):
ldscript = os.path.join(
FRAMEWORK_DIR, "variants", board.get("build.variant"), "linker_script.ld")
if board.get("build.mbed.ldscript", ""):
ldscript = env.subst(board.get("build.arduino.ldscript"))
if os.path.isfile(ldscript):
preprocessed_linker_script = env.Command(
os.path.join(
"$BUILD_DIR", "cpp.linker_script.ld"
),
ldscript,
env.VerboseAction(
"$CXX -E -P -x c %s $SOURCE -o $TARGET"
% " ".join(f for f in env["LINKFLAGS"] if f.startswith("-D")),
"Generating LD script $TARGET",
),
)
env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", preprocessed_linker_script)
env.Replace(LDSCRIPT_PATH=preprocessed_linker_script)
else:
print("Warning! Couldn't find linker script file!")
# Framework requires all symbols from mbed libraries
env.Prepend(_LIBFLAGS="-Wl,--whole-archive ")
env.Append(_LIBFLAGS=" -Wl,--no-whole-archive -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys")
libs = []
if "build.variant" in board:
env.Append(CPPPATH=[
os.path.join(FRAMEWORK_DIR, "variants", board.get("build.variant"))
])
libs.append(
env.BuildLibrary(
os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"),
os.path.join(FRAMEWORK_DIR, "variants", board.get("build.variant"))))
libs.append(
env.BuildLibrary(
os.path.join("$BUILD_DIR", "FrameworkArduino"),
os.path.join(FRAMEWORK_DIR, "cores", board.get("build.core"))))
env.Prepend(LIBS=libs)

View File

@@ -1,201 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Arduino
Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.
"""
from os import listdir
from os.path import isdir, join
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinonordicnrf5")
assert isdir(FRAMEWORK_DIR)
env.Append(
ASPPFLAGS=["-x", "assembler-with-cpp"],
CFLAGS=["-std=gnu11"],
CCFLAGS=[
"-Os", # optimize for size
"-ffunction-sections", # place each function in its own section
"-fdata-sections",
"-Wall",
"-mthumb",
"-nostdlib",
"--param", "max-inline-insns-single=500"
],
CXXFLAGS=[
"-fno-rtti",
"-fno-exceptions",
"-std=gnu++11",
"-fno-threadsafe-statics"
],
CPPDEFINES=[
("ARDUINO", 10805),
# For compatibility with sketches designed for AVR@16 MHz (see SPI lib)
("F_CPU", "16000000L"),
"ARDUINO_ARCH_NRF5",
"NRF5",
"%s" % board.get("build.mcu", "")[0:5].upper()
],
LIBPATH=[
join(FRAMEWORK_DIR, "cores", board.get("build.core"),
"SDK", "components", "toolchain", "gcc")
],
CPPPATH=[
join(FRAMEWORK_DIR, "cores", board.get("build.core")),
join(FRAMEWORK_DIR, "cores", board.get("build.core"),
"SDK", "components", "drivers_nrf", "delay"),
join(FRAMEWORK_DIR, "cores", board.get("build.core"),
"SDK", "components", "device"),
join(FRAMEWORK_DIR, "cores", board.get("build.core"),
"SDK", "components", "toolchain"),
join(FRAMEWORK_DIR, "cores", board.get("build.core"),
"SDK", "components", "toolchain", "CMSIS", "Include")
],
LINKFLAGS=[
"-Os",
"-Wl,--gc-sections",
"-mthumb",
"--specs=nano.specs",
"--specs=nosys.specs",
"-Wl,--check-sections",
"-Wl,--unresolved-symbols=report-all",
"-Wl,--warn-common",
"-Wl,--warn-section-align"
],
LIBSOURCE_DIRS=[join(FRAMEWORK_DIR, "libraries")],
LIBS=["m"]
)
if "BOARD" in env:
env.Append(
CCFLAGS=[
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
],
LINKFLAGS=[
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
]
)
if board.get("build.cpu") == "cortex-m4":
env.Append(
CCFLAGS=[
"-mfloat-abi=softfp",
"-mfpu=fpv4-sp-d16"
],
LINKFLAGS=[
"-mfloat-abi=softfp",
"-mfpu=fpv4-sp-d16"
]
)
# Process softdevice options
softdevice_ver = None
ldscript_path = None
cpp_defines = env.Flatten(env.get("CPPDEFINES", []))
if "NRF52_S132" in cpp_defines:
softdevice_ver = "s132"
elif "NRF51_S130" in cpp_defines:
softdevice_ver = "s130"
elif "NRF51_S110" in cpp_defines:
softdevice_ver = "s110"
if softdevice_ver:
env.Append(
CPPPATH=[
join(FRAMEWORK_DIR, "cores", board.get("build.core"),
"SDK", "components", "softdevice", softdevice_ver, "headers")
],
CPPDEFINES=["%s" % softdevice_ver.upper()]
)
hex_path = join(FRAMEWORK_DIR, "cores", board.get("build.core"),
"SDK", "components", "softdevice", softdevice_ver, "hex")
for f in listdir(hex_path):
if f.endswith(".hex") and f.lower().startswith(softdevice_ver):
env.Append(SOFTDEVICEHEX=join(hex_path, f))
if "SOFTDEVICEHEX" not in env:
print("Warning! Cannot find an appropriate softdevice binary!")
# Update linker script:
ldscript_dir = join(FRAMEWORK_DIR, "cores",
board.get("build.core"), "SDK",
"components", "softdevice", softdevice_ver,
"toolchain", "armgcc")
mcu_family = board.get("build.arduino.ldscript", "").split("_")[1]
for f in listdir(ldscript_dir):
if f.endswith(mcu_family) and softdevice_ver in f.lower():
ldscript_path = join(ldscript_dir, f)
if not ldscript_path:
print("Warning! Cannot find an appropriate linker script for the "
"required softdevice!")
if not board.get("build.ldscript", ""):
# if SoftDevice is not specified use default ld script from the framework
env.Replace(LDSCRIPT_PATH=ldscript_path or board.get("build.arduino.ldscript", ""))
# Select crystal oscillator as the low frequency source by default
clock_options = ("USE_LFXO", "USE_LFRC", "USE_LFSYNT")
if not any(d in clock_options for d in cpp_defines):
env.Append(CPPDEFINES=["USE_LFXO"])
#
# Target: Build Core Library
#
libs = []
if "build.variant" in board:
variants_dir = join(
"$PROJECT_DIR", board.get("build.variants_dir")) if board.get(
"build.variants_dir", "") else join(FRAMEWORK_DIR, "variants")
env.Append(
CPPPATH=[
join(variants_dir, board.get("build.variant"))
]
)
libs.append(env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduinoVariant"),
join(variants_dir, board.get("build.variant"))
))
libs.append(
env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduino"),
join(FRAMEWORK_DIR, "cores", board.get("build.core"))))
env.Prepend(LIBS=libs)

View File

@@ -1,37 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
mbed
The mbed framework The mbed SDK has been designed to provide enough
hardware abstraction to be intuitive and concise, yet powerful enough to
build complex projects. It is built on the low-level ARM CMSIS APIs,
allowing you to code down to the metal if needed. In addition to RTOS,
USB and Networking libraries, a cookbook of hundreds of reusable
peripheral and module libraries have been built on top of the SDK by
the mbed Developer Community.
http://mbed.org/
"""
from os.path import join
from SCons.Script import Import, SConscript
Import("env")
# https://github.com/platformio/builder-framework-mbed.git
SConscript(
join(env.PioPlatform().get_package_dir("framework-mbed"), "platformio",
"platformio-build.py"))

View File

@@ -1,30 +0,0 @@
# Copyright 2019-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
The Zephyr Project is a scalable real-time operating system (RTOS) supporting multiple
hardware architectures, optimized for resource constrained devices, and built with
safety and security in mind.
https://github.com/zephyrproject-rtos/zephyr
"""
from os.path import join
from SCons.Script import Import, SConscript
Import("env")
SConscript(
join(env.PioPlatform().get_package_dir("framework-zephyr"), "scripts",
"platformio", "platformio-build.py"), exports="env")

View File

@@ -1,448 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from platform import system
from os import makedirs
from os.path import isdir, join, basename
from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, AlwaysBuild,
Builder, Default, DefaultEnvironment)
from platformio.public import list_serial_ports
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
env.AutodetectUploadPort()
upload_options = {}
if "BOARD" in env:
upload_options = env.BoardConfig().get("upload", {})
if not bool(upload_options.get("disable_flushing", False)):
env.FlushSerialBuffer("$UPLOAD_PORT")
before_ports = list_serial_ports()
if bool(upload_options.get("use_1200bps_touch", False)):
env.TouchSerialPort("$UPLOAD_PORT", 1200)
if bool(upload_options.get("wait_for_upload_port", False)):
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports))
# use only port name for BOSSA
if ("/" in env.subst("$UPLOAD_PORT") and
env.subst("$UPLOAD_PROTOCOL") == "sam-ba"):
env.Replace(UPLOAD_PORT=basename(env.subst("$UPLOAD_PORT")))
env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()
variant = board.get("build.variant", "")
env.Replace(
AR="arm-none-eabi-ar",
AS="arm-none-eabi-as",
CC="arm-none-eabi-gcc",
CXX="arm-none-eabi-g++",
GDB="arm-none-eabi-gdb",
OBJCOPY="arm-none-eabi-objcopy",
RANLIB="arm-none-eabi-ranlib",
SIZETOOL="arm-none-eabi-size",
ARFLAGS=["rc"],
SIZEPROGREGEXP=r"^(?:\.text|\.data|\.rodata|\.text.align|\.ARM.exidx)\s+(\d+).*",
SIZEDATAREGEXP=r"^(?:\.data|\.bss|\.noinit)\s+(\d+).*",
SIZECHECKCMD="$SIZETOOL -A -d $SOURCES",
SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES',
ERASEFLAGS=["--eraseall", "-f", "nrf52"],
ERASECMD="nrfjprog $ERASEFLAGS",
PROGSUFFIX=".elf"
)
# Allow user to override via pre:script
if env.get("PROGNAME", "program") == "program":
env.Replace(PROGNAME="firmware")
env.Append(
BUILDERS=dict(
ElfToBin=Builder(
action=env.VerboseAction(" ".join([
"$OBJCOPY",
"-O",
"binary",
"$SOURCES",
"$TARGET"
]), "Building $TARGET"),
suffix=".bin"
),
ElfToHex=Builder(
action=env.VerboseAction(" ".join([
"$OBJCOPY",
"-O",
"ihex",
"-R",
".eeprom",
"$SOURCES",
"$TARGET"
]), "Building $TARGET"),
suffix=".hex"
),
MergeHex=Builder(
action=env.VerboseAction(" ".join([
'"%s"' % join(platform.get_package_dir("tool-sreccat") or "",
"srec_cat"),
"$SOFTDEVICEHEX",
"-intel",
"$SOURCES",
"-intel",
"-o",
"$TARGET",
"-intel",
"--line-length=44"
]), "Building $TARGET"),
suffix=".hex"
)
)
)
upload_protocol = env.subst("$UPLOAD_PROTOCOL")
if "nrfutil" == upload_protocol or (
board.get("build.bsp.name", "nrf5") == "adafruit"
and "arduino" in env.get("PIOFRAMEWORK", [])
):
env.Append(
BUILDERS=dict(
PackageDfu=Builder(
action=env.VerboseAction(" ".join([
'"$PYTHONEXE"',
'"%s"' % join(platform.get_package_dir(
"tool-adafruit-nrfutil") or "", "adafruit-nrfutil.py"),
"dfu",
"genpkg",
"--dev-type",
"0x0052",
"--sd-req",
board.get("build.softdevice.sd_fwid"),
"--application",
"$SOURCES",
"$TARGET"
]), "Building $TARGET"),
suffix=".zip"
),
SignBin=Builder(
action=env.VerboseAction(
" ".join(
[
'"$PYTHONEXE"',
'"%s"' % join(
platform.get_package_dir(
"framework-arduinoadafruitnrf52"
)
or "",
"tools",
"pynrfbintool",
"pynrfbintool.py",
),
"--signature",
"$TARGET",
"$SOURCES",
]
),
"Signing $SOURCES",
),
suffix="_signature.bin",
),
)
)
if not env.get("PIOFRAMEWORK"):
env.SConscript("frameworks/_bare.py")
#
# Target: Build executable and linkable firmware
#
if "zephyr" in env.get("PIOFRAMEWORK", []):
env.SConscript(
join(platform.get_package_dir(
"framework-zephyr"), "scripts", "platformio", "platformio-build-pre.py"),
exports={"env": env}
)
target_elf = None
if "nobuild" in COMMAND_LINE_TARGETS:
target_elf = join("$BUILD_DIR", "${PROGNAME}.elf")
target_firm = join("$BUILD_DIR", "${PROGNAME}.hex")
else:
target_elf = env.BuildProgram()
if "SOFTDEVICEHEX" in env:
target_firm = env.MergeHex(
join("$BUILD_DIR", "${PROGNAME}"),
env.ElfToHex(join("$BUILD_DIR", "userfirmware"), target_elf))
elif "nrfutil" == upload_protocol:
target_firm = env.PackageDfu(
join("$BUILD_DIR", "${PROGNAME}"),
env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf))
elif "nrfjprog" == upload_protocol:
target_firm = env.ElfToHex(
join("$BUILD_DIR", "${PROGNAME}"), target_elf)
elif "sam-ba" == upload_protocol:
target_firm = env.ElfToBin(join("$BUILD_DIR", "${PROGNAME}"), target_elf)
else:
if "DFUBOOTHEX" in env:
target_firm = env.SignBin(
join("$BUILD_DIR", "${PROGNAME}"),
env.ElfToBin(join("$BUILD_DIR", "${PROGNAME}"), target_elf))
else:
target_firm = env.ElfToHex(
join("$BUILD_DIR", "${PROGNAME}"), target_elf)
env.Depends(target_firm, "checkprogsize")
AlwaysBuild(env.Alias("nobuild", target_firm))
target_buildprog = env.Alias("buildprog", target_firm, target_firm)
if "DFUBOOTHEX" in env:
env.Append(
# Check the linker script for the correct location
BOOT_SETTING_ADDR=board.get("build.bootloader.settings_addr", "0x7F000")
)
env.AddPlatformTarget(
"dfu",
env.PackageDfu(
join("$BUILD_DIR", "${PROGNAME}"),
env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf),
),
target_firm,
"Generate DFU Image",
)
env.AddPlatformTarget(
"bootloader",
None,
[
env.VerboseAction(
"nrfjprog --program $DFUBOOTHEX -f nrf52 --chiperase",
"Uploading $DFUBOOTHEX",
),
env.VerboseAction(
"nrfjprog --erasepage $BOOT_SETTING_ADDR -f nrf52",
"Erasing bootloader config",
),
env.VerboseAction(
"nrfjprog --memwr $BOOT_SETTING_ADDR --val 0x00000001 -f nrf52",
"Disable CRC check",
),
env.VerboseAction("nrfjprog --reset -f nrf52", "Reset nRF52"),
],
"Burn Bootloader",
)
if "bootloader" in COMMAND_LINE_TARGETS and "DFUBOOTHEX" not in env:
sys.stderr.write("Error. The board is missing the bootloader binary.\n")
env.Exit(1)
#
# Target: Print binary size
#
target_size = env.AddPlatformTarget(
"size",
target_elf,
env.VerboseAction("$SIZEPRINTCMD", "Calculating size $SOURCE"),
"Program Size",
"Calculate program size",
)
#
# Target: Upload by default .bin file
#
debug_tools = env.BoardConfig().get("debug.tools", {})
upload_actions = []
if upload_protocol == "mbed":
upload_actions = [
env.VerboseAction(env.AutodetectUploadPort, "Looking for upload disk..."),
env.VerboseAction(env.UploadToDisk, "Uploading $SOURCE")
]
elif upload_protocol.startswith("blackmagic"):
env.Replace(
UPLOADER="$GDB",
UPLOADERFLAGS=[
"-nx",
"--batch",
"-ex", "target extended-remote $UPLOAD_PORT",
"-ex", "monitor %s_scan" %
("jtag" if upload_protocol == "blackmagic-jtag" else "swdp"),
"-ex", "attach 1",
"-ex", "load",
"-ex", "compare-sections",
"-ex", "kill"
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS $BUILD_DIR/${PROGNAME}.elf"
)
upload_actions = [
env.VerboseAction(env.AutodetectUploadPort, "Looking for BlackMagic port..."),
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")
]
elif upload_protocol == "nrfjprog":
env.Replace(
UPLOADER="nrfjprog",
UPLOADERFLAGS=[
"--sectorerase" if "DFUBOOTHEX" in env else "--chiperase",
"--reset"
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS --program $SOURCE"
)
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]
elif upload_protocol == "nrfutil":
env.Replace(
UPLOADER=join(platform.get_package_dir(
"tool-adafruit-nrfutil") or "", "adafruit-nrfutil.py"),
UPLOADERFLAGS=[
"dfu",
"serial",
"-p",
"$UPLOAD_PORT",
"-b",
"$UPLOAD_SPEED",
"--singlebank",
],
UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS -pkg $SOURCE'
)
upload_actions = [
env.VerboseAction(BeforeUpload, "Looking for upload port..."),
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")
]
elif upload_protocol == "sam-ba":
env.Replace(
UPLOADER="bossac",
UPLOADERFLAGS=[
"--port", '"$UPLOAD_PORT"', "--write", "--erase", "-U", "--reset"
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES"
)
if int(ARGUMENTS.get("PIOVERBOSE", 0)):
env.Prepend(UPLOADERFLAGS=["--info", "--debug"])
upload_actions = [
env.VerboseAction(BeforeUpload, "Looking for upload port..."),
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")
]
elif upload_protocol.startswith("jlink"):
def _jlink_cmd_script(env, source):
build_dir = env.subst("$BUILD_DIR")
if not isdir(build_dir):
makedirs(build_dir)
script_path = join(build_dir, "upload.jlink")
commands = ["h"]
if "DFUBOOTHEX" in env:
commands.append("loadbin %s,%s" % (str(source).replace("_signature", ""),
env.BoardConfig().get("upload.offset_address", "0x26000")))
commands.append("loadbin %s,%s" % (source, env.get("BOOT_SETTING_ADDR")))
else:
commands.append("loadbin %s,%s" % (source, env.BoardConfig().get(
"upload.offset_address", "0x0")))
commands.append("r")
commands.append("q")
with open(script_path, "w") as fp:
fp.write("\n".join(commands))
return script_path
env.Replace(
__jlink_cmd_script=_jlink_cmd_script,
UPLOADER="JLink.exe" if system() == "Windows" else "JLinkExe",
UPLOADERFLAGS=[
"-device", env.BoardConfig().get("debug", {}).get("jlink_device"),
"-speed", env.GetProjectOption("debug_speed", "4000"),
"-if", ("jtag" if upload_protocol == "jlink-jtag" else "swd"),
"-autoconnect", "1",
"-NoGui", "1"
],
UPLOADCMD='$UPLOADER $UPLOADERFLAGS -CommanderScript "${__jlink_cmd_script(__env__, SOURCE)}"'
)
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]
elif upload_protocol in debug_tools:
openocd_args = [
"-d%d" % (2 if int(ARGUMENTS.get("PIOVERBOSE", 0)) else 1)
]
openocd_args.extend(
debug_tools.get(upload_protocol).get("server").get("arguments", []))
if env.GetProjectOption("debug_speed"):
openocd_args.extend(
["-c", "adapter speed %s" % env.GetProjectOption("debug_speed")]
)
openocd_args.extend([
"-c", "program {$SOURCE} %s verify reset; shutdown;" %
board.get("upload.offset_address", "")
])
openocd_args = [
f.replace("$PACKAGE_DIR",
platform.get_package_dir("tool-openocd") or "")
for f in openocd_args
]
env.Replace(
UPLOADER="openocd",
UPLOADERFLAGS=openocd_args,
UPLOADCMD="$UPLOADER $UPLOADERFLAGS")
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]
# custom upload tool
elif upload_protocol == "custom":
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]
else:
sys.stderr.write("Warning! Unknown upload protocol %s\n" % upload_protocol)
env.AddPlatformTarget("upload", target_firm, upload_actions, "Upload")
#
# Target: Erase Flash
#
env.AddPlatformTarget(
"erase", None, env.VerboseAction("$ERASECMD", "Erasing..."), "Erase Flash")
#
# Information about obsolete method of specifying linker scripts
#
if any("-Wl,-T" in f for f in env.get("LINKFLAGS", [])):
print("Warning! '-Wl,-T' option for specifying linker scripts is deprecated. "
"Please use 'board_build.ldscript' option in your 'platformio.ini' file.")
#
# Default targets
#
Default([target_buildprog, target_size])

View File

@@ -1,21 +0,0 @@
How to build PlatformIO based project
=====================================
1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html)
2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf52/archive/develop.zip)
3. Extract ZIP archive
4. Run these commands:
```shell
# Change directory to example
$ cd platform-nordicnrf52/examples/arduino-ble-led
# Build project
$ pio run
# Upload firmware
$ pio run --target upload
# Clean build files
$ pio run --target clean
```

View File

@@ -1,39 +0,0 @@
This directory is intended for project header files.
A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.
```src/main.c
#include "header.h"
int main (void)
{
...
}
```
Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.
In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.
Read more about using header files in official GCC documentation:
* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

View File

@@ -1,46 +0,0 @@
This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.
The source code of each library should be placed in a an own separate directory
("lib/your_library_name/[here are source files]").
For example, see a structure of the following two libraries `Foo` and `Bar`:
|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c
and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>
int main (void)
{
...
}
```
PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.
More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html

View File

@@ -1,28 +0,0 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env]
lib_deps = sandeepmistry/BLEPeripheral @ ^0.4.0
lib_compat_mode = soft
build_flags = -DNRF52_S132
[env:nrf52_dk]
platform = nordicnrf52
framework = arduino
board = nrf52_dk
[env:redbear_blenano2]
platform = nordicnrf52
framework = arduino
board = redbear_blenano2
[env:stct_nrf52_minidev]
platform = nordicnrf52
framework = arduino
board = stct_nrf52_minidev

View File

@@ -1,70 +0,0 @@
// Copyright (c) Sandeep Mistry. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include <Arduino.h>
// Import libraries (BLEPeripheral depends on SPI)
#include <SPI.h>
#include <BLEPeripheral.h>
// LED pin
#define LED_PIN LED_BUILTIN
//custom boards may override default pin definitions with BLEPeripheral(PIN_REQ, PIN_RDY, PIN_RST)
BLEPeripheral blePeripheral = BLEPeripheral();
// create service
BLEService ledService = BLEService("19b10000e8f2537e4f6cd104768a1214");
// create switch characteristic
BLECharCharacteristic switchCharacteristic = BLECharCharacteristic("19b10001e8f2537e4f6cd104768a1214", BLERead | BLEWrite);
void setup() {
Serial.begin(9600);
#if defined (__AVR_ATmega32U4__)
delay(5000); //5 seconds delay for enabling to see the start up comments on the serial board
#endif
// set LED pin to output mode
pinMode(LED_PIN, OUTPUT);
// set advertised local name and service UUID
blePeripheral.setLocalName("LED");
blePeripheral.setAdvertisedServiceUuid(ledService.uuid());
// add service and characteristic
blePeripheral.addAttribute(ledService);
blePeripheral.addAttribute(switchCharacteristic);
// begin initialization
blePeripheral.begin();
Serial.println(F("BLE LED Peripheral"));
}
void loop() {
BLECentral central = blePeripheral.central();
if (central) {
// central connected to peripheral
Serial.print(F("Connected to central: "));
Serial.println(central.address());
while (central.connected()) {
// central still connected to peripheral
if (switchCharacteristic.written()) {
// central wrote new value to characteristic, update LED
if (switchCharacteristic.value()) {
Serial.println(F("LED on"));
digitalWrite(LED_PIN, HIGH);
} else {
Serial.println(F("LED off"));
digitalWrite(LED_PIN, LOW);
}
}
}
// central disconnected
Serial.print(F("Disconnected from central: "));
Serial.println(central.address());
}
}

View File

@@ -1,11 +0,0 @@
This directory is intended for PIO Unit Testing and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PIO Unit Testing:
- https://docs.platformio.org/page/plus/unit-testing.html

View File

@@ -1,21 +0,0 @@
How to build PlatformIO based project
=====================================
1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html)
2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf52/archive/develop.zip)
3. Extract ZIP archive
4. Run these commands:
```shell
# Change directory to example
$ cd platform-nordicnrf52/examples/arduino-blink
# Build project
$ pio run
# Upload firmware
$ pio run --target upload
# Clean build files
$ pio run --target clean
```

View File

@@ -1,39 +0,0 @@
This directory is intended for project header files.
A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.
```src/main.c
#include "header.h"
int main (void)
{
...
}
```
Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.
In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.
Read more about using header files in official GCC documentation:
* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

View File

@@ -1,46 +0,0 @@
This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.
The source code of each library should be placed in a an own separate directory
("lib/your_library_name/[here are source files]").
For example, see a structure of the following two libraries `Foo` and `Bar`:
|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c
and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>
int main (void)
{
...
}
```
PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.
More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html

View File

@@ -1,45 +0,0 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:bbcmicrobit_v2]
platform = nordicnrf52
framework = arduino
board = bbcmicrobit_v2
[env:dwm1001_dev]
platform = nordicnrf52
framework = arduino
board = dwm1001_dev
[env:nrf52_dk]
platform = nordicnrf52
framework = arduino
board = nrf52_dk
[env:delta_dfbm_nq620]
platform = nordicnrf52
framework = arduino
board = delta_dfbm_nq620
[env:redbear_blenano2]
platform = nordicnrf52
framework = arduino
board = redbear_blenano2
[env:redbear_blend2]
platform = nordicnrf52
framework = arduino
board = redbear_blend2
build_flags = -DNRF52_S132
[env:stct_nrf52_minidev]
platform = nordicnrf52
framework = arduino
board = stct_nrf52_minidev
build_flags = -DNRF52_S132

View File

@@ -1,25 +0,0 @@
/*
* Blink
* Turns on an LED on for one second,
* then off for one second, repeatedly.
*/
#include <Arduino.h>
void setup()
{
// initialize LED digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
// turn the LED on (HIGH is the voltage level)
digitalWrite(LED_BUILTIN, HIGH);
// wait for a second
delay(100);
// turn the LED off by making the voltage LOW
digitalWrite(LED_BUILTIN, LOW);
// wait for a second
delay(100);
}

View File

@@ -1,11 +0,0 @@
This directory is intended for PIO Unit Testing and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PIO Unit Testing:
- https://docs.platformio.org/page/plus/unit-testing.html

View File

@@ -1,39 +0,0 @@
This directory is intended for project header files.
A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.
```src/main.c
#include "header.h"
int main (void)
{
...
}
```
Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.
In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.
Read more about using header files in official GCC documentation:
* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

View File

@@ -1,46 +0,0 @@
This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.
The source code of each library should be placed in a an own separate directory
("lib/your_library_name/[here are source files]").
For example, see a structure of the following two libraries `Foo` and `Bar`:
|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c
and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>
int main (void)
{
...
}
```
PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.
More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html

View File

@@ -1,50 +0,0 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:adafruit_feather_nrf52832]
platform = nordicnrf52
framework = arduino
board = adafruit_feather_nrf52832
monitor_speed = 115200
[env:adafruit_feather_nrf52840]
platform = nordicnrf52
framework = arduino
board = adafruit_feather_nrf52840
monitor_speed = 115200
[env:nrf52840_dk_adafruit]
platform = nordicnrf52
framework = arduino
board = nrf52840_dk_adafruit
monitor_speed = 115200
[env:adafruit_metro_nrf52840]
platform = nordicnrf52
framework = arduino
board = adafruit_metro_nrf52840
monitor_speed = 115200
[env:adafruit_cplaynrf52840]
platform = nordicnrf52
framework = arduino
board = adafruit_cplaynrf52840
monitor_speed = 115200
[env:particle_xenon]
platform = nordicnrf52
framework = arduino
board = particle_xenon
monitor_speed = 115200
[env:adafruit_ledglasses_nrf52840]
platform = nordicnrf52
framework = arduino
board = adafruit_ledglasses_nrf52840
monitor_speed = 115200

View File

@@ -1,148 +0,0 @@
/*********************************************************************
This is an example for our nRF52 based Bluefruit LE modules
Pick one up today in the adafruit shop!
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
MIT license, check LICENSE for more information
All text above, and the splash screen below must be included in
any redistribution
*********************************************************************/
#include <bluefruit.h>
// BLE Service
BLEDfu bledfu; // OTA DFU service
BLEDis bledis; // device information
BLEUart bleuart; // uart over ble
BLEBas blebas; // battery
static void startAdv(void);
static void connect_callback(uint16_t conn_handle);
static void disconnect_callback(uint16_t conn_handle, uint8_t reason);
void setup()
{
Serial.begin(115200);
while ( !Serial ) delay(10); // for nrf52840 with native usb
Serial.println("Bluefruit52 BLEUART Example");
Serial.println("---------------------------\n");
// Setup the BLE LED to be enabled on CONNECT
// Note: This is actually the default behaviour, but provided
// here in case you want to control this LED manually via PIN 19
Bluefruit.autoConnLed(true);
// Config the peripheral connection with maximum bandwidth
// more SRAM required by SoftDevice
// Note: All config***() function must be called before begin()
Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
Bluefruit.begin();
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
Bluefruit.setName("Bluefruit52");
//Bluefruit.setName(getMcuUniqueID()); // useful testing with multiple central connections
Bluefruit.Periph.setConnectCallback(connect_callback);
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
// To be consistent OTA DFU should be added first if it exists
bledfu.begin();
// Configure and Start Device Information Service
bledis.setManufacturer("Adafruit Industries");
bledis.setModel("Bluefruit Feather52");
bledis.begin();
// Configure and Start BLE Uart Service
bleuart.begin();
// Start BLE Battery Service
blebas.begin();
blebas.write(100);
// Set up and start advertising
startAdv();
Serial.println("Please use Adafruit's Bluefruit LE app to connect in UART mode");
Serial.println("Once connected, enter character(s) that you wish to send");
}
void startAdv(void)
{
// Advertising packet
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
Bluefruit.Advertising.addTxPower();
// Include bleuart 128-bit uuid
Bluefruit.Advertising.addService(bleuart);
// Secondary Scan Response packet (optional)
// Since there is no room for 'Name' in Advertising packet
Bluefruit.ScanResponse.addName();
/* Start Advertising
* - Enable auto advertising if disconnected
* - Interval: fast mode = 20 ms, slow mode = 152.5 ms
* - Timeout for fast mode is 30 seconds
* - Start(timeout) with timeout = 0 will advertise forever (until connected)
*
* For recommended advertising interval
* https://developer.apple.com/library/content/qa/qa1931/_index.html
*/
Bluefruit.Advertising.restartOnDisconnect(true);
Bluefruit.Advertising.setInterval(32, 244); // in unit of 0.625 ms
Bluefruit.Advertising.setFastTimeout(30); // number of seconds in fast mode
Bluefruit.Advertising.start(0); // 0 = Don't stop advertising after n seconds
}
void loop()
{
// Forward data from HW Serial to BLEUART
while (Serial.available())
{
// Delay to wait for enough input, since we have a limited transmission buffer
delay(2);
uint8_t buf[64];
int count = Serial.readBytes(buf, sizeof(buf));
bleuart.write( buf, count );
}
// Forward from BLEUART to HW Serial
while ( bleuart.available() )
{
uint8_t ch;
ch = (uint8_t) bleuart.read();
Serial.write(ch);
}
}
// callback invoked when central connects
void connect_callback(uint16_t conn_handle)
{
// Get the reference to current connection
BLEConnection* connection = Bluefruit.Connection(conn_handle);
char central_name[32] = { 0 };
connection->getPeerName(central_name, sizeof(central_name));
Serial.print("Connected to ");
Serial.println(central_name);
}
/**
* Callback invoked when a connection is dropped
* @param conn_handle connection where this event happens
* @param reason is a BLE_HCI_STATUS_CODE which can be found in ble_hci.h
*/
void disconnect_callback(uint16_t conn_handle, uint8_t reason)
{
(void) conn_handle;
(void) reason;
Serial.println();
Serial.println("Disconnected");
}

View File

@@ -1,11 +0,0 @@
This directory is intended for PIO Unit Testing and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PIO Unit Testing:
- https://docs.platformio.org/page/plus/unit-testing.html

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,72 +0,0 @@
# Arduino-u-blox-NINA-B1
u-blox NINA-B1 Arduino example + SHT31 temperature and humidity + Bluetooth BLE
[![GitHub version](https://img.shields.io/github/release/ldab/Arduino-u-blox-NINA-B1.svg)](https://github.com/ldab/Arduino-u-blox-NINA-B1/releases/latest)
[![Build Status](https://travis-ci.org/ldab/Arduino-u-blox-NINA-B1.svg?branch=master)](https://travis-ci.org/ldab/Arduino-u-blox-NINA-B1)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/ldab/Arduino-u-blox-NINA-B1/blob/master/LICENSE)
[![GitHub last commit](https://img.shields.io/github/last-commit/ldab/Arduino-u-blox-NINA-B1.svg?style=social)](https://github.com/ldab/Arduino-u-blox-NINA-B1)
[![EVK-NINA-B1](https://www.u-blox.com/sites/default/files/styles/product_full/public/products/EVK-NINA-B1_2D-medium_RGB-CI.png)](https://www.u-blox.com/en/product/nina-b1-series)
## How to build PlatformIO based project
1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html)
2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf52/archive/develop.zip)
3. Extract ZIP archive
4. Run these commands:
```
# Change directory to example
> cd platform-nordicnrf52/examples/Arduino-u-blox-NINA-B1
# Build project
> platformio run
# Upload firmware
> platformio run --target upload
# Build specific environment
> platformio run -e nina_b1
# Upload firmware for the specific environment
> platformio run -e nina_b1 --target upload
# Clean build files
> platformio run --target clean
```
## Why?
This example tries to implement some key functions and key PIN atributes in order to get you started with using Arduino and the NRF52832 BLE board u-blox NINA-B1.
Timer functionas are implemented intead of `delay()` and the PINs have been re-mapped on the `#define` section
## Bluetooth iOS and Android app
You can download the sample Bluetooth low energy app - BLE App straight from u-blox wesite: [https://www.u-blox.com/en/product/bluetooth-ios-and-android-app](https://www.u-blox.com/en/product/bluetooth-ios-and-android-app)
![App example](https://raw.githubusercontent.com/ldab/Arduino-u-blox-NINA-B1/master/extras/Screenshot_20190328-130832_u-blox%20BLE.jpg)
## fatal error: ble_gatts.h: No such file or directory
The arduino-nRF5x core **REQUIRES** a SoftDevice in order to successfully use this library. Please see [Flashing a SoftDevice](https://github.com/sandeepmistry/arduino-nRF5#selecting-a-softdevice).
On PlatformIO and when using this example you don't need to do anything special as the `build_flags = -DNRF52_S132` has already been included on `platform.ini` file.
SoftDevices contain the BLE stack and housekeeping, and must be downloaded once before a sketch using BLE can be loaded. The SD consumes ~5k of Ram + some extra based on actual BLE configuration.
* SoftDevice S132 v2.0.1 supports nRF52 in peripheral and central role. It is 112k in size.
## Credits
Github Shields and Badges created with [Shields.io](https://github.com/badges/shields/)
Sandeep Mistry's [Arduino BLE library](https://github.com/sandeepmistry/arduino-BLEPeripheral)
Adafruit [SHT31 Library](https://www.adafruit.com/product/2857)
u-blox NINA-B1 blueprint example [GitHub](https://github.com/u-blox/blueprint-B200-NINA-B1)
u-blox official mBed [library](https://os.mbed.com/platforms/u-blox-EVK-NINA-B1/)

View File

@@ -1,27 +0,0 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:nina_b1]
platform = nordicnrf52
board = ublox_evk_nina_b1
framework = arduino
build_flags = -DNRF52_S132
lib_compat_mode = soft
lib_deps =
SPI
adafruit/Adafruit SHT31 Library @ ^2.0.0
sstaub/Ticker @ ^3.2.0
sandeepmistry/BLEPeripheral @ ^0.4.0
monitor_speed = 115200
# upload_protocol = blackmagic

View File

@@ -1,243 +0,0 @@
/******************************************************************************
u-blox NINA-B1 Arduino example
Leonardo Bispo
March - 2019
https://github.com/ldab/Arduino-u-blox-NINA-B1
Distributed as-is; no warranty is given.
This example tries to implement some key functions and key PIN atributes in order
to get you started with using Arduino and the NRF52832 board u-blox NINA-B1
Timer functionas are implemented intead of delay() and the PINs have been re-mapped
on the #define section
******************************************************************************/
#include <Arduino.h>
#include "BLEPeripheral.h"
#include "Ticker.h"
#include "Adafruit_SHT31.h"
// Since the u-blox NINA-B1 board uses the generic Arduino variant, we need to reassing the pins;
// pins below are accordingly to the EVK-NINA-B1 board https://www.u-blox.com/en/product/evk-nina-b1
#define NINA_RX 5 // P0.05 - GPIO23
#define NINA_TX 6 // P0.06 - GPIO22
#define NINA_SDA 2 // P0.02 - GPIO24
#define NINA_SCL 3 // P0.03 - GPIO25
#define LED_DS1 7 // P0.07 - GPIO21
#define LED_DS2 31 // P0.31 - GPIO31
#define RGB_R 8 // P0.08 - GPIO1 SPI_CS1
#define RGB_G 16 // P0.16 - GPIO7 BOOT_I - *THIS PIN IS SHARED WITH SWITCH 1*
#define RGB_B 18 // P0.18 - GPIO8 SWO_I
#define B_SW1 16 // P.016 - GPIO7 - SWITCH 1 - *THIS PIN IS SHARED WITH RGB GREEN*
#define B_SW2 30 // P.030 - GPIO18 - SWITCH 2
// ********************************** BLE Stuff ******************************************************
const char * localName = "NINA-B1";
BLEPeripheral blePeriph = BLEPeripheral();
BLEService tempSer = BLEService("FFE0");
BLEIntCharacteristic tempCharac = BLEIntCharacteristic("FFE1", BLERead | BLENotify);
BLEDescriptor tempDesc = BLEDescriptor("2901", "Temperature");
BLEService humSer = BLEService("DDD0");
BLEFloatCharacteristic humCharac = BLEFloatCharacteristic("DDD1", BLERead | BLENotify);
BLEDescriptor humDes = BLEDescriptor("2901", "Humidity Percent");
BLEService RGBSer = BLEService("FFD0");
BLECharCharacteristic redCharac = BLECharCharacteristic("FFD1", BLERead | BLEWrite );
BLECharCharacteristic greenCharac = BLECharCharacteristic("FFD2", BLERead | BLEWrite );
//****************************************************************************************************
// Initialize the Temperature and Humidity Sensor SHT31
Adafruit_SHT31 sht31 = Adafruit_SHT31();
// Create functions prior to calling them as .cpp files are differnt from Arduino .ino
void setupBLE ( void );
void blinky ( void );
void colorLED ( void );
void readSensor ( void );
void GreenCharacWritten(BLECentral& central, BLECharacteristic& characteristic);
void RedCharacWritten(BLECentral& central, BLECharacteristic& characteristic);
// Create timers using Ticker library in oder to avoid delay()
Ticker blinkLED ( blinky, 600 );
Ticker readIT ( readSensor, 5000 );
// Declare Global variables
float t = NAN;
float h = NAN;
bool LED = false;
bool LED_ACTIVE = false;
// Double clich switch 2 to turn RGB off variables
uint32_t turnRGBoff = 1000;
uint32_t startLED = 0;
// Put your code here to run once
void setup()
{
// initialize LEDs pin as Outputs, Active LOW
pinMode(LED_DS1, OUTPUT);
pinMode(LED_DS2, OUTPUT);
pinMode(RGB_R, OUTPUT);
pinMode(RGB_G, OUTPUT);
pinMode(RGB_B, OUTPUT);
digitalWrite(RGB_B, HIGH);
digitalWrite(RGB_G, HIGH);
digitalWrite(RGB_R, HIGH);
// initialize Switch 2 as input, double click to turn RGB off
pinMode(B_SW2, INPUT_PULLUP);
//attachInterrupt(B_SW2, colorLED, CHANGE); // this conflicts with BLE lib https://github.com/sandeepmistry/arduino-BLEPeripheral/issues/205
// Assign UART TX and RX pins accordingly
Serial.setPins(NINA_RX, NINA_TX);
Serial.begin(115200);
// Assign I2C pins accordingly and start sensor
Wire.setPins(NINA_SDA, NINA_SCL);
if (! sht31.begin(0x44) ) // Set to 0x45 for alternate i2c addr
{
Serial.println("Couldn't find SHT31");
}
// Set-up BLE Service
setupBLE();
// Start the Timer function to avoid using delay()
blinkLED.start();
readIT.start();
}
void loop()
{
// Keep feeding timers
blinkLED.update();
readIT.update();
// Constantly polls BLE
blePeriph.poll();
}
void setupBLE()
{
// Advertise name
blePeriph.setDeviceName(localName);
blePeriph.setLocalName(localName);
// Service for Temperature
blePeriph.setAdvertisedServiceUuid(tempSer.uuid());
blePeriph.addAttribute(tempSer);
blePeriph.addAttribute(tempCharac);
blePeriph.addAttribute(tempDesc);
// Service for Humidity
blePeriph.setAdvertisedServiceUuid(humSer.uuid());
blePeriph.addAttribute(humSer);
blePeriph.addAttribute(humCharac);
blePeriph.addAttribute(humDes);
// Service for RGB LED
blePeriph.setAdvertisedServiceUuid(RGBSer.uuid());
blePeriph.addAttribute(RGBSer);
blePeriph.addAttribute(greenCharac);
blePeriph.addAttribute(redCharac);
// Assign event handlers for characteristic
greenCharac.setEventHandler(BLEWritten, GreenCharacWritten);
redCharac.setEventHandler(BLEWritten, RedCharacWritten);
// One can also assign events for connection, etc...
//blePeriph.setEventHandler(BLEConnected, blePeripheralConnectHandler);
//blePeriph.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
blePeriph.begin();
Serial.println(F("BLE Temperature Sensor Peripheral"));
}
void colorLED( void )
{
// Check Switch 2 state and light randonly;
bool button2 = digitalRead(B_SW2);
if( !button2 )
{
analogWrite( RGB_R, random(255) );
analogWrite( RGB_G, random(255) );
analogWrite( RGB_B, random(255) );
if( millis() - startLED < turnRGBoff )
startLED = 0;
else
startLED = millis();
}
else if( startLED == 0 )
{
analogWrite( RGB_R, 255 );
analogWrite( RGB_G, 255 );
analogWrite( RGB_B, 255 );
}
}
void readSensor( void )
{
t = sht31.readTemperature();
h = sht31.readHumidity();
if (! isnan(t)) { // check if 'is not a number'
Serial.print("Temp ºC = "); Serial.println(t);
} else {
Serial.println("Failed to read temperature");
}
if (! isnan(h)) { // check if 'is not a number'
Serial.print("Hum. % = "); Serial.println(h);
} else {
Serial.println("Failed to read humidity");
}
Serial.println();
tempCharac.setValue(t);
humCharac.setValue(h);
}
void blinky( void )
{
// Toggle LED_DS1
digitalWrite(LED_DS1, LED);
// Toggle LED_DS2
digitalWrite(LED_DS2, !LED);
LED = !LED;
}
void GreenCharacWritten(BLECentral& central, BLECharacteristic& characteristic)
{
if ( greenCharac.value() )
analogWrite( RGB_G, 000 );
else
analogWrite( RGB_G, 255 );
}
void RedCharacWritten(BLECentral& central, BLECharacteristic& characteristic)
{
if ( redCharac.value() )
analogWrite( RGB_R, 000 );
else
analogWrite( RGB_R, 255 );
}

View File

@@ -1,21 +0,0 @@
How to build PlatformIO based project
=====================================
1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html)
2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf52/archive/develop.zip)
3. Extract ZIP archive
4. Run these commands:
```shell
# Change directory to example
$ cd platform-nordicnrf52/examples/arduino-serial-plotter
# Build project
$ pio run
# Upload firmware
$ pio run --target upload
# Clean build files
$ pio run --target clean
```

View File

@@ -1,39 +0,0 @@
This directory is intended for project header files.
A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.
```src/main.c
#include "header.h"
int main (void)
{
...
}
```
Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.
In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.
Read more about using header files in official GCC documentation:
* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

View File

@@ -1,46 +0,0 @@
This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.
The source code of each library should be placed in a an own separate directory
("lib/your_library_name/[here are source files]").
For example, see a structure of the following two libraries `Foo` and `Bar`:
|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c
and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>
int main (void)
{
...
}
```
PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.
More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html

View File

@@ -1,13 +0,0 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:nano33ble]
platform = nordicnrf52
framework = arduino
board = nano33ble

View File

@@ -1,65 +0,0 @@
/*
This example reads audio data from the on-board PDM microphones, and prints
out the samples to the Serial console. The Serial Plotter built into the
Arduino IDE can be used to plot the audio data (Tools -> Serial Plotter)
Circuit:
- Arduino Nano 33 BLE board
This example code is in the public domain.
*/
#include <Arduino.h>
#include <PDM.h>
// buffer to read samples into, each sample is 16-bits
short sampleBuffer[256];
void onPDMdata();
// number of samples read
volatile int samplesRead;
void setup() {
Serial.begin(9600);
while (!Serial);
// configure the data receive callback
PDM.onReceive(onPDMdata);
// optionally set the gain, defaults to 20
// PDM.setGain(30);
// initialize PDM with:
// - one channel (mono mode)
// - a 16 kHz sample rate
if (!PDM.begin(1, 16000)) {
Serial.println("Failed to start PDM!");
while (1);
}
}
void loop() {
// wait for samples to be read
if (samplesRead) {
// print samples to the serial monitor or plotter
for (int i = 0; i < samplesRead; i++) {
Serial.println(sampleBuffer[i]);
}
// clear the read count
samplesRead = 0;
}
}
void onPDMdata() {
// query the number of bytes available
int bytesAvailable = PDM.available();
// read into the sample buffer
PDM.read(sampleBuffer, bytesAvailable);
// 16-bit, 2 bytes per sample
samplesRead = bytesAvailable / 2;
}

Some files were not shown because too many files have changed in this diff Show More