Commit graph

84998 commits

Author SHA1 Message Date
Andriy Gelman
31bef35897 drivers: can: mcp251xfd: Add driver
This continue PR #31270. The updated changes are:
- Updated to work with latest zephyr
- Inplace reads/writes of registers
- Batch read of RX messages when multiple messages can be read
- FIFO abstraction of RX/TEF queues
- Handle ivmif errors
- Use READ_CRC for register reads
- Use bitmasks instead of bitfield members
- Rename mcp25xxfd to mcp251xfd
- General cleanups

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-10-01 09:20:37 +03:00
Abram Early
33277f9b48 drivers: can: Implement MCP25xxFD driver
Implementation for Microchip MCP2517FD/MCP2518FD SPI based CAN-FD
controller.

Signed-off-by: Abram Early <abram.early@gmail.com>
2023-10-01 09:20:37 +03:00
Andrzej Kuros
d44e96e486 nrf53: pretick with NRF_802154_RADIO_DRIVER
The `SOC_NRF53_RTC_PRETICK` option is now allowed to be used with
`NRF_802154_RADIO_DRIVER`.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-09-30 18:48:19 +02:00
Andrzej Kuros
e03d5d4c6d nrf53: RTC pretick allows user channels and require just one CC
The nrf53 pretick can be used with non-zero
`NRF_RTC_TIMER_USER_CHAN_COUNT` Kconfig option.

The nrf53 pretick requires just one RTC1 CC channel.

The nrf53 pretick handles also RTC1 and RTC0 both CCs and OVERFLOW
events by examination of events scheduled on them. The pretick is set
based on number of ticks to the closest event scheduled that can trigger
an interrupt.

Because the operation in `z_arm_on_enter_cpu_idle` hook would
take too much time with interrupts disabled, the
`z_arm_on_enter_cpu_idle_prepare` hook enabled by Kconfig option
`ARM_ON_ENTER_CPU_IDLE_PREPARE_HOOK` is used. It performs RTC0 and RTC1
examination, and sets pretick without interrupts being blocked.

The LDREX/STREX are leveraged to detect if exception took place
between start of `z_arm_on_enter_cpu_idle_prepare` and
`z_arm_on_enter_cpu_idle`. If exception has not been taken, the pretick
calculation can be trusted because source data could not changed and
too much time could not pass. Otherwise the sleep attempt is disallowed,
the idle will loop again and try later.

Prompt for `SOC_NRF53_RTC_PRETICK` Kconfig option allows to control
this option by an user and turn the feature off if necessary.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-09-30 18:48:19 +02:00
Andrzej Kuros
3d89d58cb8 arch: arm: aarch32: Introduce z_arm_on_enter_cpu_idle_prepare() hook
Introduce an optional hook to be called when the CPU is made idle.
If needed, this hook can be used to prepare data for upcoming
call to z_arm_on_enter_cpu_idle(). The main difference is that
z_arm_on_enter_cpu_idle_prepare() hook is called before interrupts
are disabled.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-09-30 18:48:19 +02:00
Krzysztof Chruściński
31eaffdf05 nrf53: Add RTC pretick
Add RTC pretick option that triggers HW activity one tick before and
RTC event that leads to the interrupt. Option is active only on nrf53
network core.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-09-30 18:48:19 +02:00
Chandler Keep
27b4b9f4c8 mgmt/MCUmgr/mgmt: Support for finding registered command groups
This commit adds support for finding registered mcumgr command groups.

By default, supported command groups are local to the namespace where
they're registered. This api addition allows applications to get
reference to these supported command groups to deregister & re-register
them.

This adds scope for applications to support multiple implementations
of a command group alongside the default.

Signed-off-by: Chandler Keep <chandlersamkeep@gmail.com>
2023-09-30 18:48:06 +02:00
Flavio Ceolin
56627e40cb net: wifi_utils: Fix wifi_utils_parse_scan_ssids doc
Function recently changed its behavior, just changing the documentation
to reflect that.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-09-30 18:47:55 +02:00
Bjarki Arge Andreasen
da9c821ce0 modem: modem_pipe: Update documentation
This commit improves the documentation in the header for the
modem_pipe to include return value descriptions and notes
regarding when specific events are invoked resulting from
calls to the modem_pipe API.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-09-30 18:47:48 +02:00
Bjarki Arge Andreasen
48a069204c modem: modem_pipe: Avoid inconsequential open/close calls
This PR adds a mechanism to avoid calling open() or close()
on pipes which are already opened or closed respectively.

This optimization can help simplify backends implementing
the modem_pipe API by avoiding duplicated boilerplate code.

