Commit Graph

71939 Commits

Author SHA1 Message Date
Krzysztof Chruscinski 31b25400ff drivers: timer: nrf_rtc_timer: Prevent prolonged timeout setting
CC setting algorithm is handling a case when CC is too soon (next
tick from now). It was setting CC to one tick further in the future
if that was detected. Step was repeated if counter incremented during
setting CC and CC was behind the counter because of risk of setting
CC too late. In certain scenarios we might spend a lot of time in
that loop, especially if optimization is turned off. Test shown that
loop was executed dozens of time (up. to 700us). To prevent
prolonged execution whenever CC setting fails we set CC to one more
tick further in future.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-09 10:46:19 +01:00
Emil Gydesen 79ca8f7f43 Bluetooth: Host: Add missing assigned numbers
Add missing assigned EIR/AD numbers.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-09 10:45:52 +01:00
Mariusz Skamra 6148d8a39d Bluetooth: audio: Fix invalid assert in bt_audio_iso_unbind_ep
This should assert if iso argument does not match the one ep holds
reference to.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-11-09 10:45:12 +01:00
Emil Gydesen 03a4e1ae48 Bluetooth: Audio: Add missing unbind of audio_iso for broadcast sink
When a BIS disconnected, we removed the references between
the endpoint and the stream. This made it impossible
to later unbind the audio_iso when
broadcast_sink_cleanup_streams was called.

Fixed by unbind the audio_iso when we remove the reference.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-09 10:45:06 +01:00
Krzysztof Chruscinski ff13057008 tests: kernel: workq: work: Tweak test for fast system clock
Test assumes that system clock is slow enough so 1 tick timeout
will not expire before k_timer_start function exists. That is
not the case when system clock is fast (relatively to the cpu
clock). Increase the timeout and add synchronization point.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-09 10:44:52 +01:00
Markus Fuchs ea17d5152d net: sockets_tls: Fix memory leak in socket
Fix file descriptor leak on unsupported socket protocols.

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2022-11-09 10:44:44 +01:00
Tim Lin fa751b8472 ITE: soc: chip_chipregs: Add SPISC register structure
Use spisc_it8xxx2_regs instead of IT83XX_SPI_*** registers declaration
to fix in cros_shi_it8xxx2.c

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-11-09 10:44:29 +01:00
Tim Lin 0789442132 ITE: soc: chip_chipregs: Access registers using structure method
Access registers using structure method.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-11-09 10:44:29 +01:00
Tim Lin b3f46ccaec ITE: cleanup: soc: chip_chipregs: Rename the structure name of register
Rename the structure of flash_it8xxx2_regs to smfi_it8xxx2_regs.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-11-09 10:44:29 +01:00
Tim Lin 2937beb085 ITE: cleanup: soc: chip_chipregs: Remove unused registers
Remove unused registers.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-11-09 10:44:29 +01:00
Kevin Townsend 7c85d38ae5 boards: b_u585i_iot02a: Add note on disabling TZ
Adds a note on how to disable TrustZone on the board, to be able to
reflash non TrustZone samples. Without this step, flashing will fail
for non TF-M or TrustZone sample applications.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-11-09 10:43:56 +01:00
William MARTIN 9aaeeb25d1 soc: arm: st_stm32: stm32f0: Add support for stm32f030x6
This commit adds the soc config for the STM32F030X6.

