Commit graph

93828 commits

Author SHA1 Message Date
Aleksander Wasaznik a64d20f6f0 Bluetooth: host: sched-lock bt_recv()
`bt_recv` is invoked from the BT long work queue, which is preemptible.
The host uses cooperative scheduling to ensure thread safety.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-04-13 07:05:20 -04:00
Dominik Ermel 78ddcdd6fa tests/disk_access: Add flash-disk overlay for testing
Adds native_posix overlay and modifies code to allow testing
flash-disk access.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-13 07:04:24 -04:00
Mahesh Mahadevan e37d1a5489 dts: nxp_mcxn94x: Add DMA channels for FlexComm nodes
Copy the DMA channel information to both UART and SPI
instances of the Flexcomm as only one of them can be
active.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-04-13 07:03:55 -04:00
Aleksandar Cecaric 0144ed6b63 arch: riscv: update coredump for 64BIT RISCV
Add RISCV 64bit registers and parse them in coredump script.

Signed-off-by: Aleksandar Cecaric <aleksandar.cecaric@nextsilicon.com>
2024-04-13 07:03:23 -04:00
Celina Sophie Kalus 325f22a16f tests: posix: eventfd: Add ioctl F_SETFL test
Add a test to protect against future regressions in the ioctl F_SETFL
operation of eventfd. Flags are set and unset and validity of the file
descriptor is checked by reading and writing.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
2024-04-13 06:00:08 -04:00
Celina Sophie Kalus 5bd86eaddb posix: eventfd: Fix unsetting internal flags in ioctl
Commit e6eb0a705b ("posix: eventfd: revise locking, signaling, and
allocation") introduced a regression where the internal flags of an
event file descriptor would be erased when calling the F_SETFL ioctl
operation.

This includes the flag EFD_IN_USE_INTERNAL which determines whether
this file descriptor has been opened, thus effectively closing the
eventfd whenever one tries to change a flag.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
2024-04-13 06:00:08 -04:00
Declan Snyder 12f48fe896 doc: services: pm: Reword System PM Doc
The following changes:
- Generally reword all the paragraphs to hopefully by clearer and
  easier to read by using more straighforward and direct wording,
  and avoiding run on sentences and ambiguous/wrong grammar, etc.
- Move Examples to the bottom of the page.
- Fix a typo in the code expression where there was an extra
  parentheses.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-04-12 21:56:35 -04:00
Emilio Benavente 8adb7c17ca boards: nxp: frdm_mcxn947: PWM Support
Updated frdm_mcxn947 to add FlexPWM Support,
including updating the docs file.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-04-12 16:53:03 -04:00
Emilio Benavente d2bfed764c dts: arm: nxp: nxp_mcxn94x: Add PWM Support
Added the dts node for FlexPWM Support.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-04-12 16:53:03 -04:00
Laurentiu Mihalcea 94d156c9c8 nxp: imx8ulp: enable serial interface
Enable serial interface on i.MX8ULP.

This also includes a SHA update for hal_nxp which
pulls in the following commits relevant to Zephyr:

* 3366f234ed47 build: hal_nxp: add TPM counter support
* 6544455fcf46 Compile in PXP driver if LVGL is set to use
PXP.
* 31463a848bcd devices: MIMX8UD7: add definition for
LPUART_RX_TX_IRQS

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-12 16:52:38 -04:00
Ricardo Rivera-Matos 30b27c73c3 regulator: cp9314: Cleans sleep related preprocesor directives
Removes conditional calling k_busy_wait() on single threaded
systems and uses k_sleep for both single and multi threaded
systems.

Commit e375d82 ("kernel: Implement k_sleep for Single Thread")
eliminated the need to call k_busy_wait() on single threaded
systems in place of k_sleep.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
2024-04-12 16:52:18 -04:00
Ricardo Rivera-Matos 7afc5932f0 regulator: regulator_common: Cleans sleep related preprocesor directives
Removes conditional calling k_busy_wait() on single threaded
systems and uses k_sleep for both single and multi threaded
systems.

Commit e375d82 ("kernel: Implement k_sleep for Single Thread")
eliminated the need to call k_busy_wait() on single threaded
systems in place of k_sleep.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
2024-04-12 16:52:18 -04:00
Marcin Niestroj 3431d09f09 drivers: wifi: esp_at: fix missing channel in scan result
WiFi scan results were not updated with information about channel, after
scan results parsing was updated. Fix that.

Fixes: a6b06004c2 ("drivers: wifi: esp_at: handle commas in SSIDs during
  scan and status")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-04-12 16:51:52 -04:00
Alberto Escolar Piedras e41ed3886f manifest: Update nRF hw models to latest
* Update the HW models module to
123d37db9cae528d51530c61ba0422192bc03bda

Including the following:
* 123d37d RTC: Fix for TASKS_TRIGOVRFLW with stopped counter

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-12 16:51:23 -04:00
Jukka Rissanen 9324723889 net: pkt: Remove obsolete and not used TCP flag
The tcp_first_msg field is no longer used so remove it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-04-12 16:50:59 -04:00
Marc Herbert 89493ee56b Revert "toolchain: gcc: Simplify GEN_ABSOLUTE_SYM and GEN_ABSOLUTE_SYM_KCONFIG"
This reverts commit 87779e73f8.

Commit 87779e73f8 ("toolchain: gcc: Simplify GEN_ABSOLUTE_SYM and
GEN_ABSOLUTE_SYM_KCONFIG") "unified the variants from using a
target-specific dialects to a target-agnostic solution". While reducing
duplication is always desired, this "unification" got rid of some
differences between architectures. Among others, this commit generalized
the use of the `c` constant operand modifier in the `GEN_ABSOLUTE_SYM()`
macro. Before this commit, the `c` modifier was NOT in use in a number
of architectures!

Generally speaking, reducing copy/paste/diverge must always be performed
in _two_ distinct phases with ample testing time between the two phases:

1. First, perform functional changes that remove the divergence.

   < give plenty enough time for testing >

2. Finally, remove the identical copies.

More specifically, I understand the `c` modifier may be required by some
architectures, but it's causing problems on other(s). Notably, it broke
the build with one pre-C11, gcc-based Xtensa toolchain:

```
14:03:17 kernel_offsets.h: Assembler messages:
14:03:17 kernel_offsets.h:28: Error: bad expression
14:03:17 kernel_offsets.h:28: Error: junk at end of line,
                                first unrecognized character is `c'
14:03:17 kernel_offsets.h:29: Error: bad expression
14:03:17 kernel_offsets.h:29: Error: junk at end of line,
                                first unrecognized character is `c'
...
```

While newer Xtensa toolchains accept `c`, they also ignore it. `c` makes
no difference whatsoever with all the (working) Xtensa toolchains I
tested. So for `Xtensa`, `c` is a best useless and at worse breaking the
build.

Up to gcc version 12 (2022), the `c` constant modifier was documented as
X86-specific!
https://gcc.gnu.org/onlinedocs/gcc-12.3.0/gcc/Extended-Asm.html#x86Operandmodifiers

Only starting with gcc version 13 (2023), the `c` modifier was
officially supported as "generic":
https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Extended-Asm.html#Generic-Operand-Modifiers

`c` was very likely working with other architectures before 2023, but
not officially and we don't know which architectures and we don't know
when.

Note toolchain/gcc.h is included by toolchain/llvm.h and also used by
clang. The status of `c` across clang versions is unknown.

While I personally hate copy/paste/diverge with a passion, these macros
GEN_ABSOLUTE_SYM() and GEN_ABSOLUTE_SYM_KCONFIG() are very small so that
particular duplication is very reasonable. Architecture-specific code is
tricky and portability across toolchain and toolchain versions even
more. Testing low-level changes like this across different architectures
would also require demanding and unlikely coordination across different
architectures/companies.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-04-12 15:30:40 -04:00
Seppo Takalo 51d80a9838 net: lwm2m: Allow CoAP block size to be changed
Allow changing the CoAP Block-wise transfers block-size
for subsequent GET requests.

It looks like Leshan switches block size back to its
configured value, if it is smaller.
So even when we send block N=0 with size of 512, Leshan
seem to handle that properly but still asks N=2 with
block size 256(if that is configured).

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-04-12 09:14:36 -04:00
Ayush Singh 71437f71df samples: net: sockets: echo_client: Enable subg tcp
- TCP should not be disbled by default for subg in this particular
  sample since it is mostly used to test network rather than
  performance.

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-04-12 15:03:57 +02:00
Ayush Singh e9963be3af samples: net: sockets: echo_server: Enable subg tcp
- TCP should not be disbled by default for subg in this particular
  sample since it is mostly used to test network rather than
  performance.

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-04-12 15:03:57 +02:00
Alberto Escolar Piedras 4f7b144ef6 arch posix: When building for the native_simulator only link ASAN once
Only request the linker to link ASAN in the final stage, not
during the partial linking stage.
This fixes a link issue when building with llvm.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-12 15:03:35 +02:00
Alberto Escolar Piedras b59b21f8bb arch posix: pass -fsanitize-recover=all also to native_simulator build
If the CONFIG_ASAN_RECOVER option is set, also pass
-fsanitize-recover=all to the build of the native simulator
built files.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-12 15:03:35 +02:00
Alberto Escolar Piedras 1fcc245eda native_simulator: Get latest from upstream
Align with native_simulator's upstream main
6f6b359c4fe26ddeed8a65ad55f5bc402d3b7f91

Which includes:
* 6f6b359 Avoid issue with llvm address sanitizer

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-12 15:03:35 +02:00
Marek Metelski 1c8ea0a941 cmake: shields: Simplify shield processing, print shields from modules
Fix issue #67244 in which boards from external modules where not
printed in the help message (displayed for `shields` target or
when trying to build with unknown shield). The SHIELD_LIST variable
was reset for each BOARD_ROOT discovered.

Simplify discovery logic. Discover all shields and set relevant
variables (SHIELD_LIST and SHIELD_DIR_${name}) in one step and
process all the expected boards in the next step.

Signed-off-by: Marek Metelski <marek@metelski.dev>
2024-04-12 15:03:29 +02:00
Morten Priess 2f1a254eae Bluetooth: controller: Implement LE Create BIG Test command
Implement test version of the LE Create BIG command ll_big_test_create
(BT_HCI_OP_LE_CREATE_BIG_TEST) in the controller.

This enables use of CONFIG_BT_ISO_ADVANCED, which supports use of
the following BIG/QoS configuration parameters (otherwise derived):

- ISO_Interval
- NSE
- Max_PDU
- BN
- IRC
- PTO

Signed-off-by: Morten Priess <mtpr@oticon.com>
2024-04-12 14:58:07 +02:00
Michal Smola 7bf2d8ff46 twister: fix NXP hw detection in hardware map
Some NXP boards are not detected by twister when creating hardware map,
because manufacture name is NXP instead of NXP Semiconductors expected
by twister.
Fix it by adding NXP to manufacturers list.

Signed-off-by: Michal Smola <michal.smola@nxp.com>
2024-04-12 08:44:41 -04:00
Guillaume Gautier 97177ba01a samples: boards: stm32: pm: s2ram: add spi
Add SPI transfer in the suspend to ram samples to test SPI PM.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-04-12 13:49:04 +02:00
Guillaume Gautier b567a7db83 drivers: spi: stm32: add pm support
Add power management support for STM32 SPI

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-04-12 13:49:04 +02:00
Vinayak Kariappa Chettimada cd58325b2a samples: Bluetooth: hci_ipc comment about NRF_DEFAULT_IRQ_PRIORITY
Update comment about use of NRF_DEFAULT_IRQ_PRIORITY in
hci_ipc sample for Nordic nRF53x series.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-12 13:48:57 +02:00
Vinayak Kariappa Chettimada 7ece6aed16 Bluetooth: Controller: Fix regression in BT_RX_STACK_SIZE use
Fix regression in BT_RX_STACK_SIZE use due to
commit b91728619c ("Bluetooth: host: remove
`CONFIG_BT_RECV_BLOCKING`").

Profiling of Controller Rx thread has been mentioned in
commit 586ba9fd13 ("Bluetooth: Controller: Increase
BT_RX_STACK_SIZE for BT_HCI_RAW enabled").

Also, move the TX_STACK_SIZE value as default in Kconfig
from the explicit value being set in hci_ipc sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-12 13:48:57 +02:00
Piotr Kosycarz c7c6cb4c99 boards: nordic: nrf54h20dk: enable HWFC
For both UARTs connected to debugger chip.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-04-12 13:48:46 +02:00
Guennadi Liakhovetski 1ec6a94679 llext: document positive return values of llext_load()
llext_load() can return positive values when the respective llext use
count is positive. Add the missing documentation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-12 12:02:52 +02:00
Ayush Singh f50a2e58b3 samples: net: zperf: Add subg overlay
- Tested on beagleconnect_freedom

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-04-12 11:54:55 +02:00
Adam Matus 869d4fc041 net: zperf: Improve shell upload cmd
Minor improvements to usage of zperf_shell upload.
Added common defaults for the upload commands arguments.
Print defaults in cmd help.
Throw warning when user sets baud rate for TCP upload.

Signed-off-by: Adam Matus <adam.matus@nxp.com>
2024-04-12 11:54:49 +02:00
Jukka Rissanen d40abe8c0f net: vlan: Fix net_eth_get_vlan_tag() to check correct interface
The network interface parameter for net_eth_get_vlan_tag() should
be the VLAN interface so use the search loop properly.
Earlier the main interface could be checked.

Add also test cases for this so that we can catch that the func
works properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-04-12 11:54:33 +02:00
Alberto Escolar Piedras 719c4f4036 boards: nrf_bsim: bst hooks: Call tests delete only once
bst_delete() is called from an ON_EXIT hook, which can be called
several times if an exit hook itself fails and calls exit on
its own.
This is not what most tests destructors will expect, and they
may do weird things in this case. So let's not call into it again.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-12 11:54:26 +02:00
Miika Karanki 67de8d58ec scripts: logging: support native_posix dictionary logging
- Do not look CONFIG_* symbols from dynamic symbols which might
  be there before the symbol table where CONFIG_* symbols are found.

- Define posix architecture in ARCHS list.

- Check if architecture is not found instead of letting the code
  run into trying to access dictionary with None key.

Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
2024-04-12 11:54:18 +02:00
Robert Lubos b292a9e8b5 net: sockets: tls: Add more logging in case of errors
Add more error logs in case of (mostly) mbed TLS errors, so it's easier
to get an initial idea of what went wrong based on logs only. Getting
an information on an actual mbed TLS error code is quite helpful in such
cases.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-04-12 11:54:02 +02:00
Jędrzej Ciupis 2371dce46b boards: raytac: remove direct RESET register access
Replace direct access to RESET register to control the network CPU with
dedicated API, which allows safely sharing the network CPU with other
users.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-04-12 11:31:47 +02:00
Jędrzej Ciupis 2b23a52642 boards: nrf53: switch to the network CPU management API
Switch to the network CPU management API from direct nrfx calls.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-04-12 11:31:47 +02:00
Jędrzej Ciupis ec3c3f153b soc: nordic: nrf53: network CPU Force-OFF management
This commit introduces a common API for managing nRF53 SoC network CPU
Force-OFF state.

From the application CPU point of view, the network CPU is a shared
resource used by multiple users. The current solution where every user
controls the network core state directly leads to dependencies between
users and does not scale well.

To address this problem there should be a single entity responsible for
controlling the network CPU Force-OFF signal. This commit introduces
such module.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-04-12 11:31:47 +02:00
Sebastian Głąb 5600ae335b tests: drivers: clock_control: Add nRF54L15 to platform allow
Add nRF54L15 to platform_allow in the sample.yaml:
- clock_control_api,
- nrf_clock_calibration,
- nrf_lf_clock_start,
- onoff.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-04-12 10:19:57 +02:00
Alberto Escolar Piedras f9e7861f53 manifest: Update nRF hw models to latest
* Update the HW models module to
c8fd53aab0c52b3898e5b89ca7c3e1a96e299306

Including the following:
* c8fd53a RADIO: Support logical address selection
* 31614b4 RADIO: Add test interface to offset Tx and Rx power

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-12 09:53:38 +02:00
Bartosz Miller 211477f874 drivers: Extend coverage for UARTE driver
Add more test cases for UARTE driver API
Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2024-04-12 09:19:15 +02:00
Erik Brockhoff dca085e155 bluetooth: controller: refactor node_rx_pdu for memory optimization
Generic node_rx_hdr struct contains data not used for done event, so this
pdu specific data is moved to node_rx_pdu to minimize memory usage for
MFIFO_done alloc.

This however calls for a considerable write-through replacing the generic
node_rx_hdr with node_rx_pdu when relevant and needed.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2024-04-12 09:19:08 +02:00
Joakim Andersson eb133834ca samples: nrfx_prs: Workaround for uninit not clearing events
Add workaround for uninit functions not clearing events for
spim and uarte.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-04-12 09:18:35 +02:00
Joakim Andersson d97c780fb0 samples: nrfx_prs: Add handling of SCK initial value based on mode
Add handling of SCK initial value based on the SPI mode used.
If mode is using CPOL then SCK needs to be set.

Fixes: #71154

Signed-off-by: Joakim Andersson <joakim.andersson@heimdallpower.com>
2024-04-12 09:18:35 +02:00
Joakim Andersson e9cf74b581 samples: nrfx_prs: Fix sample frequency
Fix setting of sample frequency.
The nrfx drivers are now using raw integere values instead of nrf
definitions.

Fixes: #71154

Signed-off-by: Joakim Andersson <joakim.andersson@heimdallpower.com>
2024-04-12 09:18:35 +02:00
Erik Brockhoff 83f0647762 bluetooth: controller: use correct CONFIG for central CIS create proc. data
Use CONFIG_BT_CTLR_CENTRAL_ISO instead of CONFIG_BT_CENTRAL in
declaring central CIS CREATE procedure context data. In some configs the
size of this data structure is bound by central CIS CREATE, so doing it
correctly will save memory in the procedure context allocation.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2024-04-12 09:18:22 +02:00
Gwen Weinholt 58d204acf9 soc: st: stm32: stm32l4x: enable ART flash cache accelerator
Enable instruction cache, data cache and prefetching.

Signed-off-by: Gwen Weinholt <git@weinholt.net>
2024-04-12 09:18:15 +02:00
Tim Lin ca66e7d5e1 ITE: soc: chip_chipregs: Cleanup it8xxx2 chip registers
1. Distinguish the registers of V1 and V2.
2. Remove unused chip variant configuration.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-04-12 09:18:08 +02:00