192 Commits

Author SHA1 Message Date
Alberto Escolar Piedras
92df06bf1d boards: native: nrf_bsim: Add simple model of LDREX/STREX/CLREX
Add a model of LDREX/STREX/CLREX, that although simple may be correct
enough to cover the needs of SW using these instructions.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-01-23 09:17:37 -06:00
Gatien Chevallier
a6953f6427 boards: native_sim: add OTP memory emulator node
Add an OTP memory emulator node to the board native_sim board device
tree file.

Additions of a node to the native sim device tree shifts the device
index, hence making the check_init_priorities test fail. Update the
index in the reference data of the test.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
2026-01-16 11:42:50 +00:00
Henrik Brix Andersen
9186d6864a boards: native: add support for static linking
Add support for static linking of the final native simulator runner.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-01-08 09:45:55 +01:00
Alberto Escolar Piedras
a2f45762f1 arch posix: cleanup NATIVE_APPLICATION support remnants
NO_POSIX_CHEATS was a macro used to avoid including the content of a
header (`posix_cheats.h`) which allowed building applications in the
POSIX architecture without the native simulator, avoiding collisions
between some embedded symbols and those from the host C library.

Support for this way of building, and this header and macro were
removed in e150ffb92c, but these users
were forgotten. This was harmless, but let's just clean it up now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-01-03 10:19:34 +01:00
Alberto Escolar Piedras
cb1b1212e4 boards native_sim: Add documentation on how to cross-compile
Providing a guide on how to setup an Ubuntu24.04 x86_64 host
for arm builds and how to build and run locally the arm binary.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-12-05 13:38:48 +02:00
Fabian Blatz
d4ec3fef5e boards: Remove lvgl_input_pointer where chosen zephyr,touch is present
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>
2025-12-02 11:31:07 +01:00
Nikodem Kastelik
ad1e5ac253 nordic: update and align to nrfx 4.0.1
New nrfx release contains major rework of nrfx drivers
instantiation making it easier to integrate with dts nodes.
Now, nrfx driver instances can no longer be `const`
because they contain driver runtime state.
Additionally, all nrfx drivers return `errno` error codes
instead of deprecated `nrfx_err_t`.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-11-27 14:45:17 +01:00
Alberto Escolar Piedras
612ae54950 boards/native nrf54lm20bsim: Remove experimental warning
This simulated board has been there for more than 5 months.
The real board (nrf54lm20dk) is properly supported and in the market.
So there is no need to have this warning anymore.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-11-18 17:36:18 -05:00
Josuah Demangeon
ccbc21bb32 style: boards: apply CMakeLists.txt coding style
Apply the CMake style guidelines to all CMakeList.txt files in boards/.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Alberto Escolar Piedras
8e19196b1e boards/native/native_sim: Remove deprecated cmdline_common.h
This header was deprecated in ea79fdb4dd
for v4.2.
Let's remove it now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-11-17 09:20:34 -05:00
Alberto Escolar Piedras
29a11ee1a4 boards/native/native_sim: Remove deprecated timer_model.h
This header was deprecated in 43b43f5408
for v4.2.
Let's remove it now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-11-17 09:20:34 -05:00
Alberto Escolar Piedras
04a24a5a4d boards/native/native_sim: Remove deprecated native_posix_compat.h
This header was deprecated in 543f2da251
for v4.2.
Let's remove it now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-11-17 09:20:34 -05:00
Alberto Escolar Piedras
1ad92e5c79 boards native_sim: Remove NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME
The kconfig option NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME was deprecated
in bd42df2662 for the 4.2 release.
Let's remove it now.

Users should be using NATIVE_SIM_SLOWDOWN_TO_REAL_TIME instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-11-13 20:43:44 -05:00
Fin Maaß
5805685c32 Kconfig: make use of configdefault
use configdefault, when we want to change
the default of a Kconfig option.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-11-13 11:20:20 -05:00
Pisit Sawangvonganan
b1cf15b9a4 dts: fix typo in (boards, dts)
Utilize a code spell-checking tool to scan for and correct spelling errors
in `.dts` and `.dtsi` files within the `boards` and `dts` directories.

