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 f10cd6a + eb5eef4 commit e423a5a
Show file tree
Hide file tree
Showing 27 changed files with 254 additions and 189 deletions.
2 changes: 1 addition & 1 deletion boards/nrf52_dk.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"mcu": "nrf52832",
"variant": "nRF52DK",
"zephyr": {
"variant": "nrf52_pca10040"
"variant": "nrf52dk_nrf52832"
}
},
"connectivity": [
Expand Down
2 changes: 1 addition & 1 deletion boards/thingy_52.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"f_cpu": "64000000L",
"mcu": "nrf52832",
"zephyr": {
"variant": "nrf52_pca20020"
"variant": "thingy52_nrf52832"
}
},
"connectivity": [
Expand Down
6 changes: 5 additions & 1 deletion builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def _jlink_cmd_script(env, source):
UPLOADER="JLink.exe" if system() == "Windows" else "JLinkExe",
UPLOADERFLAGS=[
"-device", env.BoardConfig().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 @@ -394,6 +394,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
11 changes: 3 additions & 8 deletions examples/arduino-ble-led/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,22 @@
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[common]
lib_deps = BLEPeripheral
[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
build_flags = ${common.build_flags}
lib_deps = ${common.lib_deps}

[env:redbear_blenano2]
platform = nordicnrf52
framework = arduino
board = redbear_blenano2
build_flags = ${common.build_flags}
lib_deps = ${common.lib_deps}

[env:stct_nrf52_minidev]
platform = nordicnrf52
framework = arduino
board = stct_nrf52_minidev
build_flags = ${common.build_flags}
lib_deps = ${common.lib_deps}
10 changes: 6 additions & 4 deletions examples/arduino-nina-b1-generic-example/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ framework = arduino

build_flags = -DNRF52_S132

lib_deps =
Adafruit SHT31 Library
Ticker
BLEPeripheral
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

Expand Down
18 changes: 16 additions & 2 deletions examples/zephyr-ble-beacon/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ static const struct bt_data sd[] = {

static void bt_ready(int err)
{
char addr_s[BT_ADDR_LE_STR_LEN];
bt_addr_le_t addr = {0};
size_t count = 1;

if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
Expand All @@ -50,14 +54,24 @@ static void bt_ready(int err)
printk("Bluetooth initialized\n");

/* Start advertising */
err = bt_le_adv_start(BT_LE_ADV_NCONN, ad, ARRAY_SIZE(ad),
err = bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad),
sd, ARRAY_SIZE(sd));
if (err) {
printk("Advertising failed to start (err %d)\n", err);
return;
}

printk("Beacon started\n");

/* For connectable advertising you would use
* bt_le_oob_get_local(). For non-connectable non-identity
* advertising an non-resolvable private address is used;
* there is no API to retrieve that.
*/

bt_id_get(&addr, &count);
bt_addr_le_to_str(&addr, addr_s, sizeof(addr_s));

printk("Beacon started, advertising as %s\n", addr_s);
}

void main(void)
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
6 changes: 6 additions & 0 deletions examples/zephyr-net-echo-client/src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ extern struct k_mem_domain app_domain;
#define APP_DMEM
#endif

#if IS_ENABLED(CONFIG_NET_TC_THREAD_PREEMPTIVE)
#define THREAD_PRIORITY K_PRIO_PREEMPT(8)
#else
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
#endif

struct data {
const char *proto;

Expand Down
8 changes: 6 additions & 2 deletions examples/zephyr-net-echo-client/src/echo-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static void init_app(void)
init_vlan();
}

static void start_client(void)
static int start_client(void)
{
int iterations = CONFIG_NET_SAMPLE_SEND_ITERATIONS;
int i = 0;
Expand All @@ -300,6 +300,8 @@ static void start_client(void)

stop_udp_and_tcp();
}

return ret;
}

void main(void)
Expand All @@ -314,13 +316,15 @@ void main(void)
k_sem_give(&run_app);
}

k_thread_priority_set(k_current_get(), THREAD_PRIORITY);

#if defined(CONFIG_USERSPACE)
k_thread_access_grant(k_current_get(), &run_app);
k_mem_domain_add_thread(&app_domain, k_current_get());

k_thread_user_mode_enter((k_thread_entry_t)start_client, NULL, NULL,
NULL);
#else
start_client();
exit(start_client());
#endif
}
4 changes: 2 additions & 2 deletions examples/zephyr-net-echo-client/zephyr/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ Build echo-client sample application like this:
:goals: build
:compact:

Example building for the nRF52840_pca10056 with OpenThread support:
Example building for the nrf52840dk_nrf52840 with OpenThread support:

.. zephyr-app-commands::
:zephyr-app: samples/net/sockets/echo_client
:host-os: unix
:board: nrf52840_pca10056
:board: nrf52840dk_nrf52840
:conf: "prj.conf overlay-ot.conf"
:goals: run
:compact:
Expand Down
23 changes: 8 additions & 15 deletions examples/zephyr-net-echo-client/zephyr/boards/atsamr21_xpro.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,21 @@
# SPDX-License-Identifier: Apache-2.0
#

CONFIG_NET_6LO=y
CONFIG_NET_L2_IEEE802154_FRAGMENT=y
CONFIG_NET_L2_IEEE802154_FRAGMENT_REASS_CACHE_SIZE=2
CONFIG_NET_L2_IEEE802154_SECURITY=n

CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2"
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1"
CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="RF2XX_0"

# Reduced buffers to fit into SAMR21 SoC
CONFIG_CPLUSPLUS=n

CONFIG_NET_PKT_RX_COUNT=10
CONFIG_NET_PKT_TX_COUNT=10
CONFIG_NET_BUF_RX_COUNT=10
CONFIG_NET_BUF_TX_COUNT=10
CONFIG_NET_MAX_CONTEXTS=6
CONFIG_NET_PKT_RX_COUNT=6
CONFIG_NET_PKT_TX_COUNT=6
CONFIG_NET_BUF_RX_COUNT=6
CONFIG_NET_BUF_TX_COUNT=6
CONFIG_NET_MAX_CONTEXTS=4
CONFIG_NET_MAX_CONN=2
CONFIG_NET_MAX_ROUTES=4
CONFIG_NET_MAX_ROUTES=2
CONFIG_NET_MAX_NEXTHOPS=2

CONFIG_SHELL_STACK_SIZE=1024
CONFIG_SHELL_STACK_SIZE=768
CONFIG_SHELL_CMD_BUFF_SIZE=80
CONFIG_SHELL_ARGC_MAX=6
CONFIG_SHELL_HISTORY_BUFFER=256
CONFIG_SHELL_HISTORY_BUFFER=64
18 changes: 0 additions & 18 deletions examples/zephyr-net-echo-client/zephyr/boards/sam4s_xplained.conf

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions examples/zephyr-net-echo-client/zephyr/boards/sam_v71_xult.conf

This file was deleted.

22 changes: 0 additions & 22 deletions examples/zephyr-net-echo-client/zephyr/boards/sam_v71_xult.overlay

This file was deleted.

18 changes: 18 additions & 0 deletions examples/zephyr-net-echo-client/zephyr/docker-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

if [ -z "$RUNNING_FROM_MAIN_SCRIPT" ]; then
echo "Do not run this script directly!"
echo "Run $ZEPHYR_BASE/scripts/net/run-sample-tests.sh instead."
exit 1
fi

start_configuration "--ip=192.0.2.1 --ip6=2001:db8::1" || return $?
start_docker "/net-tools/echo-server -i eth0" || return $?

start_zephyr "$overlay" "-DCONFIG_NET_SAMPLE_SEND_ITERATIONS=10"

wait_zephyr
result=$?

stop_docker
18 changes: 18 additions & 0 deletions examples/zephyr-net-echo-client/zephyr/overlay-802154-subg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CONFIG_BT=n

# Disable TCP and IPv4 (TCP disabled to avoid heavy traffic)
CONFIG_NET_TCP=n
CONFIG_NET_IPV4=n

CONFIG_NET_CONFIG_NEED_IPV6=y
CONFIG_NET_CONFIG_NEED_IPV4=n
CONFIG_NET_CONFIG_MY_IPV4_ADDR=""
CONFIG_NET_CONFIG_PEER_IPV4_ADDR=""
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2"
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1"

CONFIG_NET_L2_IEEE802154=y
CONFIG_NET_L2_IEEE802154_SHELL=y
CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y

CONFIG_NET_CONFIG_IEEE802154_CHANNEL=1
7 changes: 7 additions & 0 deletions examples/zephyr-net-echo-client/zephyr/overlay-debug.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_NO_OPTIMIZATIONS=y
CONFIG_DEBUG=y

CONFIG_ASSERT=y

CONFIG_STACK_SENTINEL=y
CONFIG_STACK_CANARIES=y
5 changes: 5 additions & 0 deletions examples/zephyr-net-echo-client/zephyr/overlay-e1000.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CONFIG_PCIE=y
CONFIG_ETH_E1000=y

CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_QEMU_ETHERNET=y
Loading

0 comments on commit e423a5a

Please sign in to comment.