Commit graph

58044 commits

Author SHA1 Message Date
Lingao Meng
cd2ea62643 Bluetooth: Mesh: Add krp command
Add krp cmd.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
a02998912e doc: bluetooth/mesh: Add polltimeout_get document
Add polltimeout_get command documentation.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
ec80168ec0 Bluetooth: Mesh: Add lpn_polltimeout_get command
Add polltimeout_get cmd.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
7db4b0a935 doc: bluetooth/mesh: Add mod_sub_del_all document
Add mod_sub_del_all command documentation.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
cd9736cbbe Bluetooth: Mesh: Add model_sub_del_all command
Add mod_sub_del_all cmd.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
2c824ba69a doc: bluetooth/mesh: Add mod_sub_ow_va document
Add mod_sub_ow_va command documentation.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
81a1cd45a6 Bluetooth: Mesh: Add mod_sub_ow_va command
Add mod_sub_overwrite_va cmd.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
c3fbcb5e6d doc: bluetooth/mesh: Add mod_sub_ow document
Add mod_sub_ow command documentation.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
ef04742a08 Bluetooth: Mesh: Add model_sub_ov command
Add mod_sub_overwrite cmd.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
5e37f1ac9b doc: bluetooth/mesh: Add mod_pub_va document
Add mod_pub_va command documentation.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Lingao Meng
7c812c237d Bluetooth: Mesh: Add model publish va set command
Add mod_pub_va cmd.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-23 13:08:45 +02:00
Vinayak Kariappa Chettimada
4de9940a75 Bluetooth: Controller: Fix ISO Broadcast conditional compile
Fix ISO Broadcast only supported related conditional compile
so that data path setup does not return command disallowed.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:39:38 +01:00
Vinayak Kariappa Chettimada
85eac820ca Bluetooth: Controller: Rename ull_adv_iso_get to internal iso_get
Rename internal static function ull_adv_iso_get to iso_get.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:39:32 +01:00
Vinayak Kariappa Chettimada
4cb88bf024 Bluetooth: Controller: Refactor PTC interation value into function
Refactor implementation calculating the Pre-transmission
subevent iteration count into function.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:39:32 +01:00
Vinayak Kariappa Chettimada
1a88f1c3cd Bluetooth: Controller: Fix PTC value calculation considering num_bis
Fix PTC iteration value calculation for pre-transmission
subevents to consider multiple BIS events in the BIG event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:39:32 +01:00
Vinayak Kariappa Chettimada
db76c774e4 Bluetooth: Controller: Fix ad_data population in AUX_SYNC_IND PDU
Use memcpy to access the reference to AD data passed in the
list of length encoded parameters used to construct the
Common Extended Payload Format in AUX_SYNC_IND PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:39:17 +01:00
Vinayak Kariappa Chettimada
13332deaba Bluetooth: Controller: ISO Sync payload number and timestamp
Add implementation to send ISO Sync payload number and
timestamp from LLL to HCI/ISOAL layer.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:39:10 +01:00
Vinayak Kariappa Chettimada
e04a19003b Bluetooth: Controller: Move iso_interval field from ULL to LLL context
Move the iso_interval field from ULL to LLL context to
facilitate calculation of timestamp when there is PTO in
the BIG events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:39:10 +01:00
Vinayak Kariappa Chettimada
548fcab648 Bluetooth: Controller: Fix initialize of ISO sync ctrl proc variables
Fix missing initialization of ISO sync control procedure
variables.
Without this initialization, after synchronization the sync
is lost.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:38:58 +01:00
Vinayak Kariappa Chettimada
dbfff2397f Bluetooth: Controller: Fix ISO Sync anchor point PDU CRC ok
Fix ISO Sync implementation to use the CRC ok status of
anchor point PDU, and not the last PDU receive, when
generating the event done message.

Without this fix, ISO sync is lost if there is continous
CRC error in the last PDU before the event is done.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:38:58 +01:00
Johan Lundin
403fbfcc12 Bluetooth: Adds preprocessor to L2CAP tester app
Adds preprocessor ifdefs to reconfigure() in L2CAP tester application
depending on the KConfig option CONFIG_BT_L2CAP_ECRED
Fixes issue #40456

Signed-off-by: Johan Lundin <johan.lundin@nordicsemi.no>
2021-11-22 23:10:47 -05:00
Bartosz Bilas
554296c1e1 doc: west: build-flash-debug: fix cmake arg example
The shorter version of --cmake argument should contain one dash only.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-22 23:04:30 -05:00
Aleksandr Khromykh
5e81918fff Bluetooth: Mesh: fix gatt network id advertising
Per prf spec 7.2.2.2.1, "A node that does not support
the Proxy feature or has the Proxy feature disabled
shall not advertise with Network ID".
The PR aligns implementation with the specification.

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2021-11-22 23:04:12 -05:00
Carlo Caione
2e9c57ec28 sample: ipc_service: Add ipc_rpmsg_static_vrings sample
Add a new sample to show and test the usage of the newly introduced
backend.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-22 23:03:23 -05:00
Carlo Caione
983d4606ff ipc_service: Add new RPMsg with static VRINGs backend
Introduce a new RPMsg with static VRINGs backend. This new backend makes
easy to generate and use IPC instances backed by OpenAMP using the DT.