Note: To pass CI compliance checks, also fix the formatting in
`/dts/arm/infineon/edge/pse84/system_clocks.dtsi`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-11-06 12:29:48 +02:00
Anas Nashif
303af992e5 style: fix 'if (' usage in cmake files
Replace with 'if(' and 'else(' per the cmake style guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-29 11:44:13 +02:00
Pisit Sawangvonganan
74b3617003 doc: rst: fix typo in (boards, doc, samples)
Utilize a code spell-checking tool to scan for and correct spelling errors
in `.rst` files within the `boards`, `doc`, and `tests` directories.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-10-29 10:32:30 +02:00
Krzysztof Chruściński
182a6c62b1 drivers: timer: nrf_rtc: Kconfig clean up
Remove redundant enabling of NRF_RTC_TIMER in SoC specific files
and replace it with default y in the NRF_RTC_TIMER definition.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-10-28 17:42:38 +02:00
Jamie McCrae
dd5a3f1a3e dts: vendor: nordic: nrf5340: Fix SRAM partitioning
Uses the correct way to partition memory as per the linux binding,
also fixes names which were not compliant with the zephyr
devicetree guidelines

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-27 16:26:24 -04:00
Alberto Escolar Piedras
320496db7a boards native_sim: reboot: Do not close descriptors manually
Instead rely on them having been opened with O_CLOEXEC, or that
whichever component has opened it will close it with a
NATIVE/NSI_TASK(ON_EXIT) hook.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-07 23:01:38 -04:00
Supper Thomas
e9e6b81fbc doc: fix peripheral to peripheral_hr
Just fix the bin to right name

Signed-off-by: Supper Thomas <78900636@qq.com>
2025-10-03 20:57:14 -04:00
Alberto Escolar Piedras
a8f10c9390 docs native_sim: Fix drivers table entry for hwinfo
A column was missing

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Tim Pambor
6e048bc068 drivers: hwinfo: native: report reset cause
Support reporting the reset cause for native_sim. The default is to
report POR (Power-On Reset). If CONFIG_NATIVE_SIM_REBOOT was enabled and
the system is rebooted using sys_reboot(), the reset cause is set to
SOFTWARE.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-09-29 12:37:47 -04:00
Alberto Escolar Piedras
621255fc95 doc: board native_sim: Mention that now we support FUSEv3 also
How to select it, and what packages can be used.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-09-22 13:30:46 -04:00
Kyle Micallef Bonnici
2d22884f52 devicetree: format files in boards
Applying dts-linter results for format files in boards

Signed-off-by: Kyle Micallef Bonnici <kylebonnici@hotmail.com>
2025-09-12 18:29:00 +02:00
Benjamin Cabé
6de7702910 boards: doc: native_sim: adopt zephyr-board directive
Update documentation of native_sim to leverage zephyr-board Shinx magic,
in particular the ability to generate the table of supported HW
features.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-09 10:12:00 -04:00
Henrik Brix Andersen
ec1e05c421 drivers: hwinfo: add HWINFO driver for native_sim
Add a HWINFO driver for native_sim with support for getting the device
ID. Default device ID will be that returned from gethostid(), but the ID
can be overriden via the -hostid command line option.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-09-06 08:40:34 +02:00
Sean Kyer
3b60bb91e9 native: cpu_freq: Add CPU freq support to native_sim
Define P-states for native_sim and add mock cpu_freq
driver.

Signed-off-by: Sean Kyer <Sean.Kyer@analog.com>
2025-09-05 07:43:56 +02:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Benjamin Cabé
2f29ee07c2 boards: native_sim: fix typo "simulator"
s/Simular/Simulator/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Tim Pambor
120f5a073c serial: uart_native_pty: IRQ support
Add support for the interrupt-driven API. Interrupts are
emulated using a polling thread.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-08-19 19:14:21 +02:00
Alberto Escolar Piedras
8522f513b1 boards native: Support using lld as linker for native simulator runner
Let's assume that if a user sets the linker to be lld (likely with
CONFIG_LLVM_USE_LLD=y) that they also want the native simulator runner
to be linked with it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-08-15 15:34:50 +02:00
Henrik Brix Andersen
1d45e17037 Revert "serial: uart_native_pty: IRQ support"
This reverts commit df1e6f5290.

