Commit Graph

434 Commits

Author SHA1 Message Date
Johan Hedberg 1fb4cbbb48 boards: posix: Use HEAP_MEM_POOL_ADD_SIZE KConfig options
Kconfig options with a HEAP_MEM_POOL_ADD_SIZE_ prefix should be used to
set the minimum required system heap size. This helps prevent
applications from creating a non-working image by trying to set a too
small value.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-12-20 11:01:42 +01:00
Fabio Baltieri f9313b1745 input: add a linux-evdev device
Add a device driver to read events from a Linux evdev device node and
inject them back as Zephyr input events.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-18 12:23:59 +01:00
Alberto Escolar Piedras ad4544fd0f native_sim docs: Miscellaneous fixes
* Add a subsection linking to the emulators section.
* Added more internal links
* Fixed EPROM simulator/emulator mix, and added link
  to simulator
* For the RTC peripheral, mention there is no driver for
  it yet.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-12-18 09:28:57 +01:00
Henrik Brix Andersen fe74ffe2d5 drivers: can: drop POSIX from the native Linux SocketCAN driver name
Rename the native Linux SocketCAN driver to reflect that it can can now be
used in both native_posix and native_sim (with or without an embedded
C-library).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-12-12 14:28:26 +00:00
Henrik Brix Andersen c86f5c0f61 drivers: can: native_posix_linux: add embedded libc support
Add support for compiling the native POSIX Linux (SocketCAN) driver with an
embedded C-library.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-12-10 09:24:30 +01:00
Alberto Escolar Piedras 210bd28a24 native_simulator: Allow to pass extra options for localizing symbols
Some libraries (like Openthread's spinel code) define their
API as externally linkable. This will make those symbols
remain as externally linkable by default after the
Zephyr build has produced the native simulator library
(MCU code).
When building an AMP native_simulator executable with
several MCUs each including these, the linker will see
those symbols as still linkable and duplicated, and
throw an error.

So let's give the option for users/developers of those
libraries to define extra symbols they want
to localize before assembling the final executable.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-12-06 09:25:41 +00:00
Alberto Escolar Piedras 47b7eaece9 boards nrf5340bsim_cpuapp: Select approprite 802154 radio in DT
Set the chosen 802154 radio in DT for the
nrf5340bsim_nrf5340_cpuapp so we can build with the
radio driver built into the net core.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-12-04 14:20:42 +01:00
Christopher Friedt 09ff569c9e boards: posix: add dma support to native_posix boards
Like other driver APIs, we can add an `emul` variant to
`native_posix` and `native_posix_64` that should allow us to
simplify applilcation and library development and to also
increase test coverage in CI.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-12-03 19:22:31 -05:00
Alberto Escolar Piedras 25599df05e boards nrf5340bsim_cpuapp: Define chosen entropy source
Override the chosen entropy source irrespectively of what the
SOC may chose.
This is to avoid problems as the SOC may select the
cryptocell, but we do not support it in the simulated
target.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-12-01 10:55:45 +00:00
Alberto Escolar Piedras 44b8971e48 native_sim: Improve instructions for i386 packages
To the instructions that install "foreign architecture" (i386)
packages on a x86-64 system, add the commands to ensure
the architecture is added if it wasn't already.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-12-01 10:52:07 +00:00
Alberto Escolar Piedras df100d4598 boards native: Add not supported features
Add a section with the most significant not supported features.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-12-01 10:52:07 +00:00
Alberto Escolar Piedras 0f6a3d0334 boards native: Switch default testing platform native_posix->native_sim
Set native_sim as the default testing platform instead of native_posix.
This continues the agreed strategy described in #58305

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras 7332eb2ea7 board native_sim/posix: Provide NEVER/NSI_NEVER definitions
Some native_posix specific apps/tests use the macro NEVER
provided it also for native_sim until all have switched
to the new NSI_NEVER.

And ensure NSI_NEVER is also avaiable when building
for native_posix to ease the transition.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras cd5f88e8d3 boards native_posix/sim: Define native_posix DTS from native_sim's
Get the native_posix DTS from native_sim instead of
the oposite. As native_sim is now the default test platform.

Note this commit is practically just swapping files.
There is no changes to the DTS content, beyond
changing the board name.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 12:17:57 +00:00
Alberto Escolar Piedras bc08e801c6 native_sim build: Fix for APPLICATION_BINARY_DIR!=CMAKE_BINARY_DIR
In some cases, the APPLICATION_BINARY_DIR does not match
the CMAKE_BINARY_DIR, in those cases the native simulator
build would not find the zephyr elf file.
Fix it by using the correct variable.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-17 12:42:17 +01:00
Alberto Escolar Piedras 65fd7d4246 samples shell/fs docs: Enable for native_sim
Instead of always enabling fuse for native_posix,
let's give users instructions on how to enable it
while building.

In the documentation: replace the references to native_posix
with native_sim, improve the links, mention the flash
simulator, and provide a separate subsection for FUSE access.

Add a separate test for the sample with fuse access enabled
and be sure it is possible to run both this and the basic
one with native_sim (was filtered out before for native_posix)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-17 09:23:48 +01:00
Alberto Escolar Piedras ceba001bad bsim boards doc: Update general bsim boards documentation
Polish and correct the documentation to reflect the use
of the native_simulator, and the fact that we have
now more than one bsim board in tree.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-16 17:53:25 +01:00
Alberto Escolar Piedras faf8bb0696 boards nrf5340_bsim doc: IPC and MUTEX peripherals are now supported
Update this board docs to reflect that these 2 peripherals
are now supported.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-16 17:53:25 +01:00
Alberto Escolar Piedras 9fe225d2b8 doc/connectivity/usb: Replace references to native_posix w native_sim
Replace the references to native_posix with native_sim,
and update link names accordingly.

Background: during this release native_sim is replacing
native_posix as the main host test/development platform.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-16 09:37:59 +01:00
Andrej Butok 287b30eb78 doc: Fix double 'the'
Fix double 'the' in all .rst documentation.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-15 14:25:11 +00:00
Alberto Escolar Piedras 86db699564 docs: native_sim: Polish documentation
Polish the native_sim documentation a bit.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-14 14:38:10 +01:00
Alberto Escolar Piedras c3d863f864 docs: boards posix: Replace reference to native_posix w native_sim
Let's replace the references to native_posix with native_sim,

Background: during this release native_sim is replacing
native_posix as the main host test/development platform.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-14 14:38:10 +01:00
Alberto Escolar Piedras c05b81bd9c docs: native_sim/posix: Swap documentation from native_posix to native_sim
During this release native_sim is replacing native_posix
as the main host test/development platform.

Therefore, instead of basing the native_sim documentation
in native_posix's one, let's do it the other way around.

This commit mostly moves documentation from the native_posix
page into the native_sim one, changing the board and renaming
labels.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-14 14:38:10 +01:00
Alberto Escolar Piedras e60878e7eb nrf52_bsim: Remove nfct peripheral from DT
This board HW models do not yet support the NFCT peripheral,
let's remove the DT node to avoid the driver being selected.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-08 10:09:05 +01:00
Carles Cufi 9cf07bbdb5 bluetooth: Rename rpmsg HCI driver and sample to ipc
The existing driver and sample:

- drivers/bluetooth/hci/rpmsg
- samples/bluetooth/hci_rpmsg

are no longer correctly named, since they now use the IPC subsystem to
send and receive data. The IPC subsystem can use RPMsg as a transport,
but that is one of several selectable backends.

I initially wanted to deprecated both the BT_RPMSG Kconfig option as
well as the zephyr,bt-hci-rpmsg-ipc chosen node in Devicetree. However,
this proved to be undoable in the case of the Kconfig option. This is
because it's a choice option, and those have special behavior. In
particular, the only practical way to deprecate would've been to keep
the old Kconfig option outside the choice (much like it's done in this
commit) but then also add a 'depends on !BT_RPMSG' on each of the
remaining choice symbols *except* on the new BT_HCI_IPC one. This, however,
only works correctly for .conf files. If a board instead sets the
default BT_HCI_BUS_TYPE in the Kconfig.defconfig file then the Kconfig
tree parsing would fail, because it'd try to set it to a value
(BT_RPMSG) that is no longer part of the choice.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-11-02 08:32:20 +02:00
Alberto Escolar Piedras 4963f049c5 nrf53bsim: Add support for split 15.4 builds
Add the required chosen DT properties to enable
split 15.4 builds.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-26 12:31:08 -05:00
Alberto Escolar Piedras f7f800c957 doc: nrf53 bsim: OpenAMP is now supported
Let's delete the note which says OpenAMP is not supported
as it is now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-26 17:33:16 +02:00
Alberto Escolar Piedras 7f43b00e23 nrf53_bsim doc: Add paragraph about using sysbuild
And a link to an example sample and its sysbuild.cmake file

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-26 17:33:16 +02:00
Alberto Escolar Piedras 9dabc55c3e nrf5340bsim: Add support for NRF53_SYNC_RTC & ENABLE_CPUNET
Add support for these two options in the simulated board.

Before these options were otherwise defined in the real
BOARD/SOC kconfig files, which meant samples/tests which
used them would not be able to build due to a kconfig error.

With this change they can both be selected, and the right
functionality is built in.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-26 17:33:16 +02:00
Alberto Escolar Piedras 3f1eed17f8 nrf53_bsim: Get IPC shared memory buffer size from DT
Before we were defining the buffer in the runner context
which is simpler and less error prone, but it had a hardcoded
size decoupled from DT as it could not be based on DT
information.
Instead, let's allocate the buffer in the application core
image. This allows us to size it based on the device tree
configuration.
Note that this then requires the application core image
to be present during link time of the final executable
when the IPC subsystem is used.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 17:31:59 +03:00
Alberto Escolar Piedras 7ea95b0071 nrf5x_bsim: Add support for IPC/OpenAMP and split BT stack
For the 5340 simulated boards:
* Now that the HW models include the IPC and MUTEX peripherals
  we can enable them in DT.
* Also enable the DT mbox definition and allocate its shared memory
* Set the default kconfiguration for the HEAD, IPC, MBOX and split
  BT stack as in the equivalent real targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 15:26:10 +02:00
Alberto Escolar Piedras f8e8083ab3 nrf53_bsim: Provide shared memory buffer for IPC rpmsg backend
Provide the actual shared memory buffer for the
IPC rpmsg backend in this platform.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 15:26:10 +02:00
Alberto Escolar Piedras 413a349264 nrf_bsim: Only connect once to Bsim Phy
Each MCU initialization hooks will attempt to call
into the API to connect to the bsim phy and, if the
user requested it thru command line, delay its boot.

Doing this for all MCUs is best to ensure it is done
even if there is no image for the other MCU,
but results in the calls being done twice if there is
2 MCUs images, which results in the simulator API giving
a warning about it being likely an error in the app.

To avoid this problem, let's have this be called
only once.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 15:26:10 +02:00
Jason Wright 7e02a0379f drivers: counter native: Add top value conf and multi channel support
The counter_native_posix driver currently does not support top value
configuration, i.e. `ctr_set_top_value` returns `-ENOTSUP`. This commit
adds support for top value configuration, and with the counter API now
fully implemented, adds `counter` to `supported` peripherals for
native_posix target.
It also resolves an existing bug in which the
counter ISR did not reset upon reaching `TOP_VALUE`.
And adds support for multiple channels

Signed-off-by: Jason Wright <jason@jpw.nyc>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-23 13:38:43 +02:00
Alberto Escolar Piedras 97ac96f56d bsim tests: Fix incorrect libC free call from bstests
The bstests code builds and executes with the embedded
code, but had a call into "free()" which, when building
the embedded code with an embedded C library lands
in the embedded libC free, while it should
always call into the host libC free.

Fix it by calling thru the appropriate trampoline.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:20:32 -05:00
Jukka Rissanen 0bd323ab88 board: native: Update the posix Ethernet driver documentation
Remove the mention of startup script and update the documentation
to reflect the current way of working i.e., using net-setup.sh script
before starting the zephyr.exe process.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-20 15:00:41 +02:00
Alberto Escolar Piedras b1515ac364 boards nrf_bsim: Set native_gdb as debug runner
Set native_gdb as the runner for the debug build target

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-10 15:26:09 +02:00
Alberto Escolar Piedras 9ce33d7512 native sim: Set native_gdb as debug runner
Set native_gdb as the runner for the debug build target.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-10 15:26:09 +02:00
Alberto Escolar Piedras e851725e62 boards nrf52_bsim docs: Minor updates
Minor updates both to make it more consistent with the
nrf53bsim documentation, and include more links
and a small section about the C library choice.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-04 16:35:41 +02:00
Alberto Escolar Piedras d12fac706d boards nrf_bsim docs: Update common documentation
Update the documentation describing the bsim boards overall
to match the current reality.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-04 16:35:41 +02:00
Alberto Escolar Piedras 84f76e42da boards nrf_bsim docs: Add documentation for nrf5340bsim
Add documentation for the newly introduced nrf5340bsim boards.
And rename the nrf52bsim documentation file as it is not the only
one anymore.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-04 16:35:41 +02:00
Alberto Escolar Piedras 8b78eecfd6 boards posix: Fix in POSIX arch common description
Minor updates as now we have also native_sim, so we
should not only refer to native_posix.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-04 16:35:41 +02:00
Alberto Escolar Piedras 6ef42d0b80 boards nrf53_bsim: Set net core as primary
So it gets the command line arguments by default.
This eases running the BT test which run on the
nrf52_bsim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Alberto Escolar Piedras dd2eefb1ce nrf_bsim: nrf53_bsim_cpunet: Automatically start CPU
Automatically start the Network domain CPU during HW boot.
In the real HW this CPU is held on reset until something else
(Typically the application MCU) releases it.
But doing so facilitates running tests in this MCU as there is
no requirement for an image for the application core.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Alberto Escolar Piedras b9f23b0c71 nrf_bsim boards: Add new simulated nrf53 boards
Add the first definition for the new simulated nrf5340 boards.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Alberto Escolar Piedras d116a06a92 boards nrf_bsim: Add MCU number to traces
When we have more than 1 MCU, add the MCU number to the traces
so we can identify from which MCU they come from.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Alberto Escolar Piedras 27f32af8ec nrf5x_bsim: Add command line options to control MCU boot
Add options to force MCUs to boot/not boot, overriding
of how they would behave otherwise, as well as an
option to print info about the MCUs present in the
platform.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Alberto Escolar Piedras fa470ca57d native SOC: Add option to make a MCU to boot on its own
As a development helper, add a kconfig option to
automatically start the MCU this Zephyr image is built
for during HW boot, even if in other circumstances
this MCU would not start automatically (for ex. because
another core is meant to release its reset).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Alberto Escolar Piedras af00bd8cb1 nrf_bsim: Handle test options for N MCUs
Handle test options for N MCUs instead of just 1.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00
Alberto Escolar Piedras 4fd9ffb995 boards nrf52_bsim: Rename folder to nrf_bsim
As we will now we having more nrf5*_bsim boards defined in this
same folder, the old folder names became missleading.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 16:21:43 +03:00