Skip to content

Commit a9df05f

Browse files
committed
Merge branch 'release/v4.2.1'
2 parents 3547367 + a2aa7b1 commit a9df05f

File tree

7 files changed

+131
-117
lines changed

7 files changed

+131
-117
lines changed

.github/workflows/examples.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Examples
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-16.04, windows-latest, macos-latest]
11+
python-version: [2.7, 3.7]
12+
example:
13+
- "examples/arduino-blink"
14+
- "examples/arduino-ble-led"
15+
- "examples/arduino-bluefruit-bleuart"
16+
- "examples/arduino-nina-b1-generic-example"
17+
- "examples/arduino-serial-plotter"
18+
- "examples/mbed-ble-thermometer"
19+
- "examples/mbed-blink"
20+
- "examples/mbed-dsp"
21+
- "examples/mbed-events"
22+
- "examples/mbed-nfc"
23+
- "examples/mbed-rtos"
24+
- "examples/mbed-serial"
25+
- "examples/zephyr-ble-beacon"
26+
- "examples/zephyr-blink"
27+
- "examples/zephyr-net-echo-client"
28+
- "examples/zephyr-subsys-nvs"
29+
exclude:
30+
- {python-version: 2.7, example: "examples/zephyr-ble-beacon"}
31+
- {python-version: 2.7, example: "examples/zephyr-blink"}
32+
- {python-version: 2.7, example: "examples/zephyr-net-echo-client"}
33+
- {python-version: 2.7, example: "examples/zephyr-subsys-nvs"}
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- uses: actions/checkout@v2
37+
with:
38+
submodules: "recursive"
39+
- name: Set up Python ${{ matrix.python-version }}
40+
uses: actions/setup-python@v1
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install -U https://github.com/platformio/platformio/archive/develop.zip
47+
platformio platform install file://.
48+
- name: Build examples
49+
run: |
50+
platformio run -d ${{ matrix.example }}

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Nordic nRF52: development platform for [PlatformIO](http://platformio.org)
2-
[![Build Status](https://travis-ci.org/platformio/platform-nordicnrf52.svg?branch=develop)](https://travis-ci.org/platformio/platform-nordicnrf52)
3-
[![Build status](https://ci.appveyor.com/api/projects/status/l4l8litycj6d1796/branch/develop?svg=true)](https://ci.appveyor.com/project/ivankravets/platform-nordicnrf52/branch/develop)
2+
3+
[![Build Status](https://github.com/platformio/platform-nordicnrf52/workflows/Examples/badge.svg)](https://github.com/platformio/platform-nordicnrf52/actions)
44

55
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 and are the most capable Bluetooth Smart SoCs on the market.
66

appveyor.yml

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

builder/compat.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2014-present PlatformIO <contact@platformio.org>
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from SCons.Script import AlwaysBuild, Import
16+
17+
18+
Import("env")
19+
20+
21+
# Added in PIO Core 4.4.0
22+
if not hasattr(env, "AddPlatformTarget"):
23+
24+
def AddPlatformTarget(
25+
env,
26+
name,
27+
dependencies,
28+
actions,
29+
title=None,
30+
description=None,
31+
always_build=True,
32+
):
33+
target = env.Alias(name, dependencies, actions)
34+
if always_build:
35+
AlwaysBuild(target)
36+
return target
37+
38+
env.AddMethod(AddPlatformTarget)

builder/main.py

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
4848

4949

5050
env = DefaultEnvironment()
51+
env.SConscript("compat.py", exports="env")
5152
platform = env.PioPlatform()
5253
board = env.BoardConfig()
5354
variant = board.get("build.variant", "")
@@ -223,16 +224,36 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
223224
BOOT_SETTING_ADDR=board.get("build.bootloader.settings_addr", "0x7F000")
224225
)
225226

226-
AlwaysBuild(env.Alias("dfu", env.PackageDfu(
227-
join("$BUILD_DIR", "${PROGNAME}"),
228-
env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf))))
227+
env.AddPlatformTarget(
228+
"dfu",
229+
env.PackageDfu(
230+
join("$BUILD_DIR", "${PROGNAME}"),
231+
env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf),
232+
),
233+
None,
234+
"Generate DFU Image",
235+
)
229236

230-
AlwaysBuild(env.Alias("bootloader", None, [
231-
env.VerboseAction("nrfjprog --program $DFUBOOTHEX -f nrf52 --chiperase", "Uploading $DFUBOOTHEX"),
232-
env.VerboseAction("nrfjprog --erasepage $BOOT_SETTING_ADDR -f nrf52", "Erasing bootloader config"),
233-
env.VerboseAction("nrfjprog --memwr $BOOT_SETTING_ADDR --val 0x00000001 -f nrf52", "Disable CRC check"),
234-
env.VerboseAction("nrfjprog --reset -f nrf52", "Reset nRF52")
235-
]))
237+
env.AddPlatformTarget(
238+
"bootloader",
239+
None,
240+
[
241+
env.VerboseAction(
242+
"nrfjprog --program $DFUBOOTHEX -f nrf52 --chiperase",
243+
"Uploading $DFUBOOTHEX",
244+
),
245+
env.VerboseAction(
246+
"nrfjprog --erasepage $BOOT_SETTING_ADDR -f nrf52",
247+
"Erasing bootloader config",
248+
),
249+
env.VerboseAction(
250+
"nrfjprog --memwr $BOOT_SETTING_ADDR --val 0x00000001 -f nrf52",
251+
"Disable CRC check",
252+
),
253+
env.VerboseAction("nrfjprog --reset -f nrf52", "Reset nRF52"),
254+
],
255+
"Burn Bootloader",
256+
)
236257

237258
if "bootloader" in COMMAND_LINE_TARGETS and "DFUBOOTHEX" not in env:
238259
sys.stderr.write("Error. The board is missing the bootloader binary.\n")
@@ -242,10 +263,13 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
242263
# Target: Print binary size
243264
#
244265

245-
target_size = env.Alias(
246-
"size", target_elf,
247-
env.VerboseAction("$SIZEPRINTCMD", "Calculating size $SOURCE"))
248-
AlwaysBuild(target_size)
266+
target_size = env.AddPlatformTarget(
267+
"size",
268+
target_elf,
269+
env.VerboseAction("$SIZEPRINTCMD", "Calculating size $SOURCE"),
270+
"Program Size",
271+
"Calculate program size",
272+
)
249273

250274
#
251275
# Target: Upload by default .bin file
@@ -391,16 +415,15 @@ def _jlink_cmd_script(env, source):
391415
else:
392416
sys.stderr.write("Warning! Unknown upload protocol %s\n" % upload_protocol)
393417

394-
AlwaysBuild(env.Alias("upload", target_firm, upload_actions))
418+
env.AddPlatformTarget("upload", target_firm, upload_actions, "Upload")
395419

396420

397421
#
398422
# Target: Erase Flash
399423
#
400424

401-
AlwaysBuild(
402-
env.Alias("erase", None, env.VerboseAction("$ERASECMD",
403-
"Erasing...")))
425+
env.AddPlatformTarget(
426+
"erase", None, env.VerboseAction("$ERASECMD", "Erasing..."), "Erase Flash")
404427

405428
#
406429
# Information about obsolete method of specifying linker scripts

platform.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "git",
1313
"url": "https://github.com/platformio/platform-nordicnrf52.git"
1414
},
15-
"version": "4.2.0",
15+
"version": "4.2.1",
1616
"packageRepositories": [
1717
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
1818
"http://dl.platformio.org/packages/manifest.json"

0 commit comments

Comments
 (0)