Commit graph

89620 commits

Author SHA1 Message Date
Alberto Escolar Piedras bd9836be8c subsys logging: Enable native backend if possible
Let's always enable the native_posix backend even
if the serial is used.
Both can be used at the same time, and:
a) users expect the logger output in the invoking shell even if they
enable the UART
b) Since printk is routed to the logger twister actually needs it
for tests to pass as for native platforms it looks into the stdout
of the process.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 009fcd70e5 tests bsim bt: Add basic connection test with HCI UART async controllers
Add a basic connection test between two devices,
in which the controllers are in separate nrf52_bsim devices
connected over UART to the devices running the host+app.
The controllers are running the HCI UART async sample.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 398e4b121a tests bsim bt: Add basic connection test with HCI UART controllers
Add a basic connection test between two devices,
in which the controllers are in separate nrf52_bsim devices
connected over UART to the devices running the host+app.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 2f25cd5851 boards nrf52_bsim docs: UART is now supported
Add the UART to the list of supported peripherals

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 0aa0bc9af0 boards nrf*bsim: Move common kconfig selection to common place
Reduce a bit the amount of boilerplate by placing common
Kconfig selections in common options.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 6fee105b1d boards nrf52_bsim: Provide default UART configuration
Provide a good enough UART configuration, but do not
select it as backend by default, let apps do that.

The UART and its driver are very heavy compared to
other backends it may replace, so let's avoid
enabling it by default.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 0bdf943900 boards nrf*_bsim: Do not use the UART for logging by default
Even if the UART is enabled, let's not use it by default,
in this platform, as this UART is not meant for user
interaction, but to connect other devices
(for ex. BT controller).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras f84ef2d6ee boards nrf5*_bsim: Allow using the UART
Now the HW models include the UART(E) models.
So let's allow selecting it, but let's
not default to it, or enable it by default,
as it is only in very rare cases uses will want it,
and some may already be using the native ptty
instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 85d3ad1117 manifest: Update nrf hw models to latest
* Update the HW models module to
c744f2c762aad79e59bd7e99002f2fcab0a2f288

Including the following:
* docs: UART: several minor fixes
* UART(E): Add peripherals and connect to (D)PPI

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 572ba26b1f boards nrf5*_bsim: Provide more common headers
Provide some more common headers some nRF drivers
expect.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 14bc4aeec8 drivers uart_nrfx: Break infinite loops for simulation
While waiting for the UART to be ready in ISR
mode, for simulation only, add a tiny delay per
iteration of the busy wait loops to allow
time to pass.
This Z_SPIN_DELAY is an empty macro for any
other target than simulation.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 9a27906e38 drivers counter_nrfx_timer: Get peripheral address from HAL
Instead of getting the hardcoded address from the DT structure
use its symbolic name which will be resolved by the nRF HAL
definitions to the same value.

This allows the TIMER peripherals' addresses to be redefined
for the simulated targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 83af2d7f3c drivers counter nrfx: Fix ISR prototype
The ISR prototype is not matching the
signature for interrupt handlers, which results in
build warnings.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras efca307d35 drivers uart_nrfx: Correct pinctrl reg address for simulation
For simulation, we cannot get the UART regiter address
for the pinctrl config structure from DT, as that
cannot match the one allocated at build time.
So let's override it at runtime with the correct address
which is stored in the UART config structure.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 4efd08bfd8 drivers uart_nrfx: Get peripheral address from HAL
Instead of getting the hardcoded address from the DT structure
use its symbolic name which will be resolved by the nRF HAL
definitions to the same value.

This allows the GPIO peripherals' addresses to be redefined
for the simulated targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Alberto Escolar Piedras 5b993b070a drivers uart nrfx: Fix ISR prototype
The ISR prototype used when building without the
interrupt driven UART was not matching the
signature for interrupt handlers, which results in
build warnings.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-10 10:01:37 +01:00
Weiwei Guo eac50e318f drivers: intc_plic: fix plic PLIC_TRIG_LEVEL define mistake
Interrupt trigger type register each bit indicate the configured interrupt
type. bit value is 0 indicate level trigger interrupt, 1 indicate edge
trigger interrupt.

The level trigger defined to ~BIT(0) equal 0xfffffffe not equal 0.

