Commit graph

97543 commits

Author SHA1 Message Date
Nicolas Pitre
13660dd7b9 demand_paging/backing_store/ram.c: misc fixups
First, do align the buffer. The slab code puts pointers in there and it
does not like it if those are not properly aligned.

And return the actual error code from k_mem_slab_alloc() even if errors
shouldn't happen (it did happen to me because of the above ... with
assertions disabled).

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-06-13 20:12:23 -04:00
Nicolas Pitre
baa70d8d36 arch/arm64/mmu: fix page table reference counting part 2
Commit f7e11649fd ("arch/arm64/mmu: fix page table reference
counting") missed a case where the freeing of a table wasn't propagated
properly to all domains. To fix this, the page freeing logic was removed
from set_mapping() and a del_mapping() was created instead, to be usedby
both by remove_map() and globalize_table().

A test covering this case should definitely be created but that'll come
later. Proper operation was verified through manual debug log
inspection for now.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-06-13 17:03:33 -04:00
Daniel DeGrasse
65d2ae6939 doc: releases: migration-guide-3.7: add note for SSD16XXX displays
Add note for SSD16XXX displays, which have been migrated to the MIPI DBI
API. This note describes how to define the MIPI DBI wrapper device
needed for the SSD16XXX display

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-13 17:01:16 -04:00
Daniel DeGrasse
323adb9f08 tests: drivers: display: build_all: add ssd16xx
Add ssd16xx to display build test

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-13 17:01:16 -04:00
Daniel DeGrasse
8d2dc2f9ef drivers: display: ssd16xx: convert to MIPI DBI API
Convert SSD16XX display driver to use MIPI DBI API. This commit also
updates in tree board devicetrees to include the emulated MIPI DBI SPI
driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-13 17:01:16 -04:00
Emil Gydesen
2690cacf65 samples: Bluetooth: CAP: Add missing argument to get_chan_allocation
The sample was missing a argument to the function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-13 16:58:37 -04:00
Marcin Szymczyk
1d9907a712 soc: common: riscv-privileged: align to no SW ISR table
In case of no SW ISR table, `_isr_wrapper` does not exist.
Do not use it for exception handling.
Future improvements might include setting it to a user-defined handler.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-06-13 16:57:32 -04:00
Marcin Szymczyk
0b20e2afa7 arch: riscv: skip isr.S when SW ISR table is not generated
`isr.S` depends on `CONFIG_GEN_SW_ISR_TABLE`.
Do not build it if SW ISR table is not present.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-06-13 16:57:32 -04:00
Andries Kruithof
7902457437 Bluetooth: audio: test: Unittests for broadcast reception start
Implement unit tests for the broadcast reception start procedure,
both with proper and with improper parameters.

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-06-13 16:48:58 -04:00
Mahesh Mahadevan
b2d1e4505f boards: frdm_mcxn947: Add Display support
Add support for the LCD-PAR-S035 display over the
FlexIO interface.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-06-13 16:48:34 -04:00
Mahesh Mahadevan
3fbd689eaa boards: shield: Add a shield for the NXP LCD-PAR-S035 LCD module
NXP LCD-PAR-S035 LCD module will be used by FRDM-X evaluation
kits with a parallel LCD connector.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-06-13 16:48:34 -04:00
Mahesh Mahadevan
b219596cc1 drivers: mipi_dbi: Add controller driver for NXP FlexIO LCD
Add a driver to support the NXP FlexIO LCD controller that uses
8080/6800 bus protocol.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-06-13 16:48:34 -04:00
Mahesh Mahadevan
3dd5ffe20a drivers: display: st7796: Update the logic to invert RGB and BGR
1. Add a property for panels where the RGB is displayed as BGR.
2. Add a check for 8080 8-bit mode and invert RGB and BGR for
   this case.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-06-13 16:48:34 -04:00
Mahesh Mahadevan
6236779d32 drivers: display: Update setting the mode in the st7796s driver
MIPI mode is read from the device tree.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-06-13 16:48:34 -04:00
Mahesh Mahadevan
53b5dbfb88 include: mipi_dbi: Add defines for MIPI Type A and B
Add defines for MIPI DBI Type A based on Motorola 6800
and Type B baedon Intel 8080 bus

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-06-13 16:48:34 -04:00
Mahesh Mahadevan
c396d8bdbc drivers: clock_control: Update NXP LPC Syscon driver to add FlexIO
Add support to get FlexIO clock

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-06-13 16:48:34 -04:00
Björn Stenberg
1e3fd5361f modbus_serial: Disable rx interrupt if buffer fills up
Disable rx interrupt if the buffer fills up so that rtu_timer can fire and
process the buffer.

Signed-off-by: Björn Stenberg <bjorn@haxx.se>
2024-06-13 16:48:05 -04:00
Hess Nathan
f3679ab2c2 coding guidelines: comply with MISRA Rule 7.4
avoided to assign string literals to non-const char *

Signed-off-by: Hess Nathan <nhess@baumer.com>
2024-06-13 16:47:41 -04:00
Johann Fischer
0dc1414237 samples: usb: remove hid-cdc sample
We have some other simpler CDC ACM and HID samples in the tree.
Providing multiple functions is a core functionality of USB device
support, and we have other samples to demonstrate this as well. This
sample does not really provide anything unique, but has a few issues
such as unsafe HID buffer handling and calling uart_fifo_fill() outside
of the UART driver's IRQ context.
Remove the hid-cdc sample, as there is no value in this sample, and to
avoid spending time fixing and cleaning up the code.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-13 16:47:22 -04:00
Marek Matej
51e5f2d3e5 soc: espressif: esp32c3: reorder ROM sections
This covers the cases described in common-rom-common-kernel-devices.ld
Changing the order of .rodata and .text we prevents to create an
overlapped segments issue.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-06-13 16:47:05 -04:00
Marek Matej
7bf47f8e8f soc: espressif: esp32c3: improve memory utilization
Change the MCUboot segments layout to incread the memory
available in the application.
Add missing symbols to mcuboot.ld

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-06-13 16:47:05 -04:00
Yong Cong Sin
b98a60773b shell: kernel: add command to unwind a thread
Add a shell command to unwind a thread using its thread id.

uart:~$ kernel threads
Scheduler: 11 since last call
Threads:
*0x80017138 shell_uart
        options: 0x0, priority: 14 timeout: 0
        state: queued, entry: 0x800029ac
        stack size 3072, unused 1316, usage 1756 / 3072 (57 %)

 0x80017ca8 sysworkq
        options: 0x1, priority: -1 timeout: 0
        state: pending, entry: 0x80006842
        stack size 1024, unused 644, usage 380 / 1024 (37 %)

 0x800177e0 idle
        options: 0x1, priority: 15 timeout: 0
        state: , entry: 0x800065ae
        stack size 512, unused 180, usage 332 / 512 (64 %)

 0x80017950 main
        options: 0x1, priority: 0 timeout: 13
        state: suspended, entry: 0x80006326
        stack size 4096, unused 3604, usage 492 / 4096 (12 %)

uart:~$ kernel unwind 0x80017ca8
Unwinding 0x80017ca8 sysworkq
ra: 0x80007114 [z_swap+0x58]
ra: 0x80007ae8 [z_sched_wait+0x10]
ra: 0x8000689a [work_queue_main+0x58]
ra: 0x800006de [z_thread_entry+0x2e]

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-13 16:46:48 -04:00
Yong Cong Sin
61a0f9f1c0 arch: riscv: stop printing symbol name at mepc
Now that the unwind starts from mepc already, the symbol
name at the mepc reg is kinda redundant, so just remove it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-13 16:46:48 -04:00
Yong Cong Sin
726fefd12c arch: riscv: stacktrace: implement arch_stack_walk()
Created the `arch_stack_walk()` function out from the original
`z_riscv_unwind_stack()`, it's been updated to support
unwinding any thread.

Updated the stack_unwind test case accordingly.

Increased the delay in `test_fatal_on_smp`, to wait
for the the fatal thread to be terminated, as stacktrace can
take a bit more time.

Doubled the kernel/smp testcase timeout from 60 (default) to
120s, as some of the tests can take a little bit more than 60s
to finish.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-13 16:46:48 -04:00
Yong Cong Sin
5121de6e73 arch: introduce arch_stack_walk()
An architecture can indicate that it has an implementation for
the `arch_stack_walk()` function by selecting
`ARCH_HAS_STACKWALK`.

Set the default value of `EXCEPTION_STACK_TRACE_MAX_FRAMES` to
`ARCH_STACKWALK_MAX_FRAMES` if the latter is available.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-13 16:46:48 -04:00
Maciej Perkowski
3137829e72 boards: nrf: Update nrf54h and nrf54l yamls to use sysbuild in twister
Nrf54h's and nrf54l's targets are the first targets complex enough
that a sysbuild must be used on every build for them. This information
is reflected in their yamls. These entries tell twister to always use
sysbuild for those targets.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-06-13 16:46:25 -04:00
Maciej Perkowski
da1066fa4b twister: Add sysbuild boolean to platform definitions
More complex platforms require sysbuild to use always, even for
such "simple" samples like hello_world. Such platforms can have
`sysbuild: true` entry in their board_name.yaml used by twister.
Using such entry will tell twister, that sysbuild must always be used
on a given platform.
Twister is aligned to have information about need of sysbuild at
instance (platform + suite) level (was only at suite level before).
Instance.sysbuild is true whenever a test suite or a platform requires
sysbuild.
Twister pytest unit tests are aligned with changes.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-06-13 16:46:25 -04:00
Declan Snyder
e902a08832 boards: frdm_rw612: Simple enablements collection
A collection of simple enablements to match some of the enablement
done for rd_rw612_bga as closely as possible on the frdm_rw612 board.

- i2c
- spi
- dma
- mrt
- ctimer
- os timer
- dac
- adc
- trng (alread was enabled but now listed support)
- watchdog

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-13 16:44:12 -04:00
Bjarki Arge Andreasen
5c24c79a90 modem: pipe: simplify synchronization
The design of the pipe is overly complicated compared to the
in-tree and planned future use of the pipe module.

The pipe is currently designed to protect against multiple
threads calling any API simultaineously. This is not neccesary
as only one thread ever calls open/close/transmit/receive at
once, while the notification APIs are potentially called by a
different thread.

This commit removes the synchronization of calls to the open/
close/receive/transmit APIs. It also uses a k_event for thread
safe event and state handling instead of a k_mutex and k_condvar.

The callback is proteced by a k_sem as it modified using the
attach/release APIs, which can be called simultaneously to a
thread invoking the callback.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-06-13 16:43:49 -04:00
Luca Burelli
87e1ab83c9 llext: tests: fix "mps2/an385/*_mpu" OOM
With the ztest code added, tests were failing with -ENOMEM on the
mps2/an385/*_mpu platform due to alignment requirements.

Increase the llext test heap size to 32Kbytes to avoid this.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-13 16:43:26 -04:00
Luca Burelli
d25563f59a llext: tests: re-initialize variables
Some tests depend on global initialized variables, which are then
modified during the test. When enabling user mode, the functions are
called multiple times but the variables are not reinitialized, resulting
in a test failure.

This patch adds a run_id variable to the tests to reinitialize the
variables when the test is called multiple times. It is purposefully
initialized to 41 at startup to detect if the variable is not set up
properly by the llext loader.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-13 16:43:26 -04:00
Luca Burelli
42a0d18ecf llext: tests: add zassert macros everywhere
Most of the current llext tests did not actually check the results of
the tests, so the CI reported a pass even if something was wrong when
looking at the logs. This patch adds the appropriate zassert_* macros to
all the tests, to ensure that they actually perform correctly.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-13 16:43:26 -04:00
Marek Matej
0153b34c4c manifest: hal_espressif update
Update the hal_espressif to include latest esptool version.
Improve support for new SoCs as such as ESP32-C6.
Fix bugs related to segment alignment.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-06-13 16:43:07 -04:00
Aksel Skauge Mellbye
2a4417bb8e soc: silabs: Fix CMake test for soc family
Kconfig options need CONFIG_ prefix when tested for in CMakeLists.txt.

Fixes regression introduced in e90c89d453
that causes all apps to fail to initialize on Silabs socs.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-06-13 16:42:50 -04:00
Benjamin Cabé
94ded47fa7 drivers: crypto: make driver API and conf structs const
Save precious RAM by making sure driver API and config structs are
declared as const

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-13 16:42:35 -04:00
David Schneider
0e830b3f10 doc: kernel: fix braces in code example
Add missing closing brace to `k_poll()` loop example.

Signed-off-by: David Schneider <david.schneider@chargepoint.com>
2024-06-13 16:42:04 -04:00
Phi Bang Nguyen
e2cdd92a52 boards: nxp: mimxrt1064: Remove display chosen node
As display stuffs have been moved to a shield, the display chosen node
must be removed as well as chosen node requires the node to be enabled.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-06-13 11:11:59 -05:00
Nikodem Kastelik
d67abdd02a tests: boards: nrf: add tests for dmm component
Added tests verify output and input buffers allocation
using dmm component.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-06-13 12:02:33 -04:00
Nikodem Kastelik
37e511bcbf soc: nordic: add dmm component
DMM stands for Device Memory Management and its role is to streamline
the process of allocating DMA buffer in correct memory region
and managing the data cache.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-06-13 12:02:33 -04:00
Nikodem Kastelik
ea361f095c boards: nordic: nrf54h20dk: add DMA attribute to RAM21 & RAM3x
This attribute denotes that DMA operation
can be performed from a given region.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-06-13 12:02:33 -04:00
Tomasz Moń
6d5edf9255 tests: usb: fix build all test on qemu_cortex_m3
Reduce RAM disk size from 192 sectors down to 1 sector to solve linking
issue due to qemu_cortex_m3 target having too little RAM. The RAM disk
size does not really matter in this test case and should be as small as
possible.

Enable test random generator to solve missing sys_rand_get() required by
networking subsystem.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-06-13 12:01:31 -04:00
Vinayak Kariappa Chettimada
a568acbfea Bluetooth: Controller: Fix regression due to use of TMR_START_DELAY_US
Fix regression due to use of HAL_RADIO_TMR_START_DELAY_US
introduced in commit 11bae5cfa9 ("Bluetooth: Controller:
Fix missing radio timer comp and range delay").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-06-13 12:01:22 -04:00
Mark Wang
1fabbe01f5 samples: usb: enable next usb device stack samples on NXP platforms
enable next usb device stack samples (cdc_acm, mass and shell)
on rt685 and mimxrt1060_evk

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-06-13 17:59:31 +02:00
Mark Wang
0c70a72ac7 boards: nxp: enable mcux udc on lpc55s69, rt1060 and rt685
set DT node as Okay in board device tree;
add board level's d-cal, txcal45dp and txcal45dm to usbphy node;
enable usb clock; set USB_STACK_USE_DEDICATED_RAM for lpc55s69 and rt685;
load usb.ld for lpc55s69 and rt685.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-06-13 17:59:31 +02:00
Mark Wang
b6b43c3ed7 drivers: udc: implement udc_mcux_ehci and udc_mcux_ip3511
udc_mcux_ehci is based on the MCUX USB controller driver
(usb_device_ehci.c); udc_mcux_ip3511 is based on the
MCUX USB controller driver (usb_device_lpcip3511.c);
add related Kconfig and CMake; include the usb_phy.h path in
modules/hal_nxp/usb/CMakeLists.txt because udc_mcux.c use it;
add related macros to usb_device_config.h;
update CMakeLists for udc_mcux_ehci and udc_mcux_ip3511.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-06-13 17:59:31 +02:00
Mark Wang
a4e411bd13 dts: arm: nxp: enable udc DT on lpc55s69, rt1060 and rt685
define usbphy in DT and controller DT node ref to usbphy node.
define the usbphy yaml and update ehci and ip3511 yaml for usbphy.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-06-13 17:59:31 +02:00
Jonathon Penix
97a734aa01 cmake: llvm: arm64: Set arm64 flags when building with clang
Ensure --target and -mcpu/-mfpu/-mtune are set appropriately when building
with clang targeting arm64/aarch64.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-06-13 17:58:04 +02:00
Jonathon Penix
fb98adc323 kconfig: llvm: arm64: Advertise TLS support when using llvm for arm64
clang and lld both support TLS for arm64/aarch64, so advertise this
support in Kconfig.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-06-13 17:58:04 +02:00
Luis Ubieda
253de6c7a2 samples: shell: shell_module: Add README
With basic description of registering different types of Shell commands.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-13 17:57:36 +02:00
Luis Ubieda
18b19150af doc: shell: Add section for commonly-used commands
With details on how to enable them.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-13 17:57:36 +02:00