Commit graph

66116 commits

Author SHA1 Message Date
Jedrzej Ciupis 8ed202b43d drivers: ieee802154: fix freeing Rx buffer
This commit fixes a bug where an already received Rx frame could not be
processed by the IEEE 802.15.4 driver.

In the current implementation, buffer is marked as free and released to
the buffer pool after `nrf_802154_buffer_free_raw` finishes executing.
However, delays caused by thread scheduling might result in a new frame
being already received and provided to the driver before
`nrf_802154_buffer_free_raw` returns. Such a situation ends in an
assertion now.

This commit changes that behavior by marking the buffer as free before
calling `nrf_802154_buffer_free_raw`.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-07-04 16:39:14 +02:00
Jedrzej Ciupis c5df601ed5 drivers: ieee802154: print serialization error on nRF5340
This commit increases verbosity of serialization error handler for
nRF5340 application core. The handler prints the error code now.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-07-04 16:39:14 +02:00
Daniel DeGrasse aed57105a5 dts: bindings: add binding for zephyr,sdmmc-disk
Add binding for zephyr sdmmc disk device, which uses the SD
subsystem to manage an SD memory card.

Fixes #46410
Fixes #46266

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-07-04 16:34:03 +02:00
Enjia Mai ce18d3c4ff requirements: add netifaces, needed by adsp runner
Needed for running tests on intel_adsp_cavs boards, the cavstool.py
are using it to get the host ip address automatically.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-04 16:33:03 +02:00
Pavel Vasilyev 867b88635d Bluetooth: Mesh: Don't do bulk tx of seg msgs
In the current implementation of segmented messages transmission, the
transport layer will put as many segments as it can into the advertiser
buffer. If a long segmented message is transmitted, there is a chance
that an ack will be received before the transport layer finishes sending
the first batch of segments. This will trigger retransmissions of those
segments that are marked as missing in the ack, that are also the
segments that are scheduled (or about to be scheduled), but not sent
out by the advertiser yet. Thus, the receiver may receive already
received segments.

This commit changes 2 things:
- it prevents rescheduling transmission of missing segments upon
reception of ack. Thus, ack doesn't cause segments duplication in the
advertiser buffer;
- it doesn't put all segments to the advertiser buffer. Thus, ack that
acknowledges all segments can immediately stop rescheduling segments as
they are already received;

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-07-04 14:31:44 +00:00
Ryan McClelland 669a543041 adc: ads1x1x: add CODEOWNER
add myself as a CODEOWNER for adc_adx1x1x.c

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-07-04 16:28:43 +02:00
Ryan McClelland 86bb6abbd0 adc: ads1x1x: run clangformat
run clangformat on adc_ads1x1x.c

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-07-04 16:28:43 +02:00
Ryan McClelland 3d7fc77678 adc: ads1x1x: macro cleanup
clean up the unique macros using existing macros

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-07-04 16:28:43 +02:00
Aleksander Wasaznik 462f3e2c11 Bluetooth: Host: Refactor tx_notify, simplify locking
The control flow around the irq-lockout used for fetching from
`tx_complete` has been simplified so that there is exactly one
line with irq_unlock that is unconditionally called.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-07-04 16:27:08 +02:00
Aleksander Wasaznik 9339f249dc Bluetooth: Host: Refactor tx_notify, use CONTAINER_OF
The cast from `sys_snode_t` to `struct bt_conn_tx` assumes `node` is the
first field in `struct bt_conn_tx`. It's better to future-proof this by
using `CONTAINER_OF` to locate `node`.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-07-04 16:27:08 +02:00
Kumar Gala 123c088c4a drivers: serial: uart_native_posix: Replace use of DT_INST_LABEL
As we work to phase out devicetree 'label properties, convert
driver to just use dev->name instead of DT_INST_LABEL.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-04 14:26:30 +00:00
Daniel DeGrasse fdefd873fc sd: add proper handling for DISK_IOCTL_CTRL_SYNC
Add handling for DISK_IOCTL_CTRL_SYNC to SD subsystem. Note that
SD caching is not enabled by the SD stack, so the only required
operation to sync the disk is to wait for any active data programming
to complete.

