Commit graph

15409 commits

Author SHA1 Message Date
Benedikt Schmidt
0861395713 drivers: smbus: implement SMBus driver for STM32
Implement a SMBus driver for STM32, which reuses
the I2C implementation.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-12-12 10:57:41 +01:00
Benedikt Schmidt
a0f547aac4 drivers: smbus: add missing includes
Add includes which are actually required for the compilation
in the headers themselves to avoid include dependencies.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-12-12 10:57:41 +01:00
Flavio Ceolin
b5ca7a06b4 pm: device_runtime: Add delay to async put
Add a delay parameter to asynchronous device runtim put. This allows
to delay the put operation what is useful to avoid multiple states
transitions.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-12-12 10:57:34 +01:00
Juha Ylinen
69e28939dd net: lib: coap: Add new API to configure retransmission settings
Add new functions to the public CoAP API to configure CoAP packet
retransmission settings. Application may need to re-configure the
settings for example when cellular modem changes connection from
LTE-M to NB-IoT or vice versa.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2023-12-12 10:56:29 +01:00
Anas Nashif
01264d23db drivers: intc: manage multi-level interrupt configs
Multilevel interrupt configs are leaking into every single build without
this option being enabled, so guard the Kconfig and include files to
avoid this.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:23:23 -05:00
Anas Nashif
552f7194e3 arch: exception: rename header guard
Match guard with header file name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Anas Nashif
699880a430 arch: arm: cortex_m: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Anas Nashif
4d5fd2edf2 arch: arm: cortex_a_r: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Anas Nashif
1813a33108 arch: arm: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Anas Nashif
87eb1d842f arch: arc: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Anas Nashif
864731acdf arch: arm64: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Anas Nashif
9d1a6b6db5 arch: xtensa: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Anas Nashif
8447700013 arch: riscv: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Anas Nashif
4a020ecc02 arch: mips: rename expection header
Rename exception header and use the same name as all architecture ports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-11 18:22:40 -05:00
Dat Nguyen Duy
03b702690a include: arm: mpu: add missing RAM NOCACHE region define for armv8-r
Add missing define for a non-cacheable RAM region for MPU
on armv8-r aarch32

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-12-11 19:26:47 +01:00
Jukka Rissanen
0880dbee92 net: if: Tweak the documentation of multicast monitor API
As the API supports both IPv4 and IPv6, mention it clearly in
the header documentation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-11 18:33:38 +01:00
Burt Silverman
a1358aaedf sys: Modify ATOMIC_BITMAP_SIZE macro: num_bits = 0
The macro returned the wrong value for any case in which
    num_bits<=0, due to a signed/unsigned division. The num_bits=0 case was
    hit using static analysis in a Nordic Semiconductor SDK case.

Signed-off-by: Burt Silverman <burtms@gmail.com>
2023-12-11 18:32:05 +01:00
Marcio Ribeiro
8cb870f7de driver: input: espressif touch_sensor
Espressif touch sensor driver implemented.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2023-12-11 18:31:38 +01:00
Kuno Heltborg
220a57b0b1 mgmt: mcumgr: improve custom payload types
Use a flag in `c:struct:mgmt_handler` to skip the cbor start and end byte,
and instead use pure custom user defined payload.

Signed-off-by: Kuno Heltborg <kunoh@live.dk>
2023-12-11 18:31:23 +01:00
Emil Gydesen
7913ebfba3 Bluetooth: GMAP: Add initial implementation of GMAP
Add initial implementation of Gaming Audio Profile (GMAP).

This is a top layer profile in the LE Audio stack,
designed for low latency audio ideal for gaming.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-11 18:30:57 +01:00
Gustavo Romero
640712054e include: arch: arm: Fix arch_curr_cpu() for Cortex-M
Currently, the arch_curr_cpu() implementation always uses the TPIDRURO
register, even on Cortex-M CPUs where such a register is not available,
causing a CPU fault.

This commit fixes it by reverting to the use of generic kernel struct
to obtain the current cpu instead of using the TPIDRURO register.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
2023-12-11 10:12:13 +01:00
Daniel Leung
240dd53e18 sys: arch_interface: fix doc in arch_user_mode_enter
The transition is to USER mode, and not kernel mode.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-11 10:12:05 +01:00
Robert Lubos
a150380d65 net: tcp: Implement Keep-alive support
When a TCP connection is established, if there is no data exchange
between the two parties within the set time, the side that enables
TCP Keep-alive will send a TCP probe packet with the same sequence
number as the previous TCP packet. This TCP probe packet is an empty
ACK packet (the specification recommends that it should not contain
any data, but can also contain 1 nonsense byte, such as 0x00.). If
there is no response from the other side after several consecutive
probe packets are sent, it is determined that the tcp connection has
failed, and the connection is closed.

