Commit graph

15409 commits

Author SHA1 Message Date
Mateusz Marszalek
61219dacc6 POSIX: Implement pthread_condattr functions
Added:
pthread_condattr_init
pthread_condattr_destroy
pthread_condattr_getclock
pthread_condattr_setclock

Signed-off-by: Mateusz Marszalek <matti.marszalek@gmail.com>
2023-08-30 13:01:03 -07:00
Jamie McCrae
28ba8368ad auxdisplay: Fix handlers file
Fixes usermode access issues with the auxdisplay driver.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-30 15:54:05 -04:00
Yasushi SHOJI
cd184f4332 doc: net: Fix net_pkt_data_access doc about cursor
Unlike other functions in net_pkt.h, net_pkt_data_access() doesn't change
the cursor position.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2023-08-30 13:50:04 +02:00
Bjarki Arge Andreasen
b4cf54b8c3 subsys/modem: Add modem modules
This PR adds the following modem modules to the subsys/modem
folder:

- chat: Light implementation of the Linux chat program, used to
        send and receive text based commands statically created
        scripts.

- cmux: Implementation of the CMUX protocol
- pipe: Thread-safe async data-in/data-out binding layer between
        modem  modules.

- ppp: Implementation of the PPP protocol, binding the Zephyr PPP
       L2 stack with the data-in/data-out pipe.

These modules use the abstract pipes to communicate between each
other. To bind them with the hardware, the following backends
are provided:

- TTY: modem pipe <-> POSIX TTY file
- UART: modem pipe <-> UART, async and ISR APIs supported

The backends are used to abstract away the physical layer, UART,
TTY, IPC, I2C, SPI etc, to a modem modules friendly pipe.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-08-30 13:48:51 +02:00
Robert Lubos
d8a96b1be0 net: sockets: tls: Implement TLS_DTLS_CID option
Add TLS_DTLS_CID socket option, which enables to use the Connection ID
extension for the DTLS session.

The option provides control of the use of CID with the `setsockopt()`
function. The value provided can disable, enable, and control whether to
provide a CID to the peer. It uses a random self CID (if told to provide
one to the peer) unless TLS_DTLS_CID_VALUE set previously.

Add TLS_DTLS_CID_VALUE to get or set the CID sent to the peer, if any.

Add TLS_DTLS_PEER_CID_VALUE to get the CID value provided by the peer,
if any.

Add TLS_DTLS_CID_STATUS to determine if CID used, and whether
bidirectional or one way.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
2023-08-30 11:36:51 +02:00
Nick Ward
2bd76dc648 drivers: pwm: add pwm_is_ready_dt helper function
Add pwm_is_ready_dt()

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-08-30 10:19:47 +02:00
Victor Chavez
82222eb1ab Bluetooth: controller: Added HCI SCO header definition
Added HCI SCO header definition and included comments
that refer to the Bluetooth core spec sections for
the other HCI header types.

Signed-off-by: Victor Chavez <chavez-bermudez@fh-aachen.de>
2023-08-30 10:18:41 +02:00
Eric Holmberg
19e44ae9a0 drivers: sensor: ina237: add shunt voltage support
Add ability to retrieve the shunt voltage if the end user wants to do
the power calculation manually to handle negative power values.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Eric Holmberg
a70d056513 drivers: sensor: ina237: add high-precision mode
The current-shunt calibration requires a factor of 4x if high-precision
mode is selected.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Martin Jäger
7f7201f79b canbus: isotp: replace internal z_timeout with k_timer
The use of private APIs z_add_timeout() and friends is not recommended.

With this commit, usual kernel timer APIs are used.

Fixes #61738

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-08-29 16:14:35 +02:00
Georges Oates_Larsen
b25ea4742e net: conn_mgr: Rename connectivity monitor
The connectivity monitoring subfeature of conn_mgr is currently also
named conn_mgr, which is confusing.

This commit renames it to conn_mgr_monitor, or conn_mgr_mon for short,
for clarity.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-08-29 16:13:37 +02:00
Georges Oates_Larsen
2e762836d5 net: conn_mgr: binding get/set flag
Add a helper allowing connectivity implementations to more easily access
connectivity flags on connectivity bindings.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-08-29 16:13:37 +02:00
Georges Oates_Larsen
49a7798c30 net: conn_mgr: binding lock/unlock
Adds conn_mgr_binding_lock/conn_mgr_binding_unlock, which connectivity
implementations can call to lock or unlock the passed in connectivity
binding.

This allows connectivity implementations to safely make direct accesses
to binding data from outside conn_mgr_conn_api callbacks, and should
allow cleaner, more robust connectivity implementations to be written.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-08-29 16:13:37 +02:00
Georges Oates_Larsen
6d2ce0b30b net: conn_mgr: Create separate connectivity implementation API.
Splits many definitions from conn_mgr_connectivity.h off into their own
header, conn_mgr_connectivity_impl.h

conn_mgr_connectivity.h now focuses solely on user/application-facing
APIs, and conn_mgr_connectivity_impl now contains all functions, utils,
definitions intended for use by connectivity implementations, including
conn_mgr_if_get_binding, which is now available for use by connectivity
implementations.

This lays the foundation for allowing connectivity implementations
easier and safer access to their internal state through internal APIs.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-08-29 16:13:37 +02:00
Guillaume Gautier
702e469e18 include: zephyr: dt-bindings: adc: add macros for stm32 adc clock source
Add macros to help defining the STM32 ADC clock source in device tree.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-08-29 11:27:07 +01:00
Nikolay Agishev
7c025d330d ARC: Fix STR macro for ST* asm instructions
For case of 64-bit arc_v3 architecture "str" macro handles large
offsets in incorrrect way. For stl instruction limm swhoud not exceed 255.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2023-08-29 10:26:15 +02:00
Emil Gydesen
71b1591337 Bluetooth: CAP: Remove qos from start_stream_param
Remove the qos field from
bt_cap_unicast_audio_start_stream_param as it was not used.

The QOS values are set when creating the unicast group,
and not when starting the streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-29 10:22:43 +02:00
Daniel DeGrasse
3926134f8e arch: arm: mpu: Make XN bit conditional on CONFIG_XIP for RAM region
Make the execute never (XN) bit conditonal on CONFIG_XIP for the RAM MPU
region attribute. This is required because when CONFIG_XIP is not set,
the entire image will be linked into SRAM. In this case, SRAM must be
executable.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-08-29 10:22:33 +02:00
Rodrigo Peixoto
7e44469dcc zbus: improve the way of storing observers
ZBus stores observers in two ways: statically using a list and dynamically
using a memory slab. Both present limitations. Static observers work only
for channel definition. The dynamic observers rely on a memory slab that
forces the user to manage its size to avoid issues with adding
observers. This commit fixes the static allocation problem by using the
iterable sections for allocating observation data and replacing the VDED
execution sequence since now it is possible to prioritize static observer
execution. All the runtime observers are dynamically allocated on the heap
instead of a specific memory pool.

BREAK changes (only internal, not APIs):

* ZBus channel metadata changed. Remove the observers' static array
pointer. Rename the `runtime_observers` pointer to `observers`. Add
`observer_start_idx` and `observer_end_idx`;
* Change the VDED execution sequence. The position (on definition time),
the priority in conjunction with the lexical order, is considered for
static post-definition time observers. At last, the runtime observer
follows the adding sequence;
* Replace the `CONFIG_ZBUS_RUNTIME_OBSERVERS_POOL_SIZE` with
`CONFIG_ZBUS_RUNTIME_OBSERVERS`.

New APIs:

* New iterable section iterators (for channels and observers) can now
receive a user_data pointer to keep context between the function calls;
* New `ZBUS_LISTENER_DEFINE_WITH_ENABLE(_name, _cb, _enable)` and
`ZBUS_SUBSCRIBER_DEFINE_WITH_ENABLE(_name, _queue_size, enable)` that
enable developers define disabled observers. They need to be enabled
during runtime to receive notifications from the bus;
* `ZBUS_CHAN_ADD_OBS` macro for adding post-definition static observers of
a channel.

Important changes:

* Move the ZBus LD file content to the `common-ram.ld` LD file. That was
necessary to make ZBus compatible with some Xtensa and RISCV boards.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2023-08-29 10:18:55 +02:00
Florian Grandel
cc4d1bd374 kernel: sched: optimize for Meta IRQs == coop prios
Combining Meta IRQs with cooperative threads requires extra care to
return to pre-empted cooperative threads when returning from a Meta IRQ.
This is only needed when there are cooperative threads that are not also
Meta IRQs. This PR saves some space & time when the number of Meta IRQs
is equal to the number of available cooperative threads.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-08-28 20:15:44 +02:00
Benjamin Cabé
0bfd20567f sensor: doc: add missing doc for decode() retvals
Added missing documentaiton for the return values of the decode() API

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-28 13:43:55 -04:00
Benjamin Cabé
db21a6786a sensor: doc: clean bad doxygen references.
:c:func:, :c:macro: etc shoud not be used in Doxygen comments, as they
are Sphinx roles.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-28 13:43:55 -04:00
Benjamin Cabé
f59dbb39d5 fs: littlefs: doc: clean bad doxygen references.
:c:func:, :c:macro: etc shoud not be used in Doxygen comments, as they
are Sphinx roles.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-28 13:43:55 -04:00
Benjamin Cabé
f9e17b815f rtio: doc: clean bad doxygen references.
:c:func:, :c:macro: etc shoud not be used in Doxygen comments, as they
are Sphinx roles.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-28 13:43:55 -04:00
Benjamin Cabé
355be46639 net: doc: clean bad doxygen references.
:c:func:, :c:macro: etc shoud not be used in Doxygen comments, as they
are Sphinx roles.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-28 13:43:55 -04:00
Benjamin Cabé
56a2137813 bbram: doc: clean bad doxygen references.
:c:func: shoud not be used in Doxygen comments.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-28 13:43:55 -04:00
Emil Gydesen
6ccd112c56 Bluetooth: Audio: Refactor bt_audio_codec_cfg to flat arrays
Refactor the bt_audio_codec_cfg to use flat arrays to store
metadata and codec specific configurations.

The purpose of this is to make it easier to copy the data
between layers, but also to support non-LTV data for non-LC3
codec configurations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-28 15:56:53 +02:00
Nick Ward
2d65acca3a drivers: gpio: use gpio_is_ready_dt helper function
Update `struct gpio_dt_spec` use with gpio_is_ready_dt()

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-08-28 08:48:35 -05:00
Hou Zhiqiang
3b98cfe1c4 arm64: mmu: add Non-cacheable normal memory mapping support
In some shared-memory use cases between Zephyr and other parallel
running OS, for data coherent, the non-cacheable normal memory
mapping is needed.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-08-28 11:41:51 +02:00
Leifu Zhao
25b9f6b5bf x86: linker: move gdt reserve to outer ifdef
The original CONFIG_GDT_RESERVED_NUM_ENTRIES resides in the false
branch of ifdef LINKER_ZEPHYR_FINAL and is actually elminated
finally. It should reside in the outer ifdef clause, namely the
under ifdef CONFIG_GDT_DYNAMIC.

Signed-off-by: Leifu Zhao <leifu.zhao@intel.com>
2023-08-28 10:13:41 +02:00
Dawid Niedzwiecki
3ec8615e25 mgmt: ec_host_cmd: add missing declaration
Add missing declaration of a function to get the SPI backend.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-08-28 10:13:02 +02:00
Daniel Leung
ca23a5f0cf xtensa: mmu: allow SoC to do additional MMU init steps
This adds a function arch_xtensa_mmu_post_init() which can
be implemented on the SoC layer to perform additional MMU
initialization steps if necessary.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-26 16:50:40 -04:00
Georgij Cernysiov
f15508d505 net: lib: coap: refactor client init path options
* Renamed 'coap_client_init_path_options' to
  'coap_packet_set_path'
* Moved into 'coap.c'
* The function is public now

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2023-08-25 13:15:12 +02:00
Henrik Brix Andersen
b18f229fc8 canbus: isotp: group CAN ISO-TP doxygen documentation under connectivity
Move the CAN ISO-TP protocol API documentation from having its own
top-level module to being grouped with the other connectivity APIs.

Change the API documentation header to reflect that this is a protocol.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-08-25 13:14:39 +02:00
Jamie McCrae
55527d8733 mgmt: mcumgr: Add settings management
Adds a settings management group to MCUmgr which allows for
manipulation of the zephyr settings from a remote device.
Includes callback hooks to secure access from an application.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-25 10:54:06 +01:00
Noah Luskey
e71840ed69 net: wifi_mgmt: Fix size calculation for net_mgmt info
net_iface_status is larger than scan_result, causing
net_iface events to be dropped due to info exceeding
NET_EVENT_INFO_MAX_SIZE.

Signed-off-by: Noah Luskey <LuskeyNoah@gmail.com>
2023-08-25 10:52:14 +02:00
Tim Lin
ed37374dac ITE: drivers/pwm: Add the flag of PWM output open-drain mode
This flag is used when the PWM output is set to open-drain mode.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2023-08-25 10:31:42 +02:00
Fabio Baltieri
7ca4eeaaf9 emul: change stub driver priority to kernel device default
Change the emulator stub driver priority to
CONFIG_KERNEL_INIT_PRIORITY_DEVICE. Makes this play well with build time
priority checking.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-25 10:31:02 +02:00
Daniel DeGrasse
6be48b73bf linker: add _image_ram_size symbol to linker symbol definitions
Add _image_ram_size symbol to linker definitions. This symbol
corresponds to the total RAM used by the image.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-08-24 22:09:01 +01:00
Kim Bøndergaard
44e18e8d47 drivers: rtc: rtc_fake: fff rtc driver added
Can be valuable for unit testing modules accessing the RTC

Signed-off-by: Kim Bøndergaard <kim.bondergaard@prevas.dk>
2023-08-24 22:06:51 +01:00
Laczen JMS
c5b19cc44f retained_mem: add user thread support.
Fixes #61848.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2023-08-24 16:57:26 +01:00
Alberto Escolar Piedras
9eeb78d86d COVERAGE: Fix COVERAGE_GCOV dependencies
CONFIG_COVERAGE has been incorrectly used to
change other kconfig options (stack sizes, etc)
code defaults, as well as some samples behaviour,
which should not have dependend on it.

Instead those should have depended on COVERAGE_GCOV,
which, being the one which adds special code and
temporary RAM storage for embedded targets,
require changes to many features.

When building for the native targets, all this was
unnecessary.

=> Fix the dependency.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-24 15:36:31 +02:00
Gerard Marull-Paretas
b5bfe0a264 arch: arm: aarch32: mpu: remove redundant guard
CMSIS header is now generic.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-08-24 13:20:21 +02:00
Gerard Marull-Paretas
94a4d38ed9 cmsis: remove unnecessary includes
Some files included <cmsis_core.h> for nothing, delete it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-08-24 13:20:21 +02:00
Gerard Marull-Paretas
f01b18e435 arch: arm: aarch32: barrier: remove redundant CMSIS ifdeffery
CMSIS header is now generic.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-08-24 13:20:21 +02:00
Gerard Marull-Paretas
b966865dd1 cmsis: add deprecated headers
To ease migration of out-of-tree code, re-introduce previous CMSIS
headers that when include generate a warning informing about the
replacement header.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-24 13:20:21 +02:00
Gerard Marull-Paretas
9c961571a2 modules: cmsis: move glue code to modules/cmsis
The CMSIS module glue code was part of arch/ directory. Move it to
modules/cmsis, and provide a single entry point for it: cmsis_core.h.
This entry header will include the right CMSIS header (M or A/R).

To make this change possible, CMSIS module Kconfig/CMake are declared as
external, allowing us to add a new Zephyr include directory.

All files including CMSIS have been updated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-08-24 13:20:21 +02:00
Mulin Chao
5c7ab5c2bf driver: clock_control: npcx: add support for npcx4 series
This CL introduces new clock architectures in npcx4 series and wraps
clock configurations of different series by device tree files.

For example, the PWDWN_CTLx reg initialization relies on `pwdwn-ctl-val`
prop of pcc DT node now.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-08-24 10:42:33 +01:00
Sachin D Kulkarni
1f2495d17e net: wifi: Enhance wifi_mgmt documentation
Enhance wifi_mgmt group documentation by :
 - Hiding some internal entities i.e. the human-readable strings
   defined in the various static const char * const arrays, by
   marking them as @cond INTERNAL_HIDDEN blocks.
 - Moving the Wi-Fi management API page under the networking group and
   adding a human readable name.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-08-23 16:05:08 +01:00
Sachin D Kulkarni
b572e8216a net: wifi: Add scan extension for specifying channels
Add scan extension to allow limiting the scanning to specific channels.
Only 20 MHz channel specifications are allowed presently.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-08-23 16:05:08 +01:00