Fixes #46689

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-07-04 14:25:33 +00:00
Seppo Takalo 71d1b277cb manifest: Pull latest net-tools
New configurations have been added to the net-tools repository
so pull in the latest one.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-07-04 16:25:08 +02:00
Erwan Gouriou 890d42759b drivers: spi: stm32: Use 'st,stm32h7-spi' compatible input when possible
Instead of using or'ed list of Kconfig options listing the compatible
series with what can be called "stm32h7 variant", use the matching
compatible information.
This will prevent to update the driver next time that a compatible series
is ported into zephyr.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-07-04 14:23:34 +00:00
Erwan Gouriou 70c039d430 dts: stm32: Populate "st,stm32h7-spi" compatible when required
When required, add "st,stm32h7-spi" compatible on stm32 compatible
series (today: stm32h7, stm32mp1 and stm32mp1).

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-07-04 14:23:34 +00:00
Erwan Gouriou ccebe683c6 dts: bindings: spi: Add a new stm32h7 spi compatible
Add a stm32h7 spi compatible.
This compatible intends to match all SPI hardware blocks that
can be compatible with the one available in stm32h7 devices,
for instance, but not limited to stm32u5 and stm32mp1.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-07-04 14:23:34 +00:00
Jose Alberto Meza 008593c57b boards: arm: mec172x: Configure KSI with internal pull-up
Even though possible to use external pull-up and open drain buffer,
prefer internal pull-up to reduce power consumption.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-07-04 16:23:03 +02:00
Erik Robstad 06586e960d samples: Bluetooth: broadcast_audio_sink sample bugfix
Fixed handling of k_sem_take() return codes.
Also some minor cleanup in broadcast_audio samples.

Signed-off-by: Erik Robstad <erik.robstad@nordicsemi.no>
2022-07-04 16:22:28 +02:00
Berend Ozceri 394d5f7656 mgmt: smp: Allow building with POSIX API in UDP transport
If the POSIX API is selected via the POSIX_API option, don't also select
the conflicting NET_SOCKETS_POSIX_NAMES and use the POSIX headers instead.

Signed-off-by: Berend Ozceri <berend@recogni.com>
2022-07-04 14:22:13 +00:00
Hake Huang 3051ba19f0 tests: counter: disable driver debug message
to avoid log log in test report, disable driver debug message

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-07-04 16:21:02 +02:00
Veijo Pesonen 94b81664e4 net: lwm2m: default stack size with SenML CBOR
SenML CBOR data is stored statically in RAM and does not use process
stack.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-07-04 16:20:03 +02:00
Jose Alberto Meza b4d82289e1 drivers: spi: xec: mec172x: Reflect update device tree properties
Propagate update device tree properties.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-07-04 16:18:42 +02:00
Jose Alberto Meza 2fed22c26a boards: arm: mec172xevb: Update SPI HW block properties
Reflect device tree field name.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-07-04 16:18:42 +02:00
Jose Alberto Meza b6d2f22bd4 dts: bindings: spi: Use consistent dts names for mec172x
Use consistent name for SPI HW block property so applications
using a device tree overlay work transparently.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-07-04 16:18:42 +02:00
Jose Alberto Meza eebd67ca7b dts: arm: microchip: mec172x: Use consistent dts property names
Use consistent name for SPI HW block properties across Microchip
HW,  so applications using a device tree overlay work
transparently.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-07-04 16:18:42 +02:00
Torbjörn Leksell 63db5f8e34 Modules: Percepio TraceRecorder: Update module from v4.6.0(RC1) to v4.6.3
This update updates the TraceRecorder module from version v4.6.0
(RC1) to v4.6.3. This update fixes some minor bugs where
deleted threads werent removed from the thread table. This
update is also in preparation for updates which changes
some trace hook arguments in Zephyr.

