Commit graph

89793 commits

Author SHA1 Message Date
Alberto Escolar Piedras 7d590a9d3d boards nrf*_bsim: Add tag to filter slow tests
Add a tag to filter slow bsim tests in CI
(or tests which do not provide much extra coverage and
are not worth running all the time in CI)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Alberto Escolar Piedras e6140f5422 tests/drivers uart_mix_fifo_poll: Allow configuring test length
This test is quite heavy and long in simulation,
but its length is meant to find unlikely issues which
may be triggered only very rarely.
Let's provide a kconfig value to chose how long the
test is, and set it to a lower value when running in simulation
(in CI) to save time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Alberto Escolar Piedras a6ea4490a9 drivers serial nrfx: Speed up for simulation
Increase the busy wait time granularity while runing in simulation
for poll mode. In this mode, the driver spends a *lot* of time
waiting for the UART to be done. The smallest frame time is
~10µs @ 1Mbps, so busywaiting in very small increments
is very wastefull as we keep shuting down and turning on the simulated
MCU.
Let's increase the busy wait time increments of the driver to 3 micros,
which should not change much the behaviour.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Alberto Escolar Piedras 685c88308d tests/drivers uart_mix_fifo_poll: Speed up for nrf52_bsim
Increase the UART speed to 1Mbps for the simulated nrf52
to reduce the amount of time spent busy waiting, and
therefore the real time duration of the test.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Bi Jian 06fa287d45 Bluetooth: Audio: Update audio location definitions
The meaning of bit0 in the audio location bitmap will change to
mono audio, so we update the audio location macro and releated
test cases.

Refer to BT SIG ES-22266.

Signed-off-by: Bi Jian <bi_jian@qq.com>
2024-01-16 14:27:40 -05:00
Chaitanya Tata dc9d5d9321 wifi: shell: Fix typo in comparison
The length should be 3 for WMM not 4.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-16 14:25:37 -05:00
Fabio Baltieri 49e8e11a77 scripts: set_maintainer: fix author == maintainer fallback logic
The "Submitter is same as Assignee" is comparing strings to <Area> and
always failing the condition, fix it by dropping the ".name".

Tested with ./scripts/set_assignees.py -v -y -P 67526 (now falls back to
the other maintainer as it should).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-16 14:24:05 -05:00
Konrad Derda 982fc416f8 tests: net: buf: add tests for data matching
Add new test case for veryfing matching between net_bufs' contents and
a given data buffer.

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-01-16 09:40:04 -06:00
Konrad Derda a5b868d94a net: buf: add function to match buffer's content with a given data
This commit adds a new function the net_buf's API that allow an user
to match the net_buf's content with a data without copying it to a
temporary buffer.

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-01-16 09:40:04 -06:00
Emil Gydesen f4cbf403e8 Bluetooth: BAP: Fix uninitialized variable in source_reconfig
The stream_in_subgroup variable in bt_bap_broadcast_source_reconfig
may have been uninitialized.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:37:28 -06:00
Emil Gydesen bf37784dea Bluetooth: PACS: Fix logical dead paths
In pac_notify and pac_notify_loc coverity found logical dead
paths since if both sink and source notify was disabled,
the functions would still be compiled, but would
never get past the default case.