Signed-off-by: William MARTIN <william.martin@power-lan.com>
2022-11-09 10:43:41 +01:00
Francois Ramu 5857b7ea41 tests: drivers: uart async on nucleo_wb55rg with DMA
Configure through an overlay file, the nucleo_wb55rg board
for running the tests/drivers/uart/uart_async_api.
DMAMUX is used for transfer on channels 0 & 1 with
LPUART peripheral request 17 & 16.
No hw flowcontrol for this test.
Connect pin A0 & A1 of CN8 to PASS the test.
Note that I2C3 pin assignment might conflict (PC0 & PC1).

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-09 10:43:35 +01:00
Erik Brockhoff b1c0bc0c0a Bluetooth: controller: add central anchor point move to new LLCP
Add central functionality re. anchor point move to refactored LLCP

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-09 10:43:17 +01:00
Erik Brockhoff 26df2db60a Bluetooth: controller: add handling of preferred periodicity to new LLCP
Port central functionality re. preferred periodicity to refactored LLCP

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-09 10:43:17 +01:00
Erik Brockhoff c180afec11 Bluetooth: controller: Adding user ext. anchor point move to ctrl/CPR
Adding support for allowing user extension code to support deferring
anchor point moves. Refactored LLCP only.
Note: This is NOT supported by LEGACY LLCP impl.
KConfig'd by BT_CTLR_USER_CPR_ANCHOR_POINT_MOVE
Modified ll_conn_update API, to accommodate passing offsets
Modified CPR/CU context data structure
Modified CPR/CU procedure to handle anchor point move wait state
Fixed up unit tests, adding anchor point move cases to CPR/CU test

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-09 10:43:17 +01:00
René Beckmann 1dadb0371e CODEOWNERS, MAINTAINERS: Add entries for MQTT-SN
This adds the files related to MQTT-SN, with an additional exlude
to separate MQTT and MQTT-SN.

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2022-11-09 10:43:00 +01:00
René Beckmann 835976917a doc: net: mqtt-sn: Add documentation for MQTT-SN library
Add a page explaining the usage of the MQTT-SN library, the client
and the UDP transport, and add it to the `protocols` index page
next to MQTT.

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2022-11-09 10:43:00 +01:00
René Beckmann fdea8e5556 tests: net: mqtt-sn: Add test for MQTT-SN client
Validate that basic lifecycling and usage of the MQTT-SN client
work correctly by providing a mocked MQTT-SN transport. Connection
setup and state changes are tested.

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2022-11-09 10:43:00 +01:00
René Beckmann 1c0c603de3 tests: net: mqtt-sn: Add encoding/decoding test
Validate that the encoding and decoding part of the MQTT-SN library
work correctly using prepared byte arrays of messages.

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2022-11-09 10:43:00 +01:00
René Beckmann a507186d12 samples: net: mqtt-sn: Add MQTT-SN publisher sample
This sample demonstrates the usage of the MQTT-SN library over UDP.
It connects to a gateway, publishes to the topic "/uptime" and also
subscribes to "/number".

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2022-11-09 10:43:00 +01:00
René Beckmann 26758117d6 net: mqtt-sn: Add MQTT-SN library
This commit adds an implementation of MQTT-SN v1.2.
The specification is available on oasis-open.org:
https://www.oasis-open.org/committees/download.php/66091/MQTT-SN_spec_v1.2.pdf

The following things are missing in this implementation:
- Pre-defined topic IDs
- QoS -1 - it's most useful with predefined topics
- Gateway discovery using ADVERTISE, SEARCHGW and GWINFO messages.
- Setting the will topic and message after the initial connect
- Forwarder Encapsulation

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2022-11-09 10:43:00 +01:00
Hubert Miś b2c5d7cb60 sample: add icmsg multi endpoint sample
Add a sample presenting ipc_service working with icmsg multi endpoint
backend. The sample creates multiple instances of icmsg, one of them
consisting of two endpoints.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2022-11-09 10:41:43 +01:00
Hubert Miś dc9d479dea ipc: add a multi-endpoint feature to icmsg
The icmsg backend for ipc_service has a limitation of supporting only
on endpoint. This limitation is acceptable for many IPC instances.
However, some require to use multiple endpoints sharing a single
instance. To preserve the simple and the most efficient single-instance
backend, a separated backend is introduced implementing a wrapper
around icmsg core which adds multiple endpoints support.

