Skip to content

Commit

Permalink
Merge branch 'release/v7.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed Feb 26, 2021
2 parents 1f65360 + c176373 commit 92db3d6
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-16.04, windows-latest, macos-latest]
python-version: [2.7, 3.7]
python-version: [3.7]
example:
- "examples/arduino-blink"
- "examples/arduino-ble-led"
Expand Down
2 changes: 1 addition & 1 deletion boards/nrf51_dk.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"mcu": "nrf51822",
"variant": "PCA1000X",
"zephyr": {
"variant": "nrf51_pca10028"
"variant": "nrf51dk_nrf51422"
}
},
"connectivity": [
Expand Down
2 changes: 1 addition & 1 deletion boards/nrf51_dongle.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"mcu": "nrf51822",
"variant": "nRF51Dongle",
"zephyr": {
"variant": "nrf51_pca10031"
"variant": "nrf51dongle_nrf51422"
}
},
"connectivity": [
Expand Down
6 changes: 5 additions & 1 deletion builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def _jlink_cmd_script(env, source):
UPLOADER="JLink.exe" if system() == "Windows" else "JLinkExe",
UPLOADERFLAGS=[
"-device", board.get("debug", {}).get("jlink_device"),
"-speed", "4000",
"-speed", env.GetProjectOption("debug_speed", "4000"),
"-if", ("jtag" if upload_protocol == "jlink-jtag" else "swd"),
"-autoconnect", "1",
"-NoGui", "1"
Expand All @@ -221,6 +221,10 @@ def _jlink_cmd_script(env, source):
]
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", "")
Expand Down
26 changes: 24 additions & 2 deletions examples/zephyr-ble-eddystone/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,16 +426,27 @@ static ssize_t read_adv_data(struct bt_conn *conn,
static int eds_slot_restart(struct eds_slot *slot, uint8_t type)
{
int err;
char addr_s[BT_ADDR_LE_STR_LEN];
bt_addr_le_t addr = {0};

/* Restart advertising */
bt_le_adv_stop();

if (type == EDS_TYPE_NONE) {
struct bt_le_oob oob;

/* Restore connectable if slot */
if (bt_le_oob_get_local(BT_ID_DEFAULT, &oob) == 0) {
addr = oob.addr;
}

err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad),
NULL, 0);
} else {
err = bt_le_adv_start(BT_LE_ADV_NCONN_NAME, slot->ad,
size_t count = 1;

bt_id_get(&addr, &count);
err = bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, slot->ad,
ARRAY_SIZE(slot->ad), NULL, 0);
}

Expand All @@ -444,6 +455,9 @@ static int eds_slot_restart(struct eds_slot *slot, uint8_t type)
return err;
}

bt_addr_le_to_str(&addr, addr_s, sizeof(addr_s));
printk("Advertising as %s\n", addr_s);

slot->type = type;

