Skip to content

Commit e423a5a

Browse files
committed
Merge branch 'release/v7.0.0'
2 parents f10cd6a + eb5eef4 commit e423a5a

27 files changed

Lines changed: 254 additions & 189 deletions

boards/nrf52_dk.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"mcu": "nrf52832",
1111
"variant": "nRF52DK",
1212
"zephyr": {
13-
"variant": "nrf52_pca10040"
13+
"variant": "nrf52dk_nrf52832"
1414
}
1515
},
1616
"connectivity": [

boards/thingy_52.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"f_cpu": "64000000L",
55
"mcu": "nrf52832",
66
"zephyr": {
7-
"variant": "nrf52_pca20020"
7+
"variant": "thingy52_nrf52832"
88
}
99
},
1010
"connectivity": [

builder/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def _jlink_cmd_script(env, source):
379379
UPLOADER="JLink.exe" if system() == "Windows" else "JLinkExe",
380380
UPLOADERFLAGS=[
381381
"-device", env.BoardConfig().get("debug", {}).get("jlink_device"),
382-
"-speed", "4000",
382+
"-speed", env.GetProjectOption("debug_speed", "4000"),
383383
"-if", ("jtag" if upload_protocol == "jlink-jtag" else "swd"),
384384
"-autoconnect", "1",
385385
"-NoGui", "1"
@@ -394,6 +394,10 @@ def _jlink_cmd_script(env, source):
394394
]
395395
openocd_args.extend(
396396
debug_tools.get(upload_protocol).get("server").get("arguments", []))
397+
if env.GetProjectOption("debug_speed"):
398+
openocd_args.extend(
399+
["-c", "adapter speed %s" % env.GetProjectOption("debug_speed")]
400+
)
397401
openocd_args.extend([
398402
"-c", "program {$SOURCE} %s verify reset; shutdown;" %
399403
board.get("upload.offset_address", "")

examples/arduino-ble-led/platformio.ini

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,22 @@
77
; Please visit documentation for the other options and examples
88
; http://docs.platformio.org/page/projectconf.html
99

10-
[common]
11-
lib_deps = BLEPeripheral
10+
[env]
11+
lib_deps = sandeepmistry/BLEPeripheral @ ^0.4.0
12+
lib_compat_mode = soft
1213
build_flags = -DNRF52_S132
1314

1415
[env:nrf52_dk]
1516
platform = nordicnrf52
1617
framework = arduino
1718
board = nrf52_dk
18-
build_flags = ${common.build_flags}
19-
lib_deps = ${common.lib_deps}
2019

2120
[env:redbear_blenano2]
2221
platform = nordicnrf52
2322
framework = arduino
2423
board = redbear_blenano2
25-
build_flags = ${common.build_flags}
26-
lib_deps = ${common.lib_deps}
2724

2825
[env:stct_nrf52_minidev]
2926
platform = nordicnrf52
3027
framework = arduino
3128
board = stct_nrf52_minidev
32-
build_flags = ${common.build_flags}
33-
lib_deps = ${common.lib_deps}

examples/arduino-nina-b1-generic-example/platformio.ini

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ framework = arduino
1515

1616
build_flags = -DNRF52_S132
1717

18-
lib_deps =
19-
Adafruit SHT31 Library
20-
Ticker
21-
BLEPeripheral
18+
lib_compat_mode = soft
19+
lib_deps =
20+
SPI
21+
adafruit/Adafruit SHT31 Library @ ^2.0.0
22+
sstaub/Ticker @ ^3.2.0
23+
sandeepmistry/BLEPeripheral @ ^0.4.0
2224

2325
monitor_speed = 115200
2426

examples/zephyr-ble-beacon/src/main.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ static const struct bt_data sd[] = {
4242

4343
static void bt_ready(int err)
4444
{
45+
char addr_s[BT_ADDR_LE_STR_LEN];
46+
bt_addr_le_t addr = {0};
47+
size_t count = 1;
48+
4549
if (err) {
4650
printk("Bluetooth init failed (err %d)\n", err);
4751
return;
@@ -50,14 +54,24 @@ static void bt_ready(int err)
5054
printk("Bluetooth initialized\n");
5155

5256
/* Start advertising */
53-
err = bt_le_adv_start(BT_LE_ADV_NCONN, ad, ARRAY_SIZE(ad),
57+
err = bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad),
5458
sd, ARRAY_SIZE(sd));
5559
if (err) {
5660
printk("Advertising failed to start (err %d)\n", err);
5761
return;
5862
}
5963

60-
printk("Beacon started\n");
64+
65+
/* For connectable advertising you would use
66+
* bt_le_oob_get_local(). For non-connectable non-identity
67+
* advertising an non-resolvable private address is used;
68+
* there is no API to retrieve that.
69+
*/
70+
71+
bt_id_get(&addr, &count);
72+
bt_addr_le_to_str(&addr, addr_s, sizeof(addr_s));
73+
74+
printk("Beacon started, advertising as %s\n", addr_s);
6175
}
6276

6377
void main(void)

examples/zephyr-blink/src/main.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <devicetree.h>
1010
#include <drivers/gpio.h>
1111

12-
1312
/* 1000 msec = 1 sec */
1413
#define SLEEP_TIME_MS 1000
1514

@@ -19,25 +18,20 @@
1918
#if DT_NODE_HAS_STATUS(LED0_NODE, okay)
2019
#define LED0 DT_GPIO_LABEL(LED0_NODE, gpios)
2120
#define PIN DT_GPIO_PIN(LED0_NODE, gpios)
22-
#if DT_PHA_HAS_CELL(LED0_NODE, gpios, flags)
2321
#define FLAGS DT_GPIO_FLAGS(LED0_NODE, gpios)
24-
#endif
2522
#else
2623
/* A build error here means your board isn't set up to blink an LED. */
2724
#error "Unsupported board: led0 devicetree alias is not defined"
2825
#define LED0 ""
2926
#define PIN 0
30-
#endif
31-
32-
#ifndef FLAGS
3327
#define FLAGS 0
3428
#endif
3529

3630
void main(void)
3731
{
38-
struct device *dev;
32+
const struct device *dev;
3933
bool led_is_on = true;
40-
int ret = 0;
34+
int ret;
4135

4236
dev = device_get_binding(LED0);
4337
if (dev == NULL) {

examples/zephyr-net-echo-client/src/common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ extern struct k_mem_domain app_domain;
2121
#define APP_DMEM
2222
#endif
2323

24+
#if IS_ENABLED(CONFIG_NET_TC_THREAD_PREEMPTIVE)
25+
#define THREAD_PRIORITY K_PRIO_PREEMPT(8)
26+
#else
27+
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
28+
#endif
29+
2430
struct data {
2531
const char *proto;
2632

examples/zephyr-net-echo-client/src/echo-client.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static void init_app(void)
274274
init_vlan();
275275
}
276276

277-
static void start_client(void)
277+
static int start_client(void)
278278
{
279279
int iterations = CONFIG_NET_SAMPLE_SEND_ITERATIONS;
280280
int i = 0;
@@ -300,6 +300,8 @@ static void start_client(void)
300300

301301
stop_udp_and_tcp();
302302
}
303+
304+
return ret;
303305
}
304306

305307
void main(void)
@@ -314,13 +316,15 @@ void main(void)
314316
k_sem_give(&run_app);
315317
}
316318

319+
k_thread_priority_set(k_current_get(), THREAD_PRIORITY);
320+
317321
#if defined(CONFIG_USERSPACE)
318322
k_thread_access_grant(k_current_get(), &run_app);
319323
k_mem_domain_add_thread(&app_domain, k_current_get());
320324

321325
k_thread_user_mode_enter((k_thread_entry_t)start_client, NULL, NULL,
322326
NULL);
323327
#else
324-
start_client();
328+
exit(start_client());
325329
#endif
326330
}

examples/zephyr-net-echo-client/zephyr/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ Build echo-client sample application like this:
5959
:goals: build
6060
:compact:
6161

62-
Example building for the nRF52840_pca10056 with OpenThread support:
62+
Example building for the nrf52840dk_nrf52840 with OpenThread support:
6363

6464
.. zephyr-app-commands::
6565
:zephyr-app: samples/net/sockets/echo_client
6666
:host-os: unix
67-
:board: nrf52840_pca10056
67+
:board: nrf52840dk_nrf52840
6868
:conf: "prj.conf overlay-ot.conf"
6969
:goals: run
7070
:compact:

0 commit comments

Comments
 (0)