Commit graph

126,787 commits

Author SHA1 Message Date
Omri Sarig
c712502fb9 scripts/logging: Create live_log_parser
Create a new, generic parser, that is able to parse dictionary logs live
- showing the messages as they are received from the device.

This functionality previously existed only for reading the log from a UART.
With the new script, the functionality is extended to be able to also read
the log from a file or stdin.
Additionally, the script is written in an extend-able way, making it simple
to support more input sources in the future.

The new script contains a better version of the live functionality than the
old script of log_parser_uart script, therefore, the old script has been
deprecated.
The UART script is still available, and will work by invoking the new
implementation with relevant arguments translation, however, it should
ideally not be used any longer, and should be removed from a future
release.

Signed-off-by: Omri Sarig <omsi@demant.com>
2025-08-19 11:39:49 +02:00
Omri Sarig
152e6252fe scripts/logging: Handle partly read packets
The current implementation of the serial log parser is running in a loop -
every 2 seconds it checks if there is any information ready to be read, and
in this case, it reads this information and parses it.
In case the last packet of the information is not fully available, the
script will read only the first part of the packet, and will fail when
parsing, ending the run with an error.

This should not the be the case, as it is not an error to have only part
of the packet in the buffer.
This commit fixes this problem - now, instead of failing because the parser
does not have enough information, the parser will parse all the full
packets it have, and keep the last, partial packet in the queue, to be
parsed together with the next chunk of data.

This is done by updating the log parsers to return the amount of parsed
data when trying to parse the information, and updating the calling scripts
to correctly handle this new return value.
Additionally, the parser is now quietly failing in case of having a partial
message, and throw an exception for any other kind of error in the parsing
(instead of returning a boolean return code).

In addition to the partial packet handling, the current commit also do the
following, minor improvements:
* parserlib now fails by throwing an exception, instead of exiting - this
  is done to make it possible to choose a different handling for the errors
  from the calling code, if needed.
* The dictionary and parser are now created before the parse operation.
  This makes the uart parser more efficient, and also removes the
  previously duplicated messages of build id, target architecture and
  endianess (which was printed every time new information was received from
  the UART).

Signed-off-by: Omri Sarig <omsi@demant.com>
2025-08-19 11:39:49 +02:00
Omri Sarig
cb94b1ba2a scripts/logging: Add support for numbered %ll and %hh
Python does not support values of long-long (ll) or short-short (hh) in
string-formatting. The current parser is correctly removing the first "h"
or "l" from the format, to make it possible to correctly parse these
strings when they are in the dictionary.

However, the current implementation does not correctly handle the case of
having a number before the "ll" or "hh" argument - which is supported by
both C and Python.

This commit updates the parser to correctly handle these cases, by changing
the simple replace operator with a regex replace, which is able to
correctly handle this case.

Before this commit, the string of:
    "This is my long variable: %08llX"
will stay the same, which will throw a ValueError when parsing this
dictionary message:
    "ValueError: unsupported format character 'h' (0x68) at index ".
After this commit, the string will be correctly fixed to
    "This is my long variable: %08lX"
which is parsed correctly.