There are two multi-endpoint ipc_service icmsg backends: one in the
initiator role, and the other one in the follower role. In a IPC
configuration one end of communication must be in the follower role
while the other one is in the initiator. The initiator initiates
an endpoint discovery handshake to establish enpoint identifiers for
requested endpoint names. The follower responds to requests sent by
the initiator.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2022-11-09 10:41:43 +01:00
Hubert Miś 6f450fdf18 ipc: separate icmsg core from ipc_service backend
icmsg library was implemented as a ipc_service backend. It is a simple
library with minimal feature set. To preserve its simplicity while
adding more features it is useful to introduce separated ipc_service
backends with added features. To reuse most of the icmsg code for the
simplest backend and other including more features, the core of icmsg
is separated from the simplest ipc_service to an icmsg module which
can be used by multiple backends.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2022-11-09 10:41:43 +01:00
Mariusz Skamra 8bbd2e1488 footprint: Add unicast_audio_{server, client} samples to tracking
Add a Bluetooth unicast audio samples to track their footprint.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-11-09 09:40:01 +00:00
Erik Brockhoff 85354c405c Bluetooth: controller: refactoring pdu length validation
Using a macro instead of repeated identical code for validation
Use macro for pdu length field encoding

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-09 09:34:35 +00:00
Erik Brockhoff 2a236e52db Bluetooth: controller: rename pdu_data_llctr struct SCA member
Rename struct member to adhere to general naming pattern

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-09 09:34:35 +00:00
Ranjani Sridharan 5f9c20db5a drivers/dai/intel/ssp: Skip setting config when playback/capture is active
The reference count, dp->sref, is never incremented for the SSP DAI as
we use the runtime PM API's to probe/remove the DAI during
resume/suspend. Therefore, use the DAI state to check if the DAI is
active in any direction before proceesing to set the config. This fixes
the IO errors seen during simultaenous playback and capture on the same
SSP.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-11-09 09:27:51 +00:00
Enjia Mai 0d5555e728 tests: kernel: mem_protect: fix incorrect skip on mem_map test
The mem_map test was skipped on all the phsical x86 boards when
running twister to test them. This error happens when migrating
the new ztest. Remove the incorrect platform allow to fix this
error.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-11-09 09:25:08 +00:00
Seppo Takalo 83d79b5996 net: lwm2m: We should not use read callbacks to generate new data
When read callbacks are used, it bypasses LwM2M engine data
handling and therefore LwM2M observation cannot work properly.

Read callbacks should be used only on special cases.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-11-09 09:16:22 +00:00
Christoph Schnetzler c364721796 net: sockets: Prevent compiler error if warnings being treated as errors
If gcc compiler option -Werror is used the warning,

declared inside parameter list will not be visible outside of this
definition or declaration [-Werror]

is treated as error, for

sockets_internal.h:18:28: ‘struct net_context’
sockets_internal.h:19:32: ‘struct zsock_pollfd’
fdtable.h:108:17: ‘struct k_mutex’

Signed-off-by: Christoph Schnetzler <christoph.schnetzler@husqvarnagroup.com>
2022-11-09 09:15:32 +00:00
Ashwini M Shinde 0f6c7e3d9c drivers: i2c: Support for i2c 10-bit addressing for STM32 target
Fixes #51060. Support for i2c 10-bit addressing in STM32 slave driver