Each instance is defined in the DT as (for example):

  ipc: ipc {
          compatible = "zephyr,ipc-openamp-static-vrings";
          shm = <&sram_ipc0>;
          mboxes = <&mbox 0>, <&mbox 1>;
          mbox-names = "tx", "rx";
          role = "primary";
          status = "okay";
  };

It is then possible to register an send data through endpoints using the
IPC service APIs.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-22 23:03:23 -05:00
Carlo Caione
d7a40ba5d7 ipc_service: Extend RPMsg structs and misc fixes
Extend the RPMsg structs to accommodate for the introduction of new
backends and contextually fix the ipc_rpmsg_static_vrings_mi backend
(the only user).

Rework also some comments and ipc_service glue code.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-22 23:03:23 -05:00
Carlo Caione
83d0c96915 ipc_service: Add open_instance function
As know, an instance is the representation of a physical communication
channel between two domains / CPUs.

This communication channel must be usually known and initialized (that
is "opened") by both parties in the communication before a proper
communication can be instaurated using endpoints.

Depending on the backend and on the library / protocol used by the
backend, this "opening" can go through some handshaking or
synchronization procedure run by the parties that sometimes can be
blocking or time-consuming.

For example in the simplest case of a backend using OpenAMP, the remote
side of the communication is waiting for the local part to be up and
running by loop-waiting on some flag set in the shared memory by the
local party.

This is a blocking process so a particular attention must be paid to
where this is going to be placed in the backend code.

Currently it is only possible to have this synchronization procedure in
two points: (1) the init function of the instance, (2) during
ipc_service_register_endpoint().

It should be highly discouraged to put any blocking routine in the init
code, so (1) must be excluded. It is also frowned upon using the
endpoint registration function (2) because the synchronization is
something concerning the instance, not the single endpoints.

This patch is adding a new optional ipc_service_open_instance() function
that can be used to host the handshaking or synchronization code between
the two parties of the instance.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-22 23:03:23 -05:00
Daniel DeGrasse
e70907f52d drivers: mcux_flexspi: Default logging to disabled when XIP is used
Program flow will behave incorrectly (memory and instruction fetches
return invalid data) if Flexspi is accessed by the Flexspi driver while
being used as XIP memory by the Cortex M7.

Set logging to disabled by when XIP mode is used in the memc and
flexspi drivers, and warn the user if they attempt to enable it.

Fixes #40133

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-22 22:27:13 -05:00
Peter Johanson
d99de305ce dts: bindings: Add generic Xiao interconnect
* With existence of Adafruit Qt Py boards, and upcoming wireless
  Xiao from Seeeduino, define nexus node and peripheral node
  labels for use with shields that accept any Xiao format board.
* Adds `&xiao_d`, `&xiao_spi`, `&xiao_i2c` and `&xiao_serial` generic
  node labels.
* Add new 'seeed-xioa-header.yaml` to document new nexus node.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2021-11-22 22:25:20 -05:00
Tilmann Unte
38e89c90a5 drivers: pwm: stm32: add pwm capture support
Extends STM32 PWM driver to support capturing pulse width, period,
or both.

The approach used is based on the PWM Input sections in reference
manual RM0351 by ST in the chapters on timers.
The LL library by ST is used for all extensions to the driver.

Only the disco_l475_iot1 board was available for testing on hardware,
using tests/drivers/pwm/pwm_loopback.
Since timers are a generic component, it is assumed that other STM32
boards will behave the same

Fixes #39394

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
2021-11-22 22:24:45 -05:00
Tilmann Unte
a9ba637ac9 tests: drivers: pwm: stm32 board for loopback test
Add overlay file for disco_l475_iot1 board to pwm_loopback test.

The file is based on the existing overlays for twr_ke18f and frdm_k64f.

The new configuration uses both a 16-Bit timer with active prescaler
as well as a 32-Bit timer with deactivated prescaler for coverage.

It is assumed that other STM32 boards will behave like the
disco_l475_iot1. Only this board was available for testing.

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
2021-11-22 22:24:45 -05:00
Morten Priess
7a6666a0e7 Bluetooth: controller: Introduce preferred central conn spacing config
Adds configuration BT_CTLR_SCHED_ADVANCED_CENTRAL_CONN_SPACING to enable
per-application preferred central connection spacing. This is an
extension of feature BT_CTLR_SCHED_ADVANCED, which when enabled, adds
user defined spacing between existing, and new central initiated
connections.

