Add an mcuboot board variant under the S32K344 SoC in board.yml.
New target is - mr_canhubk3/s32k344/mcuboot. This enables a
single sysbuild invocation to build MCUboot and the application.
Also make a common dtsi for all mr_canhubk3 board variants.
Extend the board documentation with an “MCUboot (sysbuild)” section
that:
Shows one-command sysbuild to produce both MCUboot and app
Documents signing via sysbuild (SB_CONFIG_BOOT_SIGNATURE_*),
and where the signed artifacts are generated.
Provides simple flashing instructions and a troubleshooting
note about using a 1 KiB (0x400) image header and not emitting
an IVT for chain-loaded apps.
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
Emit the IVT section and IVT header only when XIP and the image is either
a standalone XIP app or MCUboot itself. Do not emit the IVT when the
Zephyr image is chain-loaded by MCUboot (BOOTLOADER_MCUBOOT=y).
- linker.ld/sections.ld: place .ivt_header at IVT_HEADER only under
XIP && (!BOOTLOADER_MCUBOOT || MCUBOOT).
Provide __ivt_region_start/end symbols.
- soc.c: guard IVT struct under the same condition and mark it 'used'
so the linker keeps it when needed.
- Kconfig.defconfig - Make the bootloader and the sign tool compatible
with the vector table.
This avoids populating 0x400000 IVT from the app image while retaining it
for MCUboot or standalone XIP use-cases.
Files:
- soc/nxp/s32/s32k3/linker.ld
- soc/nxp/s32/s32k3/sections.ld
- soc/nxp/s32/s32k3/soc.c
- soc/nxp/s32/s32k3/Kconfig.defconfig
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
Use devicetree to provide the system clock frequency for S32K3
instead of hardcoding it in board defconfigs.
- Add clock-frequency to /cpus/cpu@0 in nxp_s32k344_m7.dtsi using
DT_FREQ_M(160).
- Define DT_SYSCLK_PATH and derive SYS_CLOCK_HW_CYCLES_PER_SEC from
the sysclk node via dt_node_int_prop_int() when CORTEX_M_SYSTICK.
- Remove CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC from mr_canhubk3
This keeps the clock configuration in a single SoC-level place,
aligns S32K3 with other NXP Cortex-M SoCs, and ensures both the
MCUboot and application builds share the same
SYS_CLOCK_HW_CYCLES_PER_SEC.
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
Introduce DT bindings for on-chip C40 flash and its controller
and describe their corresponding nodes in nxp_s32k344_m7.dtsi.
- Binding: dts/bindings/mtd/nxp,c40-flash.yaml
Erase/write block sizes.
- Binding: dts/bindings/flash_controller/nxp,c40-flash-controller.yaml
Describe flash device (child) ranges
- SoC nodes: With the new compatible and geometry
properties. Keep status = "disabled" at the SoC level
so boards opt-in.
This prepares the platform for using Zephyr’s flash API / FLASH_MAP /
MCUboot with internal code flash.
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
Add flash controller driver for the on-chip C40 flash controller
The driver is backed by the MCUX C40 HAL and implements
read/erase/program, page layout, and an optional protection policy
that can lock well-known regions (IVT/MCUboot) derived from devicetree.
Key details:
- Selects FLASH_HAS_DRIVER_ENABLED / FLASH_HAS_EXPLICIT_ERASE /
FLASH_HAS_PAGE_LAYOUT.
- Runs erase/program from SRAM when XIP by relocating both the shim and
the MCUX HAL source if CODE_DATA_RELOCATION_SRAM=y.
- Optional protection pass at init (FLASH_MCUX_C40_APPLY_PROTECTION),
which aligns windows to sector boundaries and applies lock/unlock
using the HAL. This is useful on XIP systems to keep IVT/bootloader
ranges read-only; can be disabled if a bootloader or security policy
manages protection instead.
Files:
- drivers/flash/flash_mcux_c40.c (new)
- drivers/flash/CMakeLists.txt (+zephyr_code_relocate when needed,
Compliance fixes)
- drivers/flash/Kconfig.mcux (enable flash driver, reloc & protection)
- modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
Add a sensor channel for the encoder counts. This is useful for
reading the encoder counts and calculating an absolute position
of a linear actuator.
Signed-off-by: Omeed Baboli <omeedbaboli@gmail.com>
Add board support for the WEMOS LOLIN32 Lite, a compact ESP32-D0WDQ6/
ESP32-D0WD-V3 based development board with integrated Wi-Fi and BLE.
Features:
- 4MB flash (W25Q32)
- Onboard battery charging (TP4054, PH-2 connector)
- CH340C USB-to-serial converter
- Onboard LED on GPIO22
- Micro-USB or USB Type-C variants
Signed-off-by: Siratul Islam <email@sirat.me>
In TLS 1.3, when mbedtls_ssl_read() returns an error, wpabuf_free() is
called twice: first in tls_connection_handshake() and then again in
eap_tls_process_input(), leading to an assertion failure. Remove the
redundant wpabuf_free() to prevent the double-free issue.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
PEAP Wi-Fi connections on RW612 may fail due to memory allocation
errors in mbedTLS. Increasing the mbedTLS heap size resolves this
issue.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
The supplicant currently supports TLS 1.3 only for EAP-TLS. To prevent
TLS handshake failures in PEAP-TLS phase2, add the flag
'tls_disable_tlsv1_3=1' to phase2 configuration, ensuring TLS 1.3 is
disabled for inner authentication.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
If the TRNG has been unretained, it's not sufficient to enable
the clock, it must be fully reinitialized.
This is a minimal fix to ensure entropy is accumulated after sleep.
Long term, this driver should be made to use device power
management with power domain awareness.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Improved code quality with below changes.
- Avoided declaration shadowing variable in the global scope.
- Avoided missing default in switch block.
- Dropped unused variable.
- Reduced the level of if statements properly.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Added Ethernet bridge sample and enable mimxrt1180_evk_mimxrt1189_cm33
board as an example. On mimxrt1180_evk_mimxrt1189_cm33, 5 ports are
bridged with DHCPv4 enabled to test, including 4 DSA ports and
1 normal Ethernet port.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Dropping packet is normal operation when iface is down.
So, we don't have to use warning here for much noise.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Ethernet bridge performs L2 forwarding between bridged interfaces.
But for the virtual bridge interface, we could make it perform as
normal Ethernet interface with IP address to use.
This is useful allowing applications to communicate with network,
like LAN router or switch with a host IP.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Current bridge function is very simple which does forwarding for all
packets. There will be more and more features of bridge RX handling.
Let's move bridge RX handling to bridge_input.c for next IPv4/IPv6
protocols support for virtual bridge interface.
And currently there is no path to call bridge_iface_recv function.
Let's rework it for proper function returning NET_CONTINUE.
Also fixed another issue of link local address checking. Because
net_linkaddr structure changed. So fixed
is_link_local_addr((struct net_eth_addr *)net_pkt_lladdr_dst(pkt))
to
is_link_local_addr((struct net_eth_addr *)(net_pkt_lladdr_dst(pkt)->addr))
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Add !BT_ADV_RPA_VALID check to force RPA regeneration when re-enabling
an advertising set after RPA rotation occurred while disabled.
The BT_ADV_RANDOM_ADDR_UPDATED flag was added to prevent unnecessary
address regeneration (RPA/NRPA) between bt_le_ext_adv_param_set() and
bt_le_ext_adv_start() calls. However, this revealed an issue:
When RPA rotation (le_force_rpa_timeout) occurs while an advertiser is
disabled, BT_ADV_RPA_VALID is cleared but the RPA is not regenerated.
On subsequent bt_le_ext_adv_start() without a new param_set() call:
- BT_ADV_RANDOM_ADDR_UPDATED is already cleared (from previous start)
- Without BT_PER_ADV_ENABLED, no regeneration occurs
- Stale RPA is used, violating privacy requirements
Add !BT_ADV_RPA_VALID check for both connectable and non-connectable
advertisers to ensure fresh RPA generation when the previous RPA was
invalidated while the advertiser was disabled.
Fixes regression introduced in #98117.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Replace selection of legacy Mbed TLS Kconfigs with PSA Crypto API ones.
While at this, add also a test case using "overlay-tls.conf" since this
is also mentioned in README file.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Replace legacy Mbed TLS crypto support with PSA API.
RSA key exchange dependency was removed because all certificates and
keys used in the test are EC.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Test had forever loop that was attempting to read k_timer_remaining_ticks
while system tick did not change. If target has relatively fast system
clock then it might be impossible.
Tweak test to repeat few times and if k_timer_remaining_ticks is not
read in the known tick then range is used to validate correctness of
the returned value.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Fixes the auto channel status by using the channel number from fetched
wireless info, rather than the input config variable.
Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
Add explanation of the `CONFIG_LV_Z_POINTER_FROM_CHOSEN_TOUCH` interaction
with the `zephyr,touch` chosen node.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
After removing the `zephyr,lvgl-pointer-input` device the init level
entries have shifted by one entry. Update them accordingly.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
With the new LV_Z_POINTER_FROM_CHOSEN_TOUCH most boards do not need to
specify a dedicated pseudo device anymore.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Adds a Kconfig option LV_Z_POINTER_FROM_CHOSEN_TOUCH which automatically
creates a lvgl input pointer device from the chosen zephyr,touch node.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
On M55M1 series, the clock module index is virtual to stay compatible
with 32-bit only cell value in devicetree. Its real value of being
64-bit integer needs to acquire indirectly.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
Fix invalid pointer-to-integer cast and comparison warnings in
ADXL362, ADXL367, and ADXL372 decoder drivers. The previous code
used `(uint8_t *)*fit` for offset comparison, which triggered
`-Wint-to-pointer-cast` warnings on recent compilers and could
lead to undefined behavior.
This patch replaces unsafe casts with `uintptr_t` arithmetic and
ensures type-safe offset calculations, preserving existing logic
while eliminating all build warnings.
Signed-off-by: Dilip Raman <dilipr@aerlync.com>