Commit Graph

94173 Commits

Author SHA1 Message Date
Emilio Benavente 13735ff789 dts: arm: nxp: nxp_mcxn94x: updated dts for CTimer
Updated dts for MCXN94x with support for CTimer.

Signed-off-by: William Tang <william.tang@nxp.com>
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-04-23 21:25:38 +00:00
Chun-Chieh Li 77381fff10 tests: drivers: i2c: i2c_target_api: fix pinctrl for numaker_pfm_m467
Fix some pins don't update to meet resolved pinmux format

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2024-04-23 21:25:08 +00:00
Alberto Escolar Piedras 84e7107b32 Revert "posix: use sys_sem instead of k_spinlock for pool synch"
This reverts commit 6e66aa1f7c.

And fixes an indentation issue in the original code,
which triggers checkpatch.

This PR:
https://github.com/zephyrproject-rtos/zephyr/pull/71718
introduced a regression breaking CI:
https://github.com/zephyrproject-rtos/zephyr/issues/71814
Let's just revert it until a better fix is done.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-23 11:51:44 -04:00
Alberto Escolar Piedras c9faea2c2b Revert "clang-format: add entry for SYS_SEM_LOCK()"
This reverts commit 36bbd3057e.

This PR:
https://github.com/zephyrproject-rtos/zephyr/pull/71718
introduced a regression breaking CI:
https://github.com/zephyrproject-rtos/zephyr/issues/71814
Let's just revert it until a better fix is done.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-23 11:51:44 -04:00
Alberto Escolar Piedras f9d350f29e Revert "sys_sem: add a for-loop-like macro similar to spinlocks"
This reverts commit 3c6fdf27d0.

This PR:
https://github.com/zephyrproject-rtos/zephyr/pull/71718
introduced a regression breaking CI:
https://github.com/zephyrproject-rtos/zephyr/issues/71814
Let's just revert it until a better fix is done.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-23 11:51:44 -04:00
Nikolay Agishev c217703830 ARC: Add omitted defconfig file
After moving to HWMv2 em_starterkit_emsk_em11d_defconfig file was omitted.
Some of tests for the emks_em11d platform became broken.
This PR fixes https://github.com/zephyrproject-rtos/zephyr/issues/71753

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2024-04-23 15:48:14 +02:00
Vinayak Kariappa Chettimada 9bcf275d8b Bluetooth: Controller: Ignore bit 1 set in Initiating_PHYs
Ignore LE 2M PHY being set in Initiating_PHYs of the
LE Extended Create Connection command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-23 13:44:31 +00:00
Håvard Reierstad e56494634a bluetooth: mesh: Adapt BLOB IO to RRAM write size
Adapts flash writing for BLOB IO to RRAM. The previously used write
block alignment is not needed for RRAM.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-04-23 13:43:31 +00:00
Emil Gydesen e7ee26d5ed Bluetooth: BAP: Shell: Moved RX and TX fields into a union
An audio stream is unidirectional, so it's always either
TXing or RXing, so the fields can safely be moved to an
enum.

The struct now has both a is_rx and is_tx field. The reason
why two bools are being used, is that the both of them may
be false (we need 3 states).

All access to the rx and tx structs in the union shall be
guarded by these fields.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-23 15:36:39 +02:00
Sylvio Alves 4a4d7584ff boards: rename and update esp32 related conf and overlay files
There are several esp32-based boards that its conf and overlay
files are missing proper renaming to match cpu cluster.

This also removes all _SOC_ name from files.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-04-23 15:36:13 +02:00
Laurentiu Mihalcea 799a456c25 nxp: imx8ulp: add audio-related nodes
Add DTS nodes for the IPs used in audio processing.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-23 15:36:01 +02:00
Nazar Palamar 6d684c91c2 drivers: bluetooth/cyw43xxx: check that hw_flow_control is set
Add BUILD_ASSERT to check that hw_flow_control is set.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-04-23 15:35:53 +02:00
Nazar Palamar 62e6fbb9d8 board: cy8cproto_062_4343w: Enable HW Flow control for HCI H4
HW Flow control must be enabled for HCI H4 UART communication.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-04-23 15:35:53 +02:00
Andy Sinclair 1f156c352c drivers: mfd: npm1300: Fixed configuration of long press reset
Added write of strobe register after setting long press reset
configuration.  This is needed to apply the new value.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2024-04-23 15:35:46 +02:00
Marcin Szymczyk 2d52882647 dts: riscv: nordic: enable CLIC nodes
Interrupt controller driver requires those nodes to be enabled.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-04-23 15:35:12 +02:00
Marcin Szymczyk ab79670fd6 soc: nordic: vpr: remove IRQ handling and enable RISCV_PRIVILEGED
IRQ handling functions are now in interrupt controller.
Enable necessary KConfigs to support CLIC properly.
A nice side effect of enabling RISCV_PRIVILIGED is that
`vector.S` is no longer necessary as common code handles
that.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-04-23 15:35:12 +02:00
Marcin Szymczyk 5bba170ea7 drivers: interrupt_controller: add intc_nrfx_clic
Add interrupt controller driver for Nordic Semiconductor
VPR CLIC.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-04-23 15:35:12 +02:00
Jonathan Rico e4364413c2 Bluetooth: L2CAP: Don't try to send on disconnected channel
We could start executing the work item after the channel has been
disconnected or destroyed, due to a race condition.