This is not a real issue as the functions were never called
in that case, but to make coverity happy, and to prevent
any future issues where the functions may be called
incorrectly, the static functions are now fully guarded.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:35:37 -06:00
Emil Gydesen 9fc630d303 Bluetooth: CSIP: Use bt_crypto_aes_cmac instead of own
Instead of reimplementing the aes_cmac function, CSIP
will now use the bt_crypto_aes_cmac function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:33:58 -06:00
Emil Gydesen 64adf0b065 Bluetooth: BAP: Add log of err in bt_bap_stream_detach
We can't really do anything about it if it fails, so we
simply log the value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:32:22 -06:00
Emil Gydesen fd3e334539 tests: Bluetooth: Audio: Fix channel allocation
The channel allocation was incorrect when setting up multiple
streams to a single device, in which case we should apply
individual bits to each stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:31:12 -06:00
Emil Gydesen f9c116ec73 Bluetooth: CAP: Shell: Fix channel allocation
The channel allocation was incorrect when setting up multiple
streams to a single device, in which case we should apply
individual bits to each stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:31:12 -06:00
Anas Nashif ead02284f0 tests: uart: filter by CONFIG_SERIAL_HAS_DRIVER
filtering by CONFIG_SERIAL always matches, we need a different filter
and be able to enable the driver if supported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-16 10:29:39 -05:00
Anas Nashif 54d177a3e7 tests: uart: do not filter if we know which platforms to use
No need for filtering in one of the tests, since we have platform_allow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-16 10:29:39 -05:00
Tomas Galbicka d161d05e33 samples: mbox: Add support for NXP RT boards
This commit adds mbox sample support for these NXP boards:
 - MIMXRT1160-EVK
 - MIMXRT1170-EVK
 - MIMXRT1170-EVKB

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-01-16 09:29:28 -06:00
Laurentiu Mihalcea c82789c5ff drivers: serial: uart_mcux_lpuart: Switch to using DT_INST_IRQN_BY_IDX
After #63289, multi-level interrupts are now encoded using macro
magic. This means that using the generic DT_INST_IRQ_BY_IDX() to
fetch the INTID is no longer an option as the queried INTID will
be the one specified through the node's `interrupts` properties.
To fix this, switch to using DT_INST_IRQN_BY_IDX() which will
return the correctly encoded INTID.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-01-16 09:27:38 -06:00
Erwan Gouriou af126d010a include: pinctrl.h: Make PINCTRL_SKIP_SLEEP available with CONFIG_PM
In some cases, PINCTRL_STATE_SLEEP may be required even when
CONFIG_PM_DEVICE is not defined.
One example is the possibility/need to put JTAG pins to analog when
CONIG_PM=y and CONFIG_DEBUG=n.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-01-16 15:20:15 +00:00
Amrith Venkat Kesavamoorthi 879e3a42b0 drivers: gpio: PCF857x: Modify PCF8574 driver
Modify existing PCF8574 driver as PCF857x for:
PCF8574 - 8 channel I/O expander
PCF8575 - 16 channel I/O expander

Signed-off-by: Amrith Venkat Kesavamoorthi <amrith@mr-beam.org>
2024-01-16 15:19:14 +00:00
Emil Lindqvist 342e10b0b8 modem_cellular: add RSRP & RSRQ to U-blox SARA-R5 modem
This commit implements parsing of the CESQ extended signal quality AT
command, extracting RSRP and RSRQ which is relevant for LTE connections.
It's used in the U-blox SARA-R5 modem instance. Furthermore, the IMEI,
IMSI is extracted in the same modem.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2024-01-16 14:15:56 +00:00
Guennadi Liakhovetski 4204ca9bcb ace: fix DSP panic during startup
pm_device_runtime_get() must be called after pd_intel_adsp_init() is
called for each device, because the latter calls
pm_device_runtime_enable(), which sets the device runtime PM use
count to 0. The current wrong calling order causes a DSP panic
because of an unbalanced pm_device_runtime_put(). Fix this by
delaying pm_device_runtime_get() until the POST_KERNEL initialisation
step.