The update to v4.6.3 also improves syscall tracing by
including the id and name as parameters when logging
these events.

Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com>
2022-07-04 16:16:02 +02:00
Keith Packard fb1d092955 tests: ec_host_cmd: Make sure expected_dut_to_host fits in buffer
If struct tx_structure is too large than the buffer that
expected_dut_to_host references, leading the compiler to generate a warning
about the possibility of buffer overflow.

Leave out the 'struct ec_response_too_big' so that 'struct tx_structure'
fits within the 256 byte buffer.

This was caught when using GCC 11.3.0 building the test for native_posix.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-07-04 16:11:51 +02:00
Matthias Freese 938eae3372 drivers: gpio: ti: add gpio extender sn74hc595
Add driver for spi based gpio extender ti sn74hc595.

Signed-off-by: Matthias Freese <m.freese@web.de>
2022-07-04 16:10:37 +02:00
Matthias Freese 5043083a0f dts: binding: gpio: add gpio extender sn74hc595
Add bindings for spi based gpio extender sn74hc595.

Signed-off-by: Matthias Freese <m.freese@web.de>
2022-07-04 16:10:37 +02:00
Grant Ramsay e27f48b38a Bluetooth: Host: Fix crash if HCI send fails
bt_dev.sent_cmd is unreferenced and assigned NULL within hci_cmd_done().
Calling net_buf_unref() again causes a null pointer dereference

Signed-off-by: Grant Ramsay <grant.ramsay@hotmail.com>
2022-07-04 16:09:17 +02:00
Emil Gydesen 4c471914b9 Bluetooth: Audio: Remove codec from bt_audio_broadcast_sink_sync
The codec (or rather codec configuration) is now taken from the
previously received BASE. This also means that the BASE (with
the codec configurations) is now also stored statically.

When the application attempts to synk to the broadcaster
the stack will lookup the codec configuration based on the
bis index, as a BASE may have multiple subgroups
with multiple codec configurations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 16:08:52 +02:00
Aleksandar Markovic 9b0a506cf0 wifi: esp_at: Fix Coverity issues related to ESP_MAX_DNS
If the preprocessor constant ESP_MAX_DNS is defined as 0,
Coverity reports a condition that can never be true, and some
dead code as well. This also violates MISRA rules on dead code.

This is caused by this segment in drivers/wifi/esp_at/esp.h:

 #if defined(CONFIG_WIFI_ESP_AT_DNS_USE)
 #define ESP_MAX_DNS	MIN(3, CONFIG_DNS_RESOLVER_MAX_SERVERS)
 #else
 #define ESP_MAX_DNS	0
 #endif

Fix this by never setting ESP_MAX_DNS to 0, as is the currently
case. Define ESP_MAX_DNS only if it is configured through
CONFIG_WIFI_ESP_AT_DNS_USE and CONFIG_DNS_RESOLVER_MAX_SERVERS:

 #if defined(CONFIG_WIFI_ESP_AT_DNS_USE)
 #define ESP_MAX_DNS	MIN(3, CONFIG_DNS_RESOLVER_MAX_SERVERS)
 #endif

Since CONFIG_DNS_RESOLVER_MAX_SERVERS is 1 or greater, ESP_MAX_DNS
will always be greater than 0.

If, on the other hand, ESP_MAX_DNS is not defined, relevant
functions will be reduced to empty stubs, since in that case
they do not make sense.

There could be a cleaner solution to this, but this one is the
least intrusive (involves less code changes).

Coverity-CID: 219490
Coverity-CID: 219513
Coverity-CID: 219520
Coverity-CID: 219524

Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
2022-07-04 16:06:41 +02:00
TOKITA Hiroshi 8e330cfcd6 tests: exclude arduion_mkrzero from uart_async and spi_loopback tests
uart_async test and spi_loopback test require UART and SPI
with an ASYNC option.
The SAM0 UART/SPI driver requires configuring DMA support.
Arduino MKRZero is not DMA configured like other SAM0 boards.
We exclude it from the tests.