Signed-off-by: Ashwini M Shinde <AshwiniMShinde@eaton.com>
2022-11-09 09:07:35 +00:00
Emil Gydesen 64c2d86a64 Bluetooth: ISO: Replace CONFIG_BT_DEBUG_ISO_DATA guard with BT_ISO_DATA_DBG
Instead of guarding all BT ISO data log statements with
CONFIG_BT_DEBUG_ISO_DATA, a new macro, BT_ISO_DATA_DBG, is
implemented to handle the guarding.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-09 09:05:03 +00:00
Emil Gydesen 36c5dd4bca Bluetooth: ISO: Guard addition ISO debug with CONFIG_BT_DEBUG_ISO_DATA
Guard additional debug statements in ISO that deals
with TX/RX with CONFIG_BT_DEBUG_ISO_DATA to avoid spamming
the log.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-09 09:05:03 +00:00
Sean Madigan 34cd4e520d Tests: Bluetooth: Add bt_disable babblesim test with gatt
Add babblesim test for bt_disable which enables bt, starts a connection,
GATT discovers, reads, writes then disables BT in a loop.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan a53446cd09 Bluetooth: Host: Check if EATT l2cap server is registered
bt_eatt_init currently registers a l2cap server, however should not
register a new one if it has already been registered - for example in
bt_enable previously.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan c3711ebc43 Tests: Bluetooth: Add bt_disable babblesim test
Add babblesim test for bt_disable which just enables and disables BT in
a loop.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan f88b19a833 Bluetooth: Host: init bt_workq and cancel rpa_update work
Init bt_workq in bt_enable so it can be safely disabled.

Cancel rpa_update work upon disable as it is no longer required.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan 666990b6e4 Bluetooth: Host: add pub_key_hci_disrupted function
Add bt_pub_key_hci_disrupted function for when hci is disrupted during
a pub key hci command, to clear callbacks and BT_DEV_PUB_KEY_BUSY flag.

Call this from bt_disable for the case bt_disable disrupts the pub key
hci command.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan a4fcf39a69 Bluetooth: Host: clean up after connections in bt_disable
Reset disconnected handles as is no longer needed after disable.

Created a destroy function to clear all connection states and cancel any
deferred work.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan c80b6d8223 Bluetooth: Host: reset adv_pool in bt_disable
Reset the adv_pool in disable so that advertising can be started after
re-enabling without issue.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan 0e010e8744 Bluetooth: Host: init fifos and slists before use
In bt_att_init, bt_conn_init and bt_l2cap_init, init the fifos and
slists before use. This means that they can be used after disable
without memory leakage.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan 0ef4f9740a Bluetooth: Shell: Add bt_disable to bluetooth shell app
bt_disable can now be used with the bluetooth shell.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Rubin Gerritsen 6ba2039d66 manifest: Update EDTT revision
Includes a fix for the scenario where a PHY update event
arrives at the same time as a disconnect event.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-11-09 09:03:07 +00:00
Stephanos Ioannidis 08316429f5 ci: Add workflow for cleaning up stale queued workflow runs
This commit adds a workflow to periodically clean-up the stale workflow
runs that are stuck in 'queued' state.

These stale workflow runs can result from occasional GitHub webhook
delivery mishaps and may affect the CI autoscaler decision making
process.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-11-09 11:12:48 +09:00
Jamie McCrae 693e4cda81 mgmt: mcumgr: img_mgmt: Remove packed attribute from some structs
Removes the packed attribute from the img_mgmt structs that do not
need it.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-08 22:38:20 +01:00
Chris Friedt 39b8b3ac8a posix: pthread_create: use spinlock for pthread_pool_lock
The `pthread_create()` function is not a cancellation point and
iterating over / mutating `posix_thread_pool` is not a blocking
operation, so use a spinlock for the internal `pthread_pool_lock`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-11-08 16:10:26 -05:00
Perry Hung 9b5bc03f86 drivers: can: sam: select CACHE_MANAGEMENT for SAM M_CAN
A regression was introduced in ef804d8408
when the M_CAN driver was swapped to use the generic dcache API, but
cache management was not enabled on SAM devices.

Enable cache management on SAM devices when CAN_SAM is selected.

Signed-off-by: Perry Hung <perry@genrad.com>
2022-11-08 15:41:10 -05:00
Michał Barnaś bcd4230d04 espi: auto enable the ESPI SAF XEC based on the device tree
The SAF XEC driver for eSPI was not enabled by default so sample
code for espi was failing. This commit changes the behavior to match
current scheme of enabling the drivers based on the status of required
device tree nodes.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-11-08 20:13:22 +00:00