This is crucial for ensuring that centrals acting as ACL connection
based multi-channel streaming sources do not get overlapping
connections, and that spacing allows full frame transfer without
scheduling collision.

Due to the simple, compile-time configuration, use is limited to
specific applications in which the specified spacing is required.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-11-22 22:23:48 -05:00
Yong Cong Sin
a6ebcddc54 driver: serial: uart_stm32: Calculate suitable PRESCALER value
Current driver set a fixed prescaler value for the lpuart
that caused certain baudrate configurations to fail due to
LPUARTDIV overflow the LPUART_BRR register.

This PR attempt to calculate a suitable PRESCALER for the
selected baudrate, throws error and return if it couldn't get
an optimal one.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-11-22 22:21:20 -05:00
Wolfgang Puffitsch
b56310d4d4 Bluetooth: controller: Wait for accept/reject from host for LL_CIS_RSP
Wait until host has accepted/rejected a CIS before responding with
LL_CIS_RSP.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-11-22 22:20:19 -05:00
Fabio Baltieri
106f82013b boards: lora_e5_dev_board: set defaults for blackmagicprobe
This sets the commonly used serial port alias for blackmagicprobe, as
well as the flag to reset on connect, so that flashing works in low
power.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-22 22:20:02 -05:00
Fabio Baltieri
a85b5f5fe2 boards: lora_e5_dev_board: add power states config
Add the power state configs so that the board can be used with suspend
to idle out of the box. This is the same config as the one in
nucleo_wl55jc.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-22 22:20:02 -05:00
Fabio Baltieri
d0377d30e3 scripts: runners: add connect_srst support for blackmagicprobe
Black Magic Probe supports a "monitor connect_srst" command [1] to
configure whether to assert reset when connecting to the target. This is
useful to reprogram a target that may be idling in a low power state,
with an otherwise unresponsive debug core.

Adding a --connect-srst runner option for enabling this for "flash" and
"debug" operations to ensure that programming works in that case, but
also explicitly disabling it for "attach", to allow attaching to a
running target without changing its state.

Not turning this on by default since apparently some MCUs disable the
SWD interface while in reset.

[1] https://github.com/blacksphere/blackmagic/wiki/Useful-GDB-commands

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-22 22:20:02 -05:00
Øyvind Rønningstad
449cb60815 samples: Add TF-M sample for custom secure partitions
The sample implements a dummy ARoT (Application Root of Trust) partition
in TF-M and calls it from the app.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-22 22:19:41 -05:00
Joakim Andersson
3db41349f5 cmake: Add variable for the TFM build directory
The TFM build directory path is hardcoded in many places.
In order to support out-of-tree secure partitions the output path
has to be known in potentially out-of-tree build scripts.
This could potentially break out-of-tree build scripts if the
location of the build directory was changed.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-22 22:19:41 -05:00
Martin Jäger
98d2d2feda task_wdt: fix overflow in current_ticks making wdt get stuck
The task_wdt was getting stuck after approx. 36 hours on e.g. nRF52840,
which has a SysTick with 32768 Hz. This corresponds to an overflow of
the uint32_t current_ticks in schedule_next_timeout.

This commit fixes the accidentally introduced narrowing conversion.

Fixes #40152

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-11-22 20:22:11 -05:00
Gerard Marull-Paretas
1123b80aee tests: drivers: pinctrl: gd32: add DT AFIO parse test
Add a test to check that DT information for the AFIO model is extracted
correctly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
f5ed5e6d0f tests: drivers: pinctrl: gd32: add DT AF parse test
Add a test to check that DT information for AF model is extracted
correctly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
d702e74854 boards: gd32f403z_eval: use pinctrl
Enable usage of pinctrl.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
37c855f3c8 boards: gd32f450i_eval: use pinctrl
Enable usage of the pinctrl driver.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
285f55899b drivers: serial: gd32: use pinctrl
Use the pinctrl API to configure peripheral pins.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
037869e28d soc: arm: gigadevice: enable pinctrl by default
Enable pinctrl by default, since it is an essential component on almost
every firmware. Inclusion of series defconfig has also been guarded with
SoC availability (was missing).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
f45c2668e3 soc: arm: gigadevice: gd32f403: select AFIO pinmux
GD32F403 series use AFIO pinmux model.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
1f74c01daa dts: arm: gigadevice: gd32f403: add afio and pinctrl
Add afio, pinctrl and gpioa...g entries for the GD32F403 series.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
f8017dc5ad drivers: pinctrl: gd32: initial support for AFIO based SoCs
Add a pin control driver for GD32 SoCs using the AFIO model.

Thanks to Gerson Fernando Budke for testing and implementation
suggestions.

Co-authored-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas
5c44620753 soc: arm: gigadevice: gd32f4xx: select AF pinmux
GD32F4XX series have AF based pinmux.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00