ea36f9b and f4c5bdf already exclude other SAM0 boards from these tests.
Arduino MKRZero also followed these PR policies.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-07-04 16:00:56 +02:00
TOKITA Hiroshi 3b4e6c76f6 samples: fat_fs: Add arduino_mkrzero to supported board list
Update README.rst for adding arduino_mkrzero to
supported board list in README.rst.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-07-04 16:00:56 +02:00
TOKITA Hiroshi 085bee1587 boards: arm: Add support Arduino MKR Zero
The Arduino MKR Zero board is SAMD21 development board.
It has microSD card slot and secure element.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-07-04 16:00:56 +02:00
TOKITA Hiroshi 4dee1f1df0 dts: bindings: gpio: Adding Arduino MKR header
Add MKR header connector that is implemented by Arduino MKR series.
This allows hardware with compatible headers to define the related GPIOs.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-07-04 16:00:56 +02:00
Emil Gydesen 6c74c51c9c Bluetooth: Audio: Change context type for BAP shell
The shell module will now use BT_AUDIO_CONTEXT_TYPE_ANY
instead of BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED as that provides
a more flexible solution.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Emil Gydesen 68593a105b Bluetooth: PACS: Fix support context if SRC/SNK disabled
If CONFIG_BT_PAC_SNK or CONFIG_BT_PAC_SRC was not enabled, the
function would not build due to missing Kconfig
(CONFIG_BT_PACS_SNK_CONTEXT or CONFIG_BT_PACS_SRC_CONTEXT).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Emil Gydesen 3436cc12d6 Bluetooth: Audio: Add guards for calling bt_audio_capabilities
Add guards for calling bt_audio_capabilities when
CONFIG_BT_AUDIO_CAPABILITY=n

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Emil Gydesen 2071c66249 Bluetooth: Audio: Disable HAS when unicast_server is disabled
The HAS depends on the unicast server, and should be
disabled in the `no_unicast_server` as well as depend
on the CONFIG_BT_AUDIO_UNICAST_SERVER config.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Emil Gydesen 3580147263 Bluetooth: Audio: Fix some bad guards in audio shell
Some functions are only used for the unicast server
but was guarded by CONFIG_BT_AUDIO_UNICAST instead of
CONFIG_BT_AUDIO_UNICAST_SERVER.

Some parts of the unicast-server-only code also had
client specific code that would never be called.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Emil Gydesen bb6c0866d8 Bluetooth: Audio: Add PACS for broadcast sink
Add support for using PACS and/or capabilities for
the broadcast sink role. PACS and capabilities were
originally only supported for the unicast server
role, so the PACS callbacks were moved their own
struct, as if a device supports both the unicast
server role and the broadcast sink role, it will
only have a single PACS instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Tristan Honscheid 79fcb6ab43 ztest API Migration: bluetooth/ll_settings
Migrate the unit tests at `bluetooth/ll_settings` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:58:02 +02:00
Tristan Honscheid 074a46adb3 ztest API Migration: bluetooth/init
Migrate the unit tests at `bluetooth/init` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:57:50 +02:00
Tristan Honscheid 84f39cf4a6 ztest API Migration: bluetooth/hci_prop_evt
Migrate the unit tests at `bluetooth/hci_prop_evt` to use the
new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:57:34 +02:00
Tristan Honscheid 4ea68e4604 ztest API Migration: bluetooth/hci_codecs_info
Migrate the unit tests at `bluetooth/hci_codecs_info` to use
the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:57:20 +02:00
Tristan Honscheid d76da3ee94 ztest API Migration: bluetooth/ctrl_user_ext
Migrate the unit tests at `bluetooth/ctrl_user_ext` to
use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:56:24 +02:00
Tristan Honscheid 144d11e539 ztest API Migration: bluetooth/ctrl_sw_privacy_unit
Migrate the unit tests at `bluetooth/ctrl_sw_privacy_unit` to
use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:56:08 +02:00
Tristan Honscheid 8b76ea680f ztest API Migration: bluetooth/bluetooth
Migrate the unit tests at `bluetooth/bluetooth` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:54:11 +02:00
Tristan Honscheid 24845d56ce ztest API Migration: bluetooth/ctrl_sw_privacy
Migrate the unit tests at `bluetooth/ctrl_sw_privacy` to use
the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:53:37 +02:00