Double-check we are connected before attempting to send data.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-23 15:34:48 +02:00
Jonathan Rico 57b94080b2 Bluetooth: L2CAP: don't use NULL buf
Allocation of `buf` can fail. It just very rarely happens in practice.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-23 15:34:42 +02:00
Aleksander Wasaznik df1e4aa70f Bluetooth: refactor add `is_host_managed_ccc`
This check is repeated many times in `gatt.c`, with various comments.
This patch refactors these occurrences into a named function.

Resolves: https://github.com/zephyrproject-rtos/zephyr/issues/41789

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-04-23 15:34:25 +02:00
Jonathan Rico a5ae3b026b Bluetooth: conn: Don't wait for buf allocation in syswq
We can't just keep blocking the syswq, people be mad.
Override the timeout value so we always have K_NO_WAIT.
Also print a message to whomever's listening.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-23 15:34:10 +02:00
Szymon Janc baf3cc9fe0 bluetooth: OTS: Delay indications to system workqueue
OTS requires that indications about state change are sent after
response to ATT Write.

OTS Specification p.4.4.4.: "An OLCP or OACP operation is started
when the ATT Write Response is received from the Object Server as
a result of the Object Client writing an Op Code to a control point
to perform some desired action. The control point operation ends
when the Object Server sends an indication to the Object Client
 with the Op Code set to Response Code."

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-04-23 15:32:07 +02:00
Rubin Gerritsen 237c59585e Bluetooth: Host: Rename bt_conn_state_t states for clarity
To make it easier to understand the code, the following was done:
- Use INITIATING/ADV for state names that are exclusive to central
  or peripheral. Previously it was not necessarily clear that the state
  BT_CONN_CONNECTING was for central only by just looking at where
  it was used. The terms INITIATING/ADV were used in favor
  of central and peripheral as these terms also work for SCO connection
  establishment.
- BT_CONN_CONNECTING_SCAN -> BT_CONN_SCAN_BEFORE_INITIATING
  to make it more clear that we are not scanning and connecting at
  the same time. The new name should make it more clear why we are
  scanning - only with the intention to start the initiator later.
- BT_CONN_CONNECTING_AUTO -> BT_CONN_INITIATING_FILTER_LIST.
  This makes it clear that this state is something different than
  BT_CONN_AUTO_CONNECT.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-04-23 15:31:59 +02:00
Rubin Gerritsen 1c132c90aa Bluetooth: Host: Document flags used for connection establishment
When initially reading some of the host code it was unclear to me
why they were needed an how they are used.
By adding some documentation,
this can hopefully make it easier for others to understand these.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-04-23 15:31:59 +02:00
Dmitrii Golovanov 978c0e4273 twister: testplan: Handle unknown test level
Fail a test run gracefully when an unknown test level
is requested to execute with the current test plan.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-04-23 15:31:50 +02:00
Tom Chang a5741c8cca drivers: espi: npcx: add dependency for espi taf
This CL adds CONFIG_FLASH as dependency for ESPI_TAF_NPCX.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-04-23 15:31:44 +02:00
Declan Snyder f0f83d214e drivers: ptp_clock_nxp_enet: misc fixes
1. Correct node label in k64 overlay for ptp test
   - Not sure if this actually matters since it appears
     that actual hardware is no longer tested in net tests

2. Include fsl_enet with <> instead of "".

3. Build the ptp clock driver only if the ethernet driver is built
   - Technically I think the 1588 timer should be able to be used
     even if the ethernet mac is not used, but I would imagine this
     to be an extraordinarily rare, weird, and niche use case, so to fix
     the current CI error caused by net test disabling ethernet drivers,
     couple the ptp clock driver to the ethernet driver in the build
     configuration.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-04-23 15:31:33 +02:00
Richard Wheatley e2656a24a9 tests: drivers: counter: counter_basic_api
Correctly show skips in final statistics.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-04-23 15:31:20 +02:00
Carles Cufi a1dd9a5f6e bluetooth: host: Fix alignment of gatt_chrc
The following warning is issued by clang:

warning: field  within 'struct gatt_chrc' is less aligned than 'union
gatt_chrc::(anonymous at subsys/bluetooth/host/gatt.c:1859:2)' and
is usually due to 'struct gatt_chrc' being packed, which can lead
to unaligned accesses [-Wunaligned-access]

This is due to the fact that the uint16_t uuid field requires 2-byte
alignment but it is not marked as packed. Since the enclosing struct is
indeed packed, the required alignment is not guaranteed and so clang
complains. Fix it by ensuring that the union is marked as packed too.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-04-23 14:23:04 +03:00
Jędrzej Ciupis f18ea95758 drivers: timer: nrf_grtc_timer: fix return type signedness
Negative error codes cannot be returned if the function returns an
unsigned integer. Change function's API to return the read compare
register value through a pointer and the actual result as a signed
integer.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-04-23 11:07:37 +00:00
Chris Friedt 6e66aa1f7c posix: use sys_sem instead of k_spinlock for pool synch
Based on Andy's talk at eoss 2024, use the sys/sem.h api instead
of the spinlock.h api to synchronize pooled elements since it
has minimal overhead like semaphores but also works from
userspace.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-23 07:01:25 -04:00
Chris Friedt 36bbd3057e clang-format: add entry for SYS_SEM_LOCK()
SYS_SEM_LOCK() is a for-loop-like macro similar inspired by
K_SPINLOCK().

Add an entry to .clang-format so that autoformatting works as
expected.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-23 07:01:25 -04:00
Chris Friedt 3c6fdf27d0 sys_sem: add a for-loop-like macro similar to spinlocks
Add SYS_SEM_LOCK() and SYS_SEM_LOCK_BREAK which are mostly the
same as K_SPINLOCK() and K_SPINLOCK_BREAK.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-23 07:01:25 -04:00
Théo Battrel 909ad8170c Bluetooth: Host: Deprecate auto name in AD
Deprecate the advertiser options `BT_LE_ADV_OPT_USE_NAME` and
`BT_LE_ADV_OPT_FORCE_NAME_IN_AD`.

Reasons:

- It is out of place in the advertiser options, as it acts on
  advertising data and not configuration
- The behavior is not clear. All of these are trick questions:
  - where does the data for the name go?
  - do I have to allocate memory for this?
  - does it work the same in legacy vs extended advertising?
- The trade-off between UX improvement and extra complexity in the host
  is debatable. Hundreds of lines in the stack to avoid making the user
  type out less than ten.

Also deprecate the following macros that uses those options:

- `BT_LE_ADV_CONN_NAME`
- `BT_LE_ADV_CONN_NAME_AD`
- `BT_LE_ADV_NCONN_NAME`
- `BT_LE_EXT_ADV_CONN_NAME`
- `BT_LE_EXT_ADV_SCAN_NAME`
- `BT_LE_EXT_ADV_NCONN_NAME`
- `BT_LE_EXT_ADV_CODED_NCONN_NAME`

Update the migration guide and the release note for Zephyr 3.7 to
describe those changes.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-23 12:42:24 +02:00
Théo Battrel f461ae574f Bluetooth: Mesh: Remove usage of auto name in AD
The advertiser options to automatically add the name in the scan
response and the advertising data will be deprecated.

The Mesh files `proxy_srv.c` and `pb_gatt_srv.c` were using
BT_LE_ADV_OPT_USE_NAME. Add the device name in the advertising data
directly.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-23 12:42:24 +02:00
Théo Battrel 6c9010be9f Bluetooth: Shell: Remove usage of auto name in AD
The advertiser options to automatically add the name in the scan
response and the advertising data will be deprecated.

Update the Bluetooth shell and its documentation to not use those
options anymore.

The option of the legacy advertiser run with `bt advertise` and the
behavior hasn't changed. The code has been updated to no longer use the
advertiser option but the original behavior has been reproduced.

The option of the extended advertiser have been updated to be more
explicit. The options `name` and `name-ad` have been removed from the
`bt adv-create` and `bt adv-param`. The option `name` and `dev-name`
have been added to the `bt adv-data` command.

- `name <str>` will advertise the given name.
- `dev-name` will advertise the device name.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-23 12:42:24 +02:00
Théo Battrel 7bc63985af Bluetooth: Samples: Remove uses of auto name in AD
The advertiser options to automatically add the name in the scan
response and the advertising data will be deprecated.

Update the samples that were using those options by explicitly adding
the device name in the advertising data or the scan response data.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-23 12:42:24 +02:00
Théo Battrel 9400823dcd Bluetooth: Tests: Remove usage of auto name in AD
The advertiser options to automatically add the name in the scan
response and the advertising data will be deprecated.