The TTY backend test suite has been updated to match the
new behavior.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-09-30 18:47:48 +02:00
Benjamin Cabé
9ad403e9ca doc: pm: policy: Hide internal/private fields.
Use INTERNAL_HIDDEN to hide private fields from public
documentation.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-30 18:47:41 +02:00
Bjarki Arge Andreasen
74b2c8c123 net: ppp: Remove unused flag from struct ppp_context
Remove unused flag from ppp_context struct.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-09-30 18:47:33 +02:00
Bjarki Arge Andreasen
d6a96a4b24 net: l2: ppp: Don't attempt reestablish PPP if carrier is down
This commit adds a check to prevent attempting to reestablish
the PPP session if the carrier is down. Without this check,
the PPP FSM attempts and fails to establish a PPP session
twice before giving up. The behavior is not breaking anything,
but it is not desired.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-09-30 18:47:33 +02:00
Daniel Fladerer
9d1b7086d7 drivers: serial: uart_mcux_iuart: Add parity bit handling
Adding parity bit handling according to uart_mcux.c

Signed-off-by: Daniel Fladerer <d.fladerer@gmx.de>
2023-09-30 18:45:34 +02:00
Anas Nashif
c910dc81a6 sys_clock: header: minor cleanup and doxygenization
Minor cleanup and doxygen related changes adding missing coverage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-30 18:43:28 +02:00
Anas Nashif
b9f8b91692 kernel: sys_clock: remove stray z_enable_sys_clock prototype
The implementation was removed, but we still have the prototype.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-30 18:43:28 +02:00
Anas Nashif
cc2a558707 kernel: move more internal smp calls into internal domain
Move 3 more internal APIs into internal area as the first step for
cleanup. Having them in kernel.h is just an invitation for them to be
used by someone.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-30 18:43:28 +02:00
Anas Nashif
a1c7bfbc63 kernel: remove unused z_init_thread_base from kernel.h
This API is internal and not used in any way in kernel.h, so move it
back to where it is needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-30 18:43:28 +02:00
Anas Nashif
209ff606be kernel: move internal smp calls to a internal header
Those APIs are internal and should not be part of the main public API
header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-30 18:43:28 +02:00
Anas Nashif
e19f21cb27 kernel: move z_is_thread_essential out of public kernel header
This is a private API to the kernel, so move out of kernel.h

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-30 18:43:28 +02:00
Anas Nashif
f0c7fbf0f1 kernel: move sched_priq.h to internal/ folder
This header is internal to the kernel and shall not be included directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-30 18:43:28 +02:00
Peter Mitsis
a956f7aef1 west.yml: Pull in latest percepio updates
Pulls in the latest percepio module updates that alter how it
accesses the k_mem_slab structure (due to changes from this PR).

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
13712dbea2 test: Shorten object core API stats test name
Changing the name of the routine test_obj_core_stats_deregister()
to something shorter (test_obj_core_stats_dereg) has been found to
be a workaround to the issue identified in #61087.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
1afc32e762 doc: Add object core documentation
Adds documentation for both object cores and object core statistics.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
eb86a0cca5 test: Implement obj core stats test
Adds a test to test the objects integrated into the object core
statistics framework.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
d709182ba5 test: Implement object core stats API test
Creates a set of tests to verify that the top-level
k_obj_core_stats_xxx() routines behave as expected.
Note that this test is not meant to test the details
of the object core statistics operator function pointers.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
5594de49ea test: Implement object core test
Creates a test to verify that kernel objects can be found within
the object core framework.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
e6f1090553 kernel: Integrate object core statistics
Integrates object core statistics framework into the following
kernel objects:
  sys_mem_blocks, k_mem_slab
  threads, _cpu, z_kernel

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
1d5d674e0d kernel: Add initial k_obj_core_stats infrastructure
Adds the infrastructure to integrate statistics into
the object core.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
6df8efe354 kernel: Integrate object cores into kernel
Integrates object cores into the following kernel structures
   sys_mem_blocks, k_mem_slab
   _cpu, z_kernel
   k_thread, k_timer
   k_condvar, k_event, k_mutex, k_sem
   k_mbox, k_msgq, k_pipe, k_fifo, k_lifo, k_stack

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
55db86e512 kernel: Add initial obj_core infrastructure
Adds the initial object core infrastructure.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
eb1e5a161d kernel: FIFO and LIFO have their own sections
Instead of placing both FIFOs and LIFOs into a common k_queue
type section, they are now placed into their own custom iterable
secitons. This is necessary when employing object cores as FIFOs
and LIFOs will be associated with different lists.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
9bedfd82a2 kernel: Refactor CPU usage
Refactors CPU usage (thread runtime stats) to make it easier to
integrate with the object core statistics framework.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
baea37aeb4 kernel: Re-factor sys_mem_blocks definition
Rearranges the sys_mem_blocks fields so that information that describes
how much of the memory block is used is co-located. This will allow
easier of its statistics into the object core statistics reporting
framework.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Peter Mitsis
2f003e59e4 kernel: Re-factor k_mem_slab definition
Rearranges the k_mem_slab fields so that information that describes
how much of the memory slab is used is co-located. This will allow
easier of its statistics into the object core statistics reporting
framework.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Tom Burdick
77e193eb03 llext: Maintainers file
Adds to the maintainers file the llext subsystem making myself the
maintainer and Guennadi Lyakh a collaborator.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-09-29 20:50:38 -04:00
Tom Burdick
9c366973e4 llext: Shell loader sample
Adds a sample application that can be used for trying out llext
with the shell. The docs cover how to load a hello world ELF
on to the device, assuming its an arm v7 architecture.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-09-29 20:50:38 -04:00
Tom Burdick
b7f3182f79 llext: Simple hello world test case
Adds a very simple hello world test case for llext. The loadable
extension is built and then included as a binary array into the test
making it very easy to load, debug, and inspect. The extension is
built using the same toolchain as the base image by default.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-09-29 20:50:38 -04:00
Tom Burdick
09f38b5f20 docs: Add documentation for llext
Adds a basic overview and API docs for llext.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-09-29 20:50:38 -04:00
Tom Burdick
41e0a4a371 llext: Linkable loadable extensions
Adds the linkable loadable extensions (llext) subsystem which provides
functionality for reading, parsing, and linking ELF encoded executable
code into a managed extension to the running elf base image.