Signed-off-by: Omri Sarig <omsi@demant.com>
2025-08-19 11:39:49 +02:00
Aleksander Wasaznik
54165f4fb7 MAINTAINERS: Move tests/bsim/bluetooth/tester to Bluetooth Qualification
`tests/bsim/bluetooth/tester/` contains tests for
`tests/bluetooth/tester/` so it should belong to the same maintainer
area.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2025-08-19 12:28:06 +03:00
Hake Huang
cac9752696 shield: mimxrt1170_evk: fix the shield usage
original rk055hdmipi4m does not support mimxrt1170_evk
change to rk055hdmipi4ma0

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2025-08-19 12:27:55 +03:00
Peter Johanson
2f21baacd0 boards: seeed: Fix XIAO MG24 standard uart pins
Properly use EUSART1 for the XIAO connector serial device, and switch XIAO
SPI to EUSART0 to allow simultaneous use.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2025-08-19 12:27:41 +03:00
Johan Hedberg
31a78a9d6b boards: silabs: Use default value for COMMON_LIBC_MALLOC_ARENA_SIZE
Use the default -1 value for COMMON_LIBC_MALLOC_ARENA_SIZE, i.e. let the
heap expand to the remaining amount of memory.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-08-19 12:27:26 +03:00
Khaoula Bidani
985d49c18b drivers: clock_control: fix PLL input frequency
Updated the PLL input frequency calculation to include
division by the HSI clock divider.
Enable HSI divider using LL_RCC_HSI_EnableDivider().

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-08-19 12:27:17 +03:00
Khaoula Bidani
11c0826419 dts: arm: st: l0: update hsi clock node to use hsi divider
Updated the clk_hsi node to use the "st,stm32l0-hsi-clock"
compatible to use hsi divider.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-08-19 12:27:17 +03:00
Khaoula Bidani
d2be504eeb drivers: clock_control: add HSI_DIV on STM32L0
Enable support for HSI_DIV and its use as a clock source on STM32L0 SoCs.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-08-19 12:27:17 +03:00
Khaoula Bidani
2e368d1bba dts: bindings: clocks: Add clocks bindings for stm32l0 series
Add hsi clock for stm32l0.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-08-19 12:27:17 +03:00
Jonas Berg
aef421525b Boards: Add Adafruit RP2040 Adalogger
Add the Adafruit RP2040 Adalogger board.
The board image is from the Adafruit product page.

Signed-off-by: Jonas Berg <jonas.s.t.berg@gmail.com>
2025-08-19 09:13:32 +02:00
Aditya Ganesh
38b40ed16e drivers: dac - Added additional channel selection support for AD5686
Added support for selecting channels A, B, both together, and all channels
on the AD5686 DAC driver. This improves flexibility for multi-channel
DAC applications.

Signed-off-by: Aditya Ganesh <adga5133@colorado.edu>
2025-08-19 09:13:20 +02:00
Pete Dietl
c407fbcfc9 [drivers]: gpios: SN74HC595: Extend to allow for chained shift registers
The current driver has a few limitations:
1. The `ngpios` DT property is fixed at eight.
   Since the SN74HC595 and kin are designed to be
   easily daisychain-able, the upper bound on `ngpios`
   should be limited only by the maximum number of pins
   that Zephyr supports per GPIO port, which is 32.
2. In the case of having no control over the shift register's
   reset input, the device tree node should accept a default
   value to shift into the register(s) during init.
3. There seems to be an assumption that the serial clock
   and load clock are tied together. While this is often the
   case, the device tree node should be more flexible in
   allowing the specification of a separate load clock GPIO pin.
4. The device tree node should also be able to accept a GPIO pin
   to drive the enable input pin of the shift register(s).

This commit addresses all of these issues.

Signed-off-by: Pete Dietl <petedietl@gmail.com>
2025-08-19 09:13:12 +02:00
Jilay Pandya
090130c35b samples: stepper: drop newline characters from LOGs
remove unnecessary newline characters from LOGs
introduce logging in tmc50xx sample

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-08-18 22:01:30 +02:00
Pavel Vasilyev
8de6705ec3 drivers: bluetooth: Align bt_hci_send behavior on error
This change alignes HCI drivers behavior with Host expectation. That is:
if an HCI driver managed to send a packet to Controller, the HCI driver
also unreferences it. If the HCI driver didn't manage to send the
packet to Controller and returns an error code, it does not unreferences
buffer.

This change aligns the behavior of HCI drivers with the Host's
expectations. Specifically:
- If an HCI driver successfully sends a packet to the Controller, the
  HCI driver also unreferences it.
- If the HCI driver fails to send the packet to the Controller and
  returns an error code, it does not unreference the buffer.