Update the tests that were relying on those options. A lot of test were
actually not using the name, for those the name have simply been
removed. For the others that were using the name, add it in the
advertising data or the scan response data.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-23 12:42:24 +02:00
Théo Battrel 93fde589af Bluetooth: Host: Add new advertiser params macro
With the deprecation of the advertiser options to automatically add the
device name in the scan response and advertising data, some macro used
to set the advertiser parameter also became deprecated. That's the case
for `BT_LE_EXT_ADV_CONN_NAME` and `BT_LE_EXT_ADV_SCAN_NAME`. The issue
is that those two macro didn't had their equivalent without including
the name. So this commit add `BT_LE_EXT_ADV_CONN` and
`BT_LE_EXT_ADV_SCAN` to be used instead.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-23 12:42:24 +02:00
Flavio Ceolin 1ed452b295 tests: pm/device_runtime: Run in native_sim only
This is an API test and it was not designed to run in a real target.
Some attempts to run this test in devices cause the device to hang
after the test execution because the device sleeps and no wake up
source is set.

Fixes #68453

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-04-22 21:03:06 -04:00
Martin Tverdal dbf62a5a2a drivers: clock_control: Update XTAL accuracy on nRF54L
We are not able to achive 50ppm on nRF54L.
Working on fixing it propperly, but untill we do set what we get.

Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
2024-04-22 17:05:49 -05:00
Anas Nashif 4593f0d71c kernel: priority queues: declare as static inlines
After the move to C files we got some drop in the performance when
running latency_measure. This patch declares the priority queue
functions as static inlines with minor optimizations.

The result for one metric (on qemu):

3.6 and before the anything was changed:

  Get data from LIFO (w/ ctx switch): 13087 ns

after original change (46484da502):

  Get data from LIFO (w/ ctx switch): 13663 ns

with this change:

  Get data from LIFO (w/ ctx switch): 12543 ns

So overall, a net gain of ~ 500ns that can be seen across the board on many
of the metrics.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-04-22 16:40:11 -04:00
Nick Goote 0b8714bcde scripts: Improve gen_kobject_list.py variable address determination
The gen_kobject_list.py script looks at DWARF debug information in the
elf file to determine the address of variables. Make sure that when
looking at DW_FORM_exprloc, it looks at both DW_OP_addr and
DW_OP_plus_uconst.

Signed-off-by: Nick Goote <ngoote@gmail.com>
2024-04-22 15:21:47 -04:00
Peter Mitsis 41676df683 doc: Add Xtensa HiFi documentation
Adds some documentation about the Xtensa HiFi AudioEngine DSP and
how to enable its use with Zephyr.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-04-22 15:21:15 -04:00
Flavio Ceolin 11b85ee510 kernel: stack: Check possible overflow
Check possible overflow in k_stack data struct. An overflow
can happens resulting in a much smaller amount of memory allocation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-04-22 15:20:39 -04:00
Lukasz Stepnicki 37e3449a39 soc: nordic: vpr: fix soc isr sw stacking.
Fixed order of mepc and _mcause in esf for 32bit stacking.
Added missing stack pointer alignement bit support.'

Signed-off-by: Lukasz Stepnicki <lukasz.stepnicki@nordicsemi.no>
2024-04-22 15:01:08 +00:00
Patryk Duda a8fa0ea938 linker: Add more DWARF 5 debug sections
These sections were reported by 'GNU ld (GNU Binutils) 2.41.0' using
'ld --verbose'.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-04-22 07:47:52 -07:00
Johann Fischer 215b4ddf98 usb: device_next: rework USBD shell to take speed into account
Rework USBD shell to take speed arguments into account and revise
command help text. Rename some of the commands to better reflect what
they actually do.
Since most of the init code changes, rewrite the command to initialize
the default configuration in the shell to register all available
classes, but not to enable USB device support in a single command.
This will allow earlier notification in the future, if supported by the
controller, before the USB device controller is enabled.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-04-22 06:51:22 -07:00
Johann Fischer 0cfc15da2e usb: device_next: rename usbd_class_iter to usbd_class_node
For the last dozen commits, the role of usbd_class_node has actually
been taken over by usbd_class_iter. After cleaning up and merging
usbd_class_node and usbd_class_data, we can rename usbd_class_iter to
usbd_class_node to better reflect its role.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-04-22 06:51:22 -07:00
Johann Fischer 2bc55f17ec usb: device_next: rename usbd_class_node to usb_class_data
Since only usbd_class_node contains the class instance data, rename it
to usbd_class_data.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-04-22 06:51:22 -07:00