Fixes: #94425

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-08-12 20:33:02 -04:00
Tim Pambor
df1e6f5290 serial: uart_native_pty: IRQ support
Add support for the interrupt-driven API. Interrupts are
emulated using a polling thread.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-08-12 21:33:00 +02:00
Alberto Escolar Piedras
e1beee608c docs boards native_sim: Clarify that *uart_cmd can be anything
Clarify that the uart "attach commands" can be really anything
the shell can run.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-08-08 10:47:12 -05:00
Alberto Escolar Piedras
c64702a5d7 docs boards native_sim: Change title
Let's better refer to the board by the name "native_sim",
and leave the "native simulator" for the underlaying common
component which is shared with the nrf*bsim targets.

native_sim is the "plain vanilla" native simulator build with
some trivial HW models.
While the nrf*bsim targets use the native simulator (without those
trivial HW models), and expand it with the Nordic HW models.

Hopefully that helps people understand what is common and what
is not.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-08-08 10:47:12 -05:00
Henrik Brix Andersen
1dbd552b2e boards: native: native_sim: add reference to the SocketCAN snippet
Add reference to the SocketCAN snippet.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-08-01 19:37:08 +01:00
Alberto Escolar Piedras
059186558f boards nrf_bsim: Add docs for new nrf54lm20bsim target
Add documentation for new simulated nRF54LM20 target

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-08-01 07:48:27 -04:00
Alberto Escolar Piedras
b82baf66af doc: bsim boards: Typo fixes
Just a few grammar fixes

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-08-01 07:48:27 -04:00
Andrey Dodonov
a4fa5de807 drivers uart_native_posix: mention that pty supports async
With CONFIG_UART_ASYNC_API pty driver for native sim now supports async

Signed-off-by: Andrey Dodonov <Andrey.Dodonov@endress.com>
2025-07-31 16:49:23 -04:00
Alberto Escolar Piedras
f4794f848b doc boards/native: Remove orphan diagram
This diagram was superseded by layering_natsim.svg
When the native_posix related documentation was removed
this diagram stopped being used.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-30 17:24:32 -04:00
Alberto Escolar Piedras
542874333c boards nrf_bsim: Add a new nrf54lm20bsim target
Add a new simulated nrf54lm20 cpuapp target

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:37 +02:00
Alberto Escolar Piedras
a0f2ec8352 boards/native: Remove NATIVE_SIM_NATIVE_POSIX_COMPAT kconfig option
This option was introduced together with native_sim in 3.5 to ease
the transition from native_posix, and was deprecated in 4.1.

Let's remove it now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:23 +02:00
Alberto Escolar Piedras
2b18fc8348 native_sim_reboot: Remove NATIVE_APPLICATION support
It is not possible to build anymore in that mode, so we do not
need to support it in this component.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:15 +02:00
Alberto Escolar Piedras
7e1f2ffe00 boards/native docs: Remove note on NATIVE_APPLICATION
As we do not include any support in tree for this mode, we do not need
to warn in the documentation that it does not apply to it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:15 +02:00
Alberto Escolar Piedras
86d8853fd5 boards native SDL integration: Remove NATIVE_APPLICATION support
It is not possible to build anymore in that mode, so we do not
need to support it in this driver cmake files.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:15 +02:00
Alberto Escolar Piedras
2356c1db3c doc native: Clarify that in Windows one needs a VM for native_sim
Be more explicit about the need for a Virtual Machine running Linux if
running in Windows.
Also WSL2 has been out for ~5 years. Let's reduce the amount of info
on how  to run it in WSL1, as probably almost nobody is using it
anymore.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-06-10 12:51:54 -04:00
Yuval Peress
d17956a074 build: Support SYSROOT_DIR in native_sim and clang
When running naive sim builds using clang, respect user passed
SYSROOT_DIR values. Additionally, allow overriding the archive tool
when calling Make for the native simulator.

Add the sysroot (if available) to the native_simulator target and
TOOLCHAIN_C_FLAGS and TOOLCHAIN_LD_FLAGS. Additionally pass CMAKE_AR
to NSI_AR.

Signed-off-by: Yuval Peress <peress@google.com>
2025-06-06 10:11:49 +02:00
Alberto Escolar Piedras
5c9c3497ed boards native bsim: Provide control of disconnection on exit
Allow either programatically from the test/code or from the command
line to chose if this executable exiting should terminate the
whole simulation, or if it should only disconnect the device.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-05-19 16:36:30 +02:00
Alberto Escolar Piedras
b3c5b3a7dc boards/native/nrf_bsim: Declare as pointer to constant data
To be clearer to the compiler and users.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-05-13 12:09:30 +02:00