A loader interface, and default buffer loader implementation,
make available to the llext subsystem the elf data. A simple management
API provide the ability to load and unload extensions as needed. A shell
interface for extension loading and unloading makes it easy to try.

Adds initial support for armv7 thumb built elfs with very specific
compiler flags.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Co-authored-by: Chen Peng1 <peng1.chen@intel.com>
Co-authored-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-09-29 20:50:38 -04:00
Anas Nashif
34e16225eb neural_net: remove unused experimental API
Experimental API is not being used anymore, remove it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-29 20:48:33 -04:00
Benjamin Cabé
a6f8935e4f doc: sphinx.util.progress_message is deprecated
As of Sphinx 6.1, sphinx.util.progress_message is deprecated and
sphinx.util.display.progress_message should be used instead.

See https://www.sphinx-doc.org/en/master/changes.html#id165

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-29 20:57:30 +03:00
Jamie McCrae
76e58af542 west.yml: MCUboot synchronization from upstream
Update Zephyr fork of MCUboot to revision:
  4fe28b3cf6d30c3e57d6a4f7ee3dba8617aa9a0a

Brings following Zephyr relevant fixes:
 - 4fe28b3 Update zephyr version files for 2.0.0-rc1
 - 6a6de4b scripts: imgtool: update to 2.0.0-rc1 release

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-09-29 20:37:24 +03:00
Manuel Argüelles
3923cda6d8 tests: kernel: syscalls: use default faulty address for s32z270dc2
Before Picolibc was made default, this board needed a custom test
faulty address. Now this address does not produce a fault anymore so
switch back to the default faulty address.

Fixes #63270

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-29 20:34:51 +03:00
Benjamin Cabé
639b11742a doc: include: uart: cleanup doxygen documentation
Add a bunch of missing docstrings
Properly document structs.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-29 12:21:15 -05:00
Jukka Rissanen
a59b67c521 samples: net: socket: echo_server: conn mgmt header file missing
The conn_mgr_monitor.h was not included so the compilation
gave warning for missing conn_mgr_ignore_iface() function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-09-29 18:57:07 +03:00
Alberto Escolar Piedras
c883d397f6 tests/drivers/flash common: Allow on nrf53_bsim boards
Add the new simulated nrf53 targets to this test, as they
can run it without problems.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 18:56:33 +03:00
Alberto Escolar Piedras
f1f066ec7d test drivers.entropy.bt_hci: Allow on simulated nrf5340bsim_nrf5340_cpunet
The simulated nrf5340bsim_nrf5340_cpunet board can run this test
also just fine, so let's enable it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 18:56:33 +03:00
Alberto Escolar Piedras
e41f836c53 tests nrf_rtc_timer: Allow on simulated nrf53
The simulated nrf53 bsim boards can run this test also just
fine, so let's enable them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 18:56:33 +03:00
Robert Lubos
51d3341066 net: icmp: Don't unref net_pkt from the registered handler
A minor overlook from the recent ICMP rework, the registered handlers
should no longer unref the processed packet as it's now the
responsibility of the ICMP module.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-09-29 18:49:43 +03:00