return 0;
Expand Down Expand Up @@ -619,6 +633,9 @@ BT_GATT_SERVICE_DEFINE(eds_svc,

static void bt_ready(int err)
{
char addr_s[BT_ADDR_LE_STR_LEN];
struct bt_le_oob oob;

if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
Expand All @@ -633,6 +650,11 @@ static void bt_ready(int err)
return;
}

/* Restore connectable if slot */
bt_le_oob_get_local(BT_ID_DEFAULT, &oob);
bt_addr_le_to_str(&oob.addr, addr_s, sizeof(addr_s));
printk("Initial advertising as %s\n", addr_s);

k_delayed_work_submit(&idle_work, EDS_IDLE_TIMEOUT);

printk("Configuration mode: waiting connections...\n");
Expand All @@ -641,7 +663,7 @@ static void bt_ready(int err)
static void idle_timeout(struct k_work *work)
{
if (eds_slots[eds_active_slot].type == EDS_TYPE_NONE) {
printk("Switching to Beacon mode.\n");
printk("Switching to Beacon mode %u.\n", eds_active_slot);
eds_slot_restart(&eds_slots[eds_active_slot], EDS_TYPE_URL);
}
}
Expand Down
10 changes: 2 additions & 8 deletions examples/zephyr-blink/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <devicetree.h>
#include <drivers/gpio.h>


/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 1000

Expand All @@ -19,25 +18,20 @@
#if DT_NODE_HAS_STATUS(LED0_NODE, okay)
#define LED0 DT_GPIO_LABEL(LED0_NODE, gpios)
#define PIN DT_GPIO_PIN(LED0_NODE, gpios)
#if DT_PHA_HAS_CELL(LED0_NODE, gpios, flags)
#define FLAGS DT_GPIO_FLAGS(LED0_NODE, gpios)
#endif
#else
/* A build error here means your board isn't set up to blink an LED. */
#error "Unsupported board: led0 devicetree alias is not defined"
#define LED0 ""
#define PIN 0
#endif

#ifndef FLAGS
#define FLAGS 0
#endif

void main(void)
{
struct device *dev;
const struct device *dev;
bool led_is_on = true;
int ret = 0;
int ret;

dev = device_get_binding(LED0);
if (dev == NULL) {
Expand Down
59 changes: 36 additions & 23 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"homepage": "https://www.nordicsemi.com/eng/Products/nRF51-Series-SoC",
"license": "Apache-2.0",
"keywords": [
"dev-platform",
"ARM",
"Cortex-M",
"Nordic Semiconductor",
"nRF51"
"dev-platform",
"ARM",
"Cortex-M",
"Nordic Semiconductor",
"nRF51"
],
"engines": {
"platformio": "^5"
Expand All @@ -18,7 +18,7 @@
"type": "git",
"url": "https://github.com/platformio/platform-nordicnrf51.git"
},
"version": "6.1.0",
"version": "7.0.0",
"frameworks": {
"arduino": {
"package": "framework-arduinonordicnrf5",
Expand All @@ -37,7 +37,10 @@
"toolchain-gccarmnoneeabi": {
"type": "toolchain",
"owner": "platformio",
"version": ">=1.60301.0,<1.80000.0"
"version": ">=1.60301.0,<1.80000.0",
"optionalVersions": [
"~1.80201.0"
]
},
"framework-arduinonordicnrf5": {
"type": "framework",
Expand All @@ -55,12 +58,12 @@
"type": "framework",
"optional": true,
"owner": "platformio",
"version": "~2.20400.0"
"version": "~2.20500.0"
},
"framework-zephyr-cmsis": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.542b2296e6"
"version": "0.0.0-alpha+sha.c3bd2094f9"
},
"framework-zephyr-canopennode": {
"optional": true,
Expand All @@ -70,52 +73,52 @@
"framework-zephyr-civetweb": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.99129c5efc"
"version": "0.0.0-alpha+sha.e6903b80c0"
},
"framework-zephyr-fatfs": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.13697783bf"
"version": "0.0.0-alpha+sha.1d1fcc725a"
},
"framework-zephyr-hal-nordic": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.d8a6ea9695"
"version": "0.0.0-alpha+sha.f0d54d8449"
},
"framework-zephyr-hal-st": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.5b3ec3e182"
"version": "0.0.0-alpha+sha.b52fdbf4b6"
},
"framework-zephyr-libmetal": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.0b23894a04"
"version": "0.0.0-alpha+sha.9d4ee2c3cf"
},
"framework-zephyr-lvgl": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.928b61c7c8"
"version": "0.0.0-alpha+sha.31acbaa36e"
},
"framework-zephyr-mbedtls": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.aef137b1af"
"version": "0.0.0-alpha+sha.24d84ecff1"
},
"framework-zephyr-mcuboot": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.a5d79cf8cc"
"version": "0.0.0-alpha+sha.3fc59410b6"
},
"framework-zephyr-mcumgr": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.5051f9d900"
"version": "0.0.0-alpha+sha.43845e883f"
},
"framework-zephyr-open-amp": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.724f7e2a45"
"version": "0.0.0-alpha+sha.de1b85a130"
},
"framework-zephyr-loramac-node": {
"optional": true,
Expand All @@ -125,12 +128,17 @@
"framework-zephyr-openthread": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.07f430dac6"
"version": "0.0.0-alpha+sha.1d668284a0"
},
"framework-zephyr-segger": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.874d9e9696"
"version": "0.0.0-alpha+sha.38c79a447e"
},
"framework-zephyr-sof": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.b5b772dd61"
},
"framework-zephyr-tinycbor": {
"optional": true,
Expand All @@ -150,12 +158,17 @@
"framework-zephyr-mipi-sys-t": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.957d46bc3c"
"version": "0.0.0-alpha+sha.75e671550a"
},
"framework-zephyr-tfm-mcuboot": {
"optional": true,
"owner": "platformio",
"version": "1.7.0-rc1"
},
"framework-zephyr-trusted-firmware-m": {
"optional": true,
"owner": "platformio",
"version": "0.0.0-alpha+sha.143df67555"
"version": "0.0.0-alpha+sha.96340fb6c0"
},
"tool-sreccat": {
"owner": "platformio",
Expand Down
Loading

0 comments on commit 92db3d6

Please sign in to comment.