Signed-off-by: Weiwei Guo <guoweiwei@syriusrobotics.com>
2024-01-10 10:01:23 +01:00
Abe Kohandel 83ca2a04a0 drivers: usb_dc_native_posix: do callback for ZLPs
A Zero Length Packet can be used by higher layer stack to discover when
an endpoint is being processed by the host. An example of this was
introduced as part of 0127d000a2 ("usb: device: cdc_acm: Use ZLP to
detect initial host read") in the CDC ACM class.

Not invoking the callback for ZLPs results in the higher layer stack not
being informed when the packet is consumed. This manifests as a CDC ACM
USB-IP device that cannot transmit to the host while being able to
receive from the host.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2024-01-10 10:01:14 +01:00
Benedikt Schmidt 70c8df7724 arch: arm: core: cortex_m: fix cache disabling in init_arch_hw_at_boot
Use the arch-cache functions instead of the sys-cache-functions
in z_arm_init_arch_hw_at_boot to ensure that the caches are
disabled even when CONFIG_CACHE_MANAGEMENT is disabled.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 10c0b86f83 soc: arm: use sys_cache* to enable caches for stm32f7 and stm32h7
Use sys_cache* functions to enable the caches for stm32f7 and
stm32h7. This ensures that CONFIG_CACHE_MANAGEMENT is
considered correctly.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 8b4516226b soc: arm: use sys_cache* for enabling the caches on same70 and samv71
Use the sys_cache* functions to enable the caches on same70 and
samv71. This will ensure that CONFIG_CACHE_MANAGEMENT is
considered correctly.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 2a2919946f arch: arc: use sys_cache instead of arch-function for enabling the cache
Use sys_cache_data_enable instead of arch_dcache_enable to enable
the cache. This will ensure that CONFIG_CACHE_MANAGEMENT
is considered correctly.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 1f1b430d88 soc: arm: remove redundant cache config options for kv5x
Remove the redundant cache config options for kv5x and use
the sys_cache* functions to enable the caches. This will automatically
consider CONFIG_CACHE_MANAGEMENT.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt d992683db5 soc: arm: replace redundant config option for caches for nxp_imx
Replace the redundant cache config options for the nxp_imx and
use sys_cache* functions to enable the caches. These will automatically
consider CONFIG_CACHE_MANAGEMENT.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Benedikt Schmidt 49d3244798 soc: arm: use sys_cache* for enabling the caches in nxp_s32
Use sys_cache* for enabling the caches in nxp_s32. This automatically
considers CONFIG_CACHE_MANAGEMENT and will activate the
cases only if this is active.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-01-10 09:59:58 +01:00
Ricardo Rivera-Matos 7d51b7cdc1 charger: Adds input current notifier properties
Some charger devices (such as BQ25710 and ISL9241) issue
notifications to the system via a dedicated line (such as
the PROCHOT signal on x86 platforms) to almost instantly
throttle the system load to prevent a brownout event.

This patch introduces two properties to configure two
distinct input current notification events of different
severity.

Signed-off-by: Ricardo Rivera-Matos <ricardo.rivera-matos@cirrus.com>
2024-01-10 09:59:41 +01:00
Ricardo Rivera-Matos f7d6c4f439 charger: Adds CHARGER_PROP_INPUT_REGULATION_VOLTAGE_UV prop
Adds support for setting a falling input voltage limit regulated
by an analog loop. Under heavy loads the analog loop will throttle
the charge current to prevent the power source from crashing.

Signed-off-by: Ricardo Rivera-Matos <ricardo.rivera-matos@cirrus.com>
2024-01-10 09:59:41 +01:00
Ricardo Rivera-Matos 45232aeaa2 charger: Adds CHARGER_PROP_INPUT_REGULATION_CURRENT_UA prop
Adds support for setting the target threshold for an input current
limit regulated by an analog loop. The analog loop responds by
throttling the charge current limit as necessary.

These are distinct from comparator based overcurrent protection
thresholds that isolated the charger from the power source when
triggered.

Signed-off-by: Ricardo Rivera-Matos <ricardo.rivera-matos@cirrus.com>
2024-01-10 09:59:41 +01:00
Anisetti Avinash Krishna 14c68c9438 drivers: serial: ns16550: Add IOPORT_ENABLED check condition
io_map check to enable LPSS DMA initialization is kept under
condition IOPORT_ENABLED.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2024-01-09 15:52:10 -06:00
Daniel DeGrasse 1c0b114bf8 sd: add timeout when taking SD card lock for data operations
Previously, if an SD I/O operation was attempted while another thread
held the mutex for the SD card, the I/O operation would simply fail. Add
a timeout to k_mutex_lock calls within the SD subsystem, so that
multithreaded access to the SD card instead blocks until the SD card is
available for I/O

Fixes #66211

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-09 15:46:54 -06:00
Henrik Brix Andersen 8785438d31 drivers: can: nuvoton: numaker: fix init function reference
Fix the reference to the init function.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-09 18:28:30 +01:00
Henrik Brix Andersen e24a3f5975 drivers: can: nuvoton: numaker: use named IRQs
Switch to using named IRQs as index-based access makes no guarantees about
devicetree interrupt order.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-09 18:28:30 +01:00
Henrik Brix Andersen b1cf5f0ffc drivers: can: nxp: mcan: use named IRQs
Switch to using named IRQs as index-based access makes no guarantees about
devicetree interrupt order.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-09 18:28:30 +01:00
Henrik Brix Andersen 074303cb7a dts: bindings: can: require interrupt-names for drivers using named IRQs
Make the "interrupt-names" property mandatory for drivers using named IRQs.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-09 18:28:30 +01:00
Henrik Brix Andersen c9263db28f drivers: can: bosch: mcan: use int0 and int1 as interrupt names
Consistently use "int0" and "int1" as interrupt names for CAN controllers
based on the Bosch M_CAN IP core. This aligns with the upstream Linux
bindings.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-09 18:28:30 +01:00
Manuel Aebischer 25753fef13 drivers: usb_dc_rpi_pico: starting read on transfer EPs
This commit partially reverts a change which was introduced in the
previous commit 5b9a0e5456.
usb_dc_ep_start_read() should also be called on transfer endpoints
like it has been before, otherwise the endpoint will not be armed
after it has been reconfigured.

Signed-off-by: Manuel Aebischer <manuel.aebischer@netmodule.com>
2024-01-09 18:27:44 +01:00
Paszkiet Kamil a9ea0fe420 scripts: tests: twister_blackbox: Add more tests test_printouts.py
add tests to test_printouts.py:
  -timestamps
  -broken_parameter
  -help (dummy check)
  -force_color (dummy check)

Signed-off-by: Paszkiet Kamil <kamilx.paszkiet@intel.com>
2024-01-09 18:26:41 +01:00
Anas Nashif 37560fefea ci: use kitaware ninja with job server support
Needed for full functionality of the job server in twister
which only works with kitware supplied ninja version.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-09 11:52:15 -05:00
Jamie McCrae 7ff715b848 doc: release: 3.6: Add note on sysbuild shield fix
Adds a note that the sysbuild shield fix has been applied

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-09 10:37:38 -06:00
Michael Arnold 240bd8e16a runners: jlink: Add support for J-Link over IP
Add support for J-Link over IP and J-Link remote server.
If the "--dev-id" is a valid ip, the transport over ip is selected.
Otherwise usb is selected.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2024-01-09 14:49:03 +01:00
Sateesh Kotapati d9c0d6981a gecko: sl_assert, sl_common files updated | Update to GSDK 4.4.0
Added the sl_assert, sl_common, em_core_generic, em_system_generic files
and updated related files in gecko/common and gecko/emlib to include
the mentioned files.

Signed-off-by: Sateesh Kotapati <sateesh.kotapati@silabs.com>
2024-01-09 14:43:31 +01:00
Anas Nashif 91841587d6 ztest: fix ztest_run_test_suite usage and macros
Fix usage of ztest_run_test_suite that was missed when introducing shell
support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-09 08:15:22 -05:00
Fabio Baltieri 8ca40e5ebf drivers: input: depend on multithreading on drivers using a thread
These all require threads support to function, add a "depends on
MULTITHREADING" accordingly.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-09 11:27:44 +00:00
Andrzej Głąbek 6d67b95a18 samples: boards: nrfx: Remove redundant inclusions
This is a follow-up to commit c7e4d23c5d.

After all calls to `nrfx_dppi_*` and `nrfx_ppi_*` functions were
replaced with corresponding `nrfx_gppi_*` calls, it is no longer
needed to include the `nrfx_dppi.h` and `nrfx_ppi.h` headers.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-01-09 12:06:51 +01:00
Andrzej Głąbek e8d3bf5ff6 samples: boards: nrfx: Do not require (d)ppi node to be enabled
The sample needs to check in Kconfig whether PPI or DPPI is present
on the target platform in order to enable the proper allocator in nrfx.
It should not use the `HAS_HW_NRF_*` symbols for this as those take
into account also the status of the corresponding DT node, not only
its presence.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-01-09 12:06:51 +01:00
Andrzej Głąbek 56b6e6eb58 samples: boards: nrfx: Use absolute pin numbers
This sample makes calls to the nrfx_gpiote driver functions that
require absolute pin numbers, not relative to a given GPIO port,
so instead of getting the numbers with the `DT_GPIO_PIN` macro,
it should use `NRF_DT_GPIOS_TO_PSEL`.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-01-09 12:06:51 +01:00
Andrzej Głąbek db4344b659 drivers: spi: nrfx: Deactivate CS from thread context
... so that it is possible to use a GPIO expander pin as the CS line.
Communication with the expander may involve an operation that cannot
be done from the interrupt context (e.g. an I2C transaction).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-01-09 12:06:35 +01:00
Andrzej Głąbek 3f6373eb36 drivers: nrf_qspi_nor: Deactivate QSPI peripheral after initialization
This is a follow-up to commit ea1be7f242.

After the driver performs its initialization, it needs to deactivate
the QSPI peripheral. Otherwise, the peripheral would unnecessarily
consume power until some QSPI operation is performed (and only then
it will get deactivated), what depending on the application may take
a significant amount of time.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-01-09 12:06:19 +01:00
Anas Nashif 72c6ffb2d0 doc: ztest: remove reference to non-existing test
custom_output test does not exist anymore.

Fixes #67168

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-09 10:27:15 +01:00
Tristan Honscheid 0198b7d5f7 emul: Add stub release impl. for emulated SPI driver
`release` is a mandatory method in the `struct spi_driver_api` API but
is not implemented in the SPI emulator. This can cause a test calling
`spi_release()` to segfault. Add a stub implementation that just returns
zero.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2024-01-09 10:27:06 +01:00