Skip to content

Commit dfc924e

Browse files
committed
Merge branch 'release/v9.1.0'
2 parents 7e44f43 + 5eb0b91 commit dfc924e

30 files changed

Lines changed: 333 additions & 474 deletions

File tree

builder/frameworks/arduino

builder/main.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
5353
board = env.BoardConfig()
5454
variant = board.get("build.variant", "")
5555

56-
use_adafruit = board.get(
57-
"build.bsp.name", "nrf5") == "adafruit" and "arduino" in env.get("PIOFRAMEWORK", [])
58-
5956
env.Replace(
6057
AR="arm-none-eabi-ar",
6158
AS="arm-none-eabi-as",
@@ -125,7 +122,12 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
125122
)
126123
)
127124

128-
if use_adafruit:
125+
upload_protocol = env.subst("$UPLOAD_PROTOCOL")
126+
127+
if "nrfutil" == upload_protocol or (
128+
board.get("build.bsp.name", "nrf5") == "adafruit"
129+
and "arduino" in env.get("PIOFRAMEWORK", [])
130+
):
129131
env.Append(
130132
BUILDERS=dict(
131133
PackageDfu=Builder(
@@ -186,7 +188,6 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
186188
exports={"env": env}
187189
)
188190

189-
upload_protocol = env.subst("$UPLOAD_PROTOCOL")
190191
target_elf = None
191192
if "nobuild" in COMMAND_LINE_TARGETS:
192193
target_elf = join("$BUILD_DIR", "${PROGNAME}.elf")
@@ -198,7 +199,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
198199
target_firm = env.MergeHex(
199200
join("$BUILD_DIR", "${PROGNAME}"),
200201
env.ElfToHex(join("$BUILD_DIR", "userfirmware"), target_elf))
201-
elif "nrfutil" == upload_protocol and use_adafruit:
202+
elif "nrfutil" == upload_protocol:
202203
target_firm = env.PackageDfu(
203204
join("$BUILD_DIR", "${PROGNAME}"),
204205
env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf))

examples/arduino-ble-led/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
How to build PlatformIO based project
2+
=====================================
3+
4+
1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html)
5+
2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf52/archive/develop.zip)
6+
3. Extract ZIP archive
7+
4. Run these commands:
8+
9+
```shell
10+
# Change directory to example
11+
$ cd platform-nordicnrf52/examples/arduino-ble-led
12+
13+
# Build project
14+
$ pio run
15+
16+
# Upload firmware
17+
$ pio run --target upload
18+
19+
# Clean build files
20+
$ pio run --target clean
21+
```

examples/arduino-ble-led/README.rst

Lines changed: 0 additions & 32 deletions
This file was deleted.

examples/arduino-blink/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
How to build PlatformIO based project
2+
=====================================
3+
4+
1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html)
5+
2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf52/archive/develop.zip)
6+
3. Extract ZIP archive
7+
4. Run these commands:
8+
9+
```shell
10+
# Change directory to example
11+
$ cd platform-nordicnrf52/examples/arduino-blink
12+
13+
# Build project
14+
$ pio run
15+
16+
# Upload firmware
17+
$ pio run --target upload
18+
19+
# Clean build files
20+
$ pio run --target clean
21+
```

examples/arduino-blink/README.rst

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
How to build PlatformIO based project
2+
=====================================
3+
4+
1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html)
5+
2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf52/archive/develop.zip)
6+
3. Extract ZIP archive
7+
4. Run these commands:
8+
9+
```shell
10+
# Change directory to example
11+
$ cd platform-nordicnrf52/examples/arduino-serial-plotter
12+
13+
# Build project
14+
$ pio run
15+
16+
# Upload firmware
17+
$ pio run --target upload
18+
19+
# Clean build files
20+
$ pio run --target clean
21+
```

examples/arduino-serial-plotter/README.rst

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
How to build PlatformIO based project
2+
=====================================
3+
4+
1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html)
5+
2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf52/archive/develop.zip)
6+
3. Extract ZIP archive
7+
4. Run these commands:
8+
9+
```shell
10+
# Change directory to example
11+
$ cd platform-nordicnrf52/examples/mbed-legacy-examples/mbed-ble-thermometer
12+
13+
# Build project
14+
$ pio run
15+
16+
# Upload firmware
17+
$ pio run --target upload
18+
19+
# Build specific environment
20+
$ pio run -e nrf52_dk
21+
22+
# Upload firmware for the specific environment
23+
$ pio run -e nrf52_dk --target upload
24+
25+
# Clean build files
26+
$ pio run --target clean
27+
```

examples/mbed-legacy-examples/mbed-ble-thermometer/README.rst

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)