Fixes #94445

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-08-18 22:01:15 +02:00
Keith Packard
3ab84aa2a7 tests/mem_protect: Adjust backing store size
This test is failing; perhaps we've shrunk the kernel enough to change what
this value needs to be?

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
a72b31b655 tests/kernel: Loosen bounds on timeslice schedule for slow clocked systems
RX consistently fails this test by a tiny amount. Loosen the tolerance to
let it work.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
b56e138521 tests/arm_mpu_pxn: Insist that trivial functions are not inlined
GCC 14 takes a look these functions which are just 'return true' and
inlines them even though they has the noinline attribute set. This happens
because the compiler computes the possible range of values from the
function call, and as that is a single value (true), it replaces the call
with that value. So it's not strictly inlining the function?

Insist a bit harder by adding a compiler_barrier to the functions which
seems to solve the issue.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
302b192dd9 tests/kernel: Avoid C library calls from interrupt handlers
On arm64, GCC feels free to use floating point registers for essentially
anything unless we build with -mgeneral-regs-only. After the FPU gets used
in an interrupt handler, interrupts are disabled as there's no place to
save the registers during a nested exception. As the C library may be built
separately without this flag, we cannot use any of its functions or risk
having nested exceptions fail.

Switch printk usage to k_str_out and stick to (mostly) Zephyr internal
functions to ensure nested interrupts work correctly.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
9051e2ea3e toolchain/gcc: Add "memory" clobber to asm traps before CODE_UNREACHABLE
GCC 14.3 will happily delete any code that appears before
__builtin_unreachable that isn't separated with an obvious branch. That
includes __asm__ statements, even those which generate traps.

The failure case that I debugged was on x86 in
z_check_stack_sentinel. There is a store to restore the sentinel to the
correct value just before the ARCH_EXCEPT, and that macro emits 'int $32'
followed by CODE_UNREACHABLE. Because the compiler didn't understand that
ARCH_EXCEPT was changing execution flow, it decided that the sentinel
restoring store 'couldn't' be reached and elided it.

I added the "memory" clobber to the asm statement in ARCH_EXCEPT before
CODE_UNREACHABLE to enforce that all pending store operations be performed
before the asm statement occurs. This ensures that they are not deleted by
the compiler.

I think this might be a GCC bug. The GCC documentation explicitly documents
that asm statements which change the flow of control should be followed by
__builtin_unreachable.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
8d95c2c2ba modules/cmsis-dsp: Don't use Zephyr stdint.h
Zephyr replaces the toolchain version of stdint.h to define uint32_t and
int32_t as int rather than long. This breaks the ARM MVE intrinics which
require uint32_t to be defined as unsigned long.

Define 'ZEPHYR_USE_TOOLCHAIN_STDINT_H_' as that causes zephyr_stdint.h to
be skipped, ensuring that the normal stdint.h types are used instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
469d54e227 drivers/adc/adc_stm32: Check both single-ended and differential defines
The stm32u3x header files defines LL_ADC_SINGLE_ENDED but not
LL_ADC_DIFFERENTIAL as the device doesn't support differential mode. The
driver only checked for LL_ADC_SINGLE_ENDED and assumed that when that was
defined, LL_ADC_DIFFERENTIAL would also be defined.

Check for both when figuring out which calibration type will be required.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
c5e8b6c634 soc/intel_adsp: soc_adsp_halt_cpu always fails when NUM_CPUS <= 1
When the target has only a single CPU, this function cannot ever
succeed. Skip all of the drama and just return -EINVAL. This makes GCC 14
happy as it doesn't get confused about possible out of bounds access of the
soc_cpus_active array.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
b031864385 arch/x86: Support picolibc with zefi
Disable the default startup file with -nostartfiles.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Bjarki Arge Andreasen
2387d348bd tests: spi: spi ctrl peri: nrf54h20dk cpurad uart135 device runtime
Add zephyr,pm-device-runtime-auto; to uart135 which is the uart
used for logging to enable PM_DEVICE_RUNTIME for it, which is
required for its power domains.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-08-18 22:01:03 +02:00
sudarsan N
863186a4e2 spi: rtio: null pointer dereference in spi_rtio_transceive
Check if cqe is NULL before accessing cqe->result in
spi_rtio_transceive(). Prevents possible null pointer dereference
from rtio_cqe_consume() return value.