Fixes commit c3a6274bf5 ("intel_adsp: ace: power: Prevent HST
domain power gating")

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-16 07:31:24 -05:00
Alberto Escolar Piedras 1fc6550a25 native_simulator: Get latest from upstream
Align with native_simulator's upstream main
880eea00abf0191f3d986559876359a5422c9618

Which includes:
* 880eea0 HW scheduler: Minor optimization
* 37c0d86 Minor: Comment fix: Remove out of date reference

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 11:29:54 +00:00
Alberto Escolar Piedras a18cae9838 boards native_sim: Optimize irq handler
Speed up the interrupt handler when the MCU is woken
due to a phony interrupt (while busy waiting).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 11:29:54 +00:00
Alberto Escolar Piedras cd2ac64e8b boards nrf_bsim: Optimize irq handler
Speed up the interrupt handler when the MCU is woken
due to a phony interrupt (while busy waiting).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 11:29:54 +00:00
Jonathan Rico 38c39af4df Bluetooth: L2CAP: Prepend SDU header immediately
Previously it was not always possible to prepend the header.

It was not possible if the application neglected to reserve the space
for headers.  This is bad because it forces a buffer segment allocation
even if the buffer had enough room for the headers. E.g. a payload of 10
bytes in a netbuf of 30 bytes would have been segmented.

We now explicitly reject the buffer if it does not have the headroom.

This allows us to do a nice thing; simplify L2CAP segmentation.

We convert the SDU from the application into a PDU payload, by
prepending the SDU header, i.e. the SDU length in the original buffer.

This PDU payload is ready to be chunked into PDUs without having to keep
track of where in the SDU we are. This has the effect of removing a
bunch of logic in the segmentation machine.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-01-16 11:29:43 +00:00
Henrik Brix Andersen 6e8c8a1435 dts: bindings: sensor: move nRF comparator bindings to correct folder
Move the nRF comparator devicetree bindings from ADC to sensors, where the
rest of the comparator bindings are placed.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-16 11:29:29 +00:00
Aleksandr Khromykh 4e7d64b1b4 Bluetooth: Mesh: enable access responses randomization
Enable by default the access layer responses random delays.
Commit also adapts all mesh models, samples and
babblesim tests to use random delay functionality correctly.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2024-01-16 11:29:20 +00:00
Erwan Gouriou 0a2876de26 drivers: timer: stm32: Clean up related to STM32_LPTIM_CLOCK
Now that STM32_LPTIM_CLOCK choice symbol is defined from device tree,
remove the prompt which was defining it as a user selectable entry.

Remove the warning related to possible symbol misalignment with
device tree setting.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-01-16 10:07:02 +00:00
Erwan Gouriou 19cc4779e5 boards: stm32: Remove manual definition of CONFIG_STM32_LPTIM_CLOCK_LSE
CONFIG_STM32_LPTIM_CLOCK_LSE definition is now defined directly from
device tree, remove from boards definition.

Solving systematic warning about CONFIG_STM32_LPTIM_CLOCK_LSE being
selected with unsatisfied dependencies.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-01-16 10:07:02 +00:00
Erwan Gouriou 7a2e74604f soc: stm32: common: Define STM32_LPTIM_CLOCK from device tree inputs
Now that:
1 - LS Clocks sources values are identical accross series
2 - We're able to extract this value from device tree

define STM32_LPTIM_CLOCK choice symbol from device tree

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-01-16 10:07:02 +00:00
Erwan Gouriou b677ed0b69 include: dt-bindings: stm32_clocks: Rework definitions
Rework clock definitions in order to be able to make global assumptions
on some specific clocks values such as STM32_SRC_LSE and STM32_SRC_LSI.
As such, introduce stm32_common_clocks.h

Complete that change by reworking values definition by doing a manual
enum (as enum is not possible in dt-bindings header files).

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-01-16 10:07:02 +00:00
Erwan Gouriou a59e01d297 scripts: kconfigfunctions: Add dt_node_ph_array_prop_int/hex
Add dt_node_ph_array_prop_int/hex function to query value of cells
from a phandle-array property of a node at a given index of the array.

Based on dt_node_array_prop_int/hex.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-01-16 10:07:02 +00:00
Jaro Van Landschoot a897005b98 drivers: serial: sam u(s)art: correct interpretation of RXRDY flag
The receiver ready flag of the (channel) status register
for the sam controller was not being interpreted correctly
for both the uart and usart implementation,
according to the uart api.
Tested and confirmed using the sam4sa16ca.

Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
2024-01-16 10:01:17 +01:00
Flavio Ceolin 640a4586c0 pm: device_runtime: Fix domain mgmt in async put
The asynchronous put is not checking if the device was successfully
suspended before suspending its domain and it is not checking if the
domain was claimed. This patch adds these two checks.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-16 10:01:08 +01:00
Yuval Peress 9381e86cbe bmi160: fix value calculation
As an example, when the gyro range is set to 250 deg/sec the scale
was set to 133 where it really should be 133.160058662. This leads
to a 0.12% error in the value returned. By separating the numerator
and denominator, we're able to drastically reduce the error.

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-16 10:01:00 +01:00
Yuval Peress c743e72756 bmi160: Fix gyro range map
The range map was sorted wrong since the function
bmi160_range_to_reg_val() that uses it checks for the user value less
than the range component of the bmi160_range struct. This means that
no matter what range is set, the value will always end up 2000dps.

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-16 10:01:00 +01:00
Yuval Peress 2d09f1f566 test: bmi160: rename test directory
Rename the test directory to more accuratly reflect what's being
tested.

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-16 10:01:00 +01:00
Yuval Peress b58b03196b bus: emul: Update i2c/spi emulators with mock transport
Adding a hook for tests to inject a mock transport and migrating the
accel test to test bmi160 specific things. The old version of the test
which checks for read values is now covered by the generic test in
the sensor build_all target.

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-16 10:01:00 +01:00
Yuval Peress fd07f8ce69 bmi160: Implement attr_get
Add support for getting the following attribute values:
- SENSOR_ATTR_OFFSET
- SENSOR_ATTR_SAMPLING_FREQUENCY
- SENSOR_ATTR_FULL_SCALE

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-16 10:01:00 +01:00
Yuval Peress 9898b2fc3f bmi160: Make changes to align driver to datasheet
The logic in the driver was not aligned to the datasheet. Also,
temperature reading was not being done in fetch, but in channel_get.
There was also some extra conversions from SI->register->SI when
setting the range, this was causing the register value calculation to
produce an incorrect scale in some cases.

Tests were added to cover these cases.

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-16 10:01:00 +01:00
Yuval Peress be563239c8 sensor: testing: Update sensor emul backend
Update the backend for sensor emulators to include a function for
setting the offset as well as a function to query an attribute's
metadata such as bounds and increment size. Additionally, add
backend support for setting the _xyz channel values.

Make the appropriate test changes to accomodate.

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-16 10:01:00 +01:00
Jukka Rissanen 6033161216 net: shell: Avoid gcc warning print with string catenation
gcc prints this warning message

'strncat' specified bound 1 equals source length [-Wstringop-overflow=]
   58 |                 strncat(fd, "C", 1);

There was no error in the code but avoid the warning by not using
strncat().

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-16 10:00:45 +01:00
Jukka Rissanen eb22110365 tests: net: socket: Add correct path to socket.h for POSIX_API
If CONFIG_POSIX_API is enabled, then the socket.h is found under
zephyr/posix/sys/socket.h etc. This allows one to compile the
socket test applications without error prints.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-16 10:00:45 +01:00
Jukka Rissanen f5e95852ce net: shell: Add sockets services prints
The socket services users to "net sockets" command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-16 10:00:45 +01:00
Jukka Rissanen f4373709e7 samples: net: sockets: Add echo-service sample
The echo-service sample demostrates how to use the socket
service API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-16 10:00:45 +01:00
Jukka Rissanen 6ea6326e79 tests: net: socket: service: Add tests for socket service API
Simple tests that verify that the socket service API works
as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-16 10:00:45 +01:00
Jukka Rissanen eff5d02872 net: sockets: Create a socket service API
The socket service provides a similar functionality as what
initd provides in Linux. It listens user registered sockets
for any activity and then launches a k_work for it. This way
each application does not need to create a thread to listen
a blocking socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-16 10:00:45 +01:00
Greter Raffael 87916d7af3 soc: gd32vf103: Correct vector table alignment
For a CLIC the vector table has to be aligned by 512 bytes, if there are
between 65 and 128 interrupts, which is the case for the gd32vf103.

`isr_wrapper` has to be aligned to 64 bytes, s.t. the lower 6 bits of
mtvec are 0.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-16 10:00:36 +01:00