The keep-alive default parameters are aligned with Linux defaults.

Signed-off-by: Horse Ma <mawei@coltsmart.com>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-12-11 10:11:10 +01:00
Yuval Peress
694fa3c293 rtio: Fix i2c implementation
- Allow non RTIO i2c drivers to be intermixed with RTIO drivers
- Remove reference to rtio_spsc_drop_all()
- Fix impllicit cast which throws an error with more restrictive
  compile flags

Signed-off-by: Yuval Peress <peress@google.com>
2023-12-11 10:10:59 +01:00
Daniel Leung
51b3420b80 doc: doxygen: move float_apis group into correct place
The float_apis group is incorrectly placed in x86/32 header.
This should be in kernel.h enclosing k_float_* functions.
So move it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-11 10:10:30 +01:00
Chaitanya Tata
ceee997c6f wifi: Add the enums to the status
This helps to demonstrate that the enumerations have to be used to
interpret the status.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-12-11 09:57:19 +01:00
Chaitanya Tata
d8d4c77603 wifi: Add an enum for disconnect reasons
This can be used to interpret the "status" in the disconnect result event.
To start with a few common reasons are enumerated but can be extended in
the future.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-12-11 09:57:19 +01:00
Chaitanya Tata
b3453c3f74 wifi: Add an enum for connect result status
This can be used to interpret the "status" in the connect result event.
To start with a few common reasons are enumerated but can be extended in
the future.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-12-11 09:57:19 +01:00
Declan Snyder
3ec0f3a462 drivers: clock_control: Support NXP_ENET
Support ENET peripheral clock in MCUX SIM and CCM_REV2 driver

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-12-11 09:50:58 +01:00
Flavio Ceolin
899d4f997e userspace: Additional checks in K_SYSCALL_MEMORY
This macros needed additional checks before invoking
arch_buffer_validate.

- size can not be less then 0. Some functions invoke this macro
  using signed type which will be promote to unsigned when invoking
  arch_buffer_validate. We need to do an early check.
- We need to check for possible overflow, since a malicious user
  application could use a negative number that would be promoted
  to a big value that would cause a integer overflow when adding it
  to the buffer address, leading to invalid checks.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-12-11 09:50:33 +01:00
Aleksandr Khromykh
d175ac0572 Bluetooth: Mesh: access tx msg randomizer
Commit adds implementation of the specification
recommendations regarding randomization of
responses on the access layer.
3.7.3.1 Transmitting an Access messages

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-12-11 09:50:18 +01:00
Fabio Baltieri
bc849c7078 input: kbd_matrix: add print helper define
Add a print helper define for the keyboard matrix row paired with the
row typedef.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-08 20:16:39 +00:00
Jasper Smit
6003927ac2 net: sntp: Add option for SNTP uncertainty
SNTP response is not analyzed for uncertainty, and no uncertainty is given
to the `struct sntp_time` returned. Fix it with a Kconfig option that adds
optional SNTP uncertainty and timestamp fields in SNTP time struct, and
calculates these when parsing the response.
Adds two helper functions to convert Q16.16/Q32.32 in seconds to `int64_t`
in microseconds to facilitate this.
Also changes combined `lvm` field in `struct sntp_pkt` to bit-fields
`li`, `vn`, and `mode`.

Signed-off-by: Jasper Smit <git@jrhrsmit.nl>
2023-12-08 10:25:46 +00:00
Jukka Rissanen
825bc325d2 net: context: Document misc settings and functions
Various misc settings and functions were not documented so fix it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-08 10:21:38 +00:00
Jukka Rissanen
039c6a304d net: context: Document socks proxy settings
Documentation for socks proxy was missing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-08 10:21:38 +00:00
Jukka Rissanen
405b8b5f19 net: context: Add docs for getter/setter of TTL/hoplimit values
The IPv4 TTL and IPv6 hop limit value getter and setter functions
were not documented properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-08 10:21:38 +00:00
Emil Gydesen
203949c42c Bluetooth: VCP: Allow for multiple vol_ctrl cb registers
Modify the VCP volume controller callbacks to support
multiple registers by making it into a linked list.

This allow for multiple applications to get the information
from procedures or notifications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-08 10:04:31 +00:00
Ederson de Souza
026908b7b8 include/zephyr/net: Add 'brief' to group description
So it doesn't extend previous directive.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2023-12-07 16:18:34 +00:00
Lingao Meng
786b9a0ad4 Bluetooth: Host: Add const prefix for UUID
Add const prefix for service uuid and char uuid.

Since Service UUID and Char UUID should not change in the service
definition, they are most reasonably defined as rodata, also for
save some ram footprint.

The field `attr->user_data` type is `void *`, as this PR change
all Service UUID to rodata, so there must add (void *) to avoid warning.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-12-07 16:16:43 +00:00
Peter Mitsis
a3e5af95de kernel: Update k_sleep() and k_usleep() return values
Updates both the k_sleep() and k_usleep() return values so that if
the thread was woken up prematurely, they will return the time left
to sleep rounded up to the nearest millisecond (for k_sleep) or
microsecond (for k_usleep) instead of rounding down. This removes
ambiguity should there be a non-zero number of remaining ticks
that correlate to a time of less than 1 millisecond or 1 microsecond.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-12-07 10:41:00 +00:00
Alberto Escolar Piedras
19ac0a2839 drivers adc_emul: Refer to native_sim overlay instead of native_posix
Refer to the native_sim overlay instead of the native_posix one.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-12-07 10:39:31 +00:00
Marc Lasch
8358cdd697 net: lwm2m: Reduce dependency on firmware update pull Kconfig
There are functions whose headers are only visible when
CONFIG_LWM2M_FIRMWARE_UPDATE_PULL_SUPPORT is selected. However these
functions are used outside the scope of the firmware update pull
functionality. This change allows to disable
CONFIG_LWM2M_FIRMWARE_UPDATE_PULL_SUPPORT while still being able to use
the firmware update object.

Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
2023-12-07 10:38:58 +00:00
Marcus Folkesson
0096a980d3 include: drivers: display: verify if optional API is implemented
Basically all display drivers implements a few dummy functions that
just returns due to lack of capabilities.

Move that validation to the driver API instead.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
2023-12-07 10:36:52 +00:00
Pieter De Gendt
5182dd24c6 net: lib: coap: Introduce net mgmt events for CoAP
Allow users to register net mgmt events callbacks for CoAP events.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-12-07 10:34:39 +00:00
Pieter De Gendt
f712441840 Revert "net: lib: coap: Add support for observer event callbacks"
This reverts commit 5227f24815.

The coap observer events will be replaced with net_mgmt events.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-12-07 10:34:39 +00:00
Sumit Batra
e0dc6f4fe4 drivers: sensor: qdec_s32: Add QDEC support for S32
Add code to configure and program Lcu, Trgmux and Emios_Icu IPs to
get the the rotations by the motor in radians.

Co-authored-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
Co-authored-by: Mayank Mahajan <mayankmahajan.x@nxp.com>
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-12-06 20:06:37 -06:00
Luca Burelli
e96b713caf llext: record size of each stored section
Store the size of each section in the llext structure.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2023-12-06 18:01:34 -05:00
Luca Burelli
cbed9fd785 llext: always initialize ext param in llext_load
It is not safe to assume that on entry to llext_load, *ext contains
either NULL or a previous reference to the same ext being loaded. For
example, the shell sample was passing an uninitialized value.

Initialize *ext from a search of the llext by name. If NULL, it is the
first instance of this llext (and on load error, it stays that way). If
not NULL, increment use count and return.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2023-12-06 18:01:34 -05:00
Yong Cong Sin
f61ce34998 shell: shell_uart: reinstate multi-instance macro
Reinstate the `SHELL_UART_DEFINE` macro and moved the struct
declarations to header file, making it possible to create
another UART shell backend instance by doing
`SHELL_UART_DEFINE()` + `SHELL_DEFINE()` + `shell_init()`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-12-06 11:27:20 -08:00
Mariusz Skamra
3e52c87323 Bluetooth: pacs: Fix missing return values in doxygen
This fixes missing return values description in doxygen documentation.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-06 17:54:14 +00:00