CID: 516229
Fixes: #90547

Signed-off-by: sudarsan N <sudarsansamy2002@gmail.com>
2025-08-18 22:00:54 +02:00
Łukasz Stępnicki
551805a829 tests: kernel: interrupt: generic ISR offset definition for nrf54h20 VPRs
All VPRs in nrf54h20 can have same ISR offset configuration.

Signed-off-by: Łukasz Stępnicki <lukasz.stepnicki@nordicsemi.no>
2025-08-18 22:00:44 +02:00
John Batch
fc8a988a83 tests: drivers: gpio: add overlay to run test on IFX kit_psc3m5_evk
Adds an overlay to enable the GPIO api tests to run on the
kit_psc3m5_evk board. GPIO 3.0 is used as an output, 3.1 is used as an
input for the test.  The test expects GPIO 3.0 and GPIO 3.1 to be
jumpered together.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-08-18 22:00:33 +02:00
Zhaoxiang Jin
d4fc1da29e boards: nxp: Move board specific files from hal to zephyr
Move board specific files (dcd, flash_config, etc.) from
nxp hal repo to zephyr repo.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-18 22:00:19 +02:00
Peter Wang
d172b9d76b boards: nxp: Renamed MCXA276 to MCXA266
1. Renamed MCXA276 to MCXA266
2. NXP frdm_mcxa276 is renamed to frdm_mcxa266,
add this information to migration-guide-4.3.rst.

Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
2025-08-18 22:00:19 +02:00
Zhaoxiang Jin
7d3fc2b176 boards: nxp: Renamed MCXA166 to MCXA346
1. Renamed MCXA166 to MCXA346.
2. NXP frdm_mcxa166 is renamed to frdm_mcxa346,
add this information to migration-guide-4.3.rst.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-18 22:00:19 +02:00
Zhaoxiang Jin
f130db64df modules: hal_nxp: Add core_id for RT685 HIFI4 core
1. Add core_id for RT685 HIFI4 core, this variable is
used in MCUX SDK cmake.
2. Set cmake variables 'CONFIG_MCUX_COMPONENT_driver.smartdma_mcxn'
and 'CONFIG_MCUX_COMPONENT_driver.smartdma_rt500' to "ON" as these
variables control the loading of source files in the latest driver
CMakeList.txt.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-18 22:00:19 +02:00
Zhaoxiang Jin
c6e5758d46 drivers: interrupt_controller: Update CMakeLists to fix build error
Now use the 5-parameter function "PINT_PinInterruptConfig"
deprecated in MCUX SDK, need to add compile definition
'PINT_USE_LEGACY_CALBACK' to make intc_nxp_pint compatible
with updated 'fsl_pint' driver.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-18 22:00:19 +02:00
Zhaoxiang Jin
34bf4ed28c west.yml: Update hal_nxp to mcux sdk 25.06.00
Update hal_nxp to mcux sdk 25.06.00.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-18 22:00:19 +02:00
Zhaoxiang Jin
bfe65a0179 scripts: compliance: Add items to UNDEF_KCONFIG_ALLOWLIST
'MCUX_HW_CORE' and 'MCUX_HW_FPU_TYPE' are used in
modules/hal_nxp/device.cmake. It is a variable used
by MCUX SDK CMake.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-18 22:00:19 +02:00
Zhaoxiang Jin
ab4531589a modules: nxp: Add more MCUX SDK NG cmake variables
These variables are used to make MCUX SDK NG cmake
can find the right cmake files.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-18 22:00:19 +02:00
Fin Maaß
bea75bb138 drivers: spi: remove spi_cs_is_gpio checks
remove spi_cs_is_gpio checks before
spi_context_cs_control, as it is also done
inside and we don't need to check two times.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-08-18 22:00:07 +02:00
Fin Maaß
3f4f8965f3 drivers: spi: spi_context: exclude gpio code if no gpio cs
exclude gpio code if no gpio cs are used
for that spi driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-08-18 22:00:07 +02:00
Eden Frosst
0598b2cc81 drivers: serial: stm32: propagate baud rate config failure
The uart_stm32 driver gives no way for a user to
tell if setting a new baud rate was successful.
Propagate error checks up to the API level.

Signed-off-by: Eden Frosst <edenfrosst@gmail.com>
2025-08-18 21:59:59 +02:00
Jakub Zymelka
376b34ca63 drivers: adc: nrfx_saadc: Add support for SAADC internal sampling timer
The SAMPLERATE register can be used as a local timer instead
of triggering individual SAMPLE tasks. When SAMPLERATE.MODE is set
to Timers, it is sufficient to trigger SAMPLE task only once in order
to start the SAADC and triggering the STOP task will stop sampling.
The SAMPLERATE.CC field controls the sample rate.

The SAMPLERATE timer should not be combined with SCAN mode and
only one channel should be enabled when using the internal timer.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2025-08-18 21:59:50 +02:00
Emil Dahl Juhl
44929f7089 dts: arm: st: n6: describe rng block
The stm32n6 features an RNG block. The RNG is a true NIST SP800-90B
compliant entropy source according to the stm32n657x0 reference manual[1].

Per Table 3 in the reference manual, the RNG peripheral register boundary
address (secure) is 0x54020000 to 0x540203FF. That is, base address
0x54020000 and size 0x400.

Per Table 73 in the reference manual, the RNG peripheral has only a single
rng_clk option (hsis_osc_ck).
Per section 14.10.66 (and more) the RNG peripheral control is performed
through AHB3 using bit 0.
As such, the `clocks` property contains a single phandle to the RCC AHB3
bit 0 entries.

Per Table 135 in the reference manual, the RNG peripheral interrupt is
located at position 40 in the NVIC.

[1] RM0486 Rev 2: https://www.st.com/resource/en/reference_manual/rm0486-stm32n647657xx-armbased-32bit-mcus-stmicroelectronics.pdf

Signed-off-by: Emil Dahl Juhl <emil@s16s.ai>
2025-08-18 17:49:45 +02:00
Joakim Andersson
e63996f498 soc: stm32u5x: Add break in switch to avoid wrong debug message
Add break in switch case to avoid the debug message when SOC_LOG_LEVEL
has been set to debug.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2025-08-18 17:49:36 +02:00
Alain Volmat
6b1f864e76 drivers: smbus: stm32: add select PINCTRL
stm32 smbus driver is relying on the pinctrl framework
hence select CONFIG_PINCTRL to ensure proper build.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-18 17:49:28 +02:00
Alain Volmat
fd5dd5e04f drivers: sdhc: stm32: add select PINCTRL
stm32 sdhc driver is relying on the pinctrl framework
hence select CONFIG_PINCTRL to ensure proper build.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-18 17:49:28 +02:00
Alain Volmat
379fa75ca7 drivers: i3c: stm32: add select PINCTRL
stm32 i3c driver is relying on the pinctrl framework
hence select CONFIG_PINCTRL to ensure proper build.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-18 17:49:28 +02:00
Alain Volmat
5017279493 drivers: ethernet: dwmac_stm32h7x: add select PINCTRL
stm32 dwmac_stm32h7x driver is relying on the pinctrl framework
hence select CONFIG_PINCTRL to ensure proper build.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-18 17:49:28 +02:00
Alain Volmat
fd041a7573 drivers: clock: stm32-mco: add missing select PINCTRL
stm32 mco clock driver is relying on the pinctrl framework
for configuring the MCO pin hence select CONFIG_PINCTRL
to allow proper build.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-18 17:49:28 +02:00
Alain Volmat
14525b99d5 drivers: crypto: stm32: ensure RESET is selected
stm32 crypto driver requires a reset control hence ensure that
CONFIG_RESET is properly selected to allow proper build.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-18 17:49:28 +02:00
Alain Volmat
5c12e5526a drivers: display: stm32-ltdc: ensure RESET is selected
stm32 ltdc driver requires a reset control hence ensure that
CONFIG_RESET is properly selected to allow proper build.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-18 17:49:28 +02:00