In commit d8e3ea6bc2
the LF clock interrupt was enabled, which causes its interrupt
handler to be used. This interrupt handler interacts with the
NRF_POWER registers.
Therefore require using the newer HW models which include a stub
of this registers.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
If we just had the kernel's implementation, we could
just move this to lib/, but possible arch-specific
implementations dictate that we just make this a
syscall.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This can help find unused symbols. Those end up without a type if
'default' is used instead of 'def_bool', which generates a warning.
Search for "Kconfig.defconfig" in
https://docs.zephyrproject.org/latest/application/kconfig-tips.html for
a longer explanation.
Keep the 'def_bool' for the following symbols, which seem to be
deliberately defined only in Kconfig.defconfig files:
- ALTERA_AVALON_I2C
- ALTERA_AVALON_MSGDMA
- ALTERA_AVALON_PIO
- ALTERA_AVALON_QSPI
- ALTERA_AVALON_SYSID
- CLOCK_CONTROL_IMX_CCM
- CPU_EM4_DMIPS
- CPU_EM4_FPUDA
- CPU_EM4_FPUS
- FP_FPU_DA
- I2C_GECKO
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
In #10543 some include directives are modified to include some
folders in the path to the nrfx hal headers.
This would break things with the previous nRF52 HW models as the
replacement hal files were not placed in a folder matching that
path, and the include path was not pointing directly at the folder
containing the files.
Therefore, require the latest HW models version (which replicates
that folder structure), and add a new -I for the compiler 2 folders
higher.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Added a check at compile time to ensure the HW models are either
the desired version or newer.
Otherwise print a warning.
The check can be disabled by setting the enviroment variable
NO_NRF52_BSIM_VERSION_WARNING.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
native_posix is, from some reports, known to not compile
on macOS. Therefore let's better remove the line that says
that in principle it should to avoid missleading users.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This is only a codestyle fix with no functional implications.
A few structures typedefs are removed. The structures are not in
use yet outside of the board code.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fixed a typo in the warning message printed when the user does not
pass any parameters (and therefore does not connect to a BabbleSim
Phy)
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fixed a very unlikely NULL pointer dereference, which could occur
in an error condition, triggered if the test/fake HW timer model
was enabled but there was no registered handler for that timer tick.
The de-reference was in the error message printout.
Fixes#10778
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
To ensure we can always go back in time, let's explicitly list the
NRF52 HW models version which should be used with each version of
the nrf52_bsim board
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Added a new simulated board, which models the NRF52832 SOC.
Its main use is for workstation testing and simulation of
the BLE stack and any application which relies mostly on it.
It uses BabbleSim (http://Babblesim.github.io) for the radio
simulation.
And the NRF52 HW models hosted in that same GitHub organization:
https://github.com/BabbleSim/ext_NRF52_hw_models
For speed it uses the POSIX arch to (not) emulate the CPU.
It uses Vanilla Zephyr, with a couple of configuration differences:
* It uses (like other POSIX arch boards) the system libC
* It does not use the nrfx hosted by Zehpyr in ext/, but the one
provided by the HW models.
Otherwise it relies in the same drivers as the real NRF52 boards.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Remove the links to the now non-existant legacy shell documentation
and clarify a bit paragraphs (as the legacy shell is not default
anymore)
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The peripherals sections grew by adding new peripherals
at the end. Reorder them so they follow a more reasonable
order.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Now, there is quite many more command line options for the
native_posix executable. But, which are available, depends
on the configuration. Therefore let's not list them in the doc,
but instead tell people to use the --help option.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Added a new UART driver for posix arch boards.
The driver can be configured to either attach to a new
pseudo-terminal, or to connect to the invoking shell
stdin-out.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Enable native logger backend for native_posix board in defconfig.
Set also logger configuration options suitable for native_posix
backend.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
For native_posix:
Added command line options to control if traces should have
or not colors.
+
Detect if we are connected to a tty or not, and if we are
set the defaults for that option appropriately
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Move to more generic tracing hooks that can be implemented in different
ways and do not interfere with the kernel.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Fix in command line parsing common functions, to prevent
a possible segfault when handling string type arguments
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
A few function prototypes were missing in the native_posix
board and its drivers.
Let's add them.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
For each driver/model with command line options.
Move its code for the board file into the driver/model file.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Allow command line arguments to be registered dynamically
instead of being statically defined.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Some drivers or tests need to execute some code before Zephyr is
booted, dynamically register command line arguments, etc.
For this purpose, we generalize the NATIVE_EXIT_TASK to also
provide hooks to run a function at a given point during the startup
of native_posix.
Also, test/boards/native_posix/exit_tasks is generalized to cover
this new functionality.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
For native_posix:
Added the option to control the speed of the simualated time vs
the real(host) time.
Added a model of a real time clock with an API.
In the documentation we clarify the relationship between simulated
time and real time, and include documentaion of this new RTC.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Until now, command line options switches which matched the
begining of other options with argumentes needed to be listed
after those. After this fix this is not neccessary anymore.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Let the HW events which would have executed right at the
stop-at time happen, as this produces a more intuitive runtime.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Some of the native application components or drivers need to
do a proper cleanup before the executable exits.
So we provide a macro similar to SYS_INIT but which will be
called just before exiting.
This can be used for freeing up resources, closing descriptors,
or doing any neccessary signaling to any other host process.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Override the C standard used for compilation to C 2011
This is due to some tests using _Static_assert which is a 2011
feature, but otherwise relying on compilers supporting it also
when set to C99.
This was in general ok, but with some host compilers and C
library versions it led to problems. So we override it to 2011
for native_posix board.
Fixes: #8529
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Now that it is possible to easily add Kconfig options from command
line, we do not need to always compile native_posix with coverage.
This was done only to have it set easily for sanity_check.
So do not select it anymore, and let users choose if they
want coverage dumps or not.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Bool symbols implicitly default to 'n'.
A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that for any of the removed properties though.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
native_posix relies on the host C library even if users think
they are selecting one of the lib/libc C libraries.
For the math functions to be available at link time we need
to link to the host math library when building for this board
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fixed the BT_USERCHAN config warning
by setting it only if BT_HCI is selected,
instead of setting it always and relying on it
being set to "no" by not meeting that dependency.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fixed the FAKE_ENTROPY_NATIVE_POSIX config warning
by setting it only if the entropy generator is used,
instead of setting it always and relying on it
being set to "no" by not meeting that dependency.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
For the native_posix board,
added the command line options -rt and -no-rt to control
if the execution should be slowed down to real time or not.
CONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME still works, but
now it just sets a default.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fix in interrupt wrapping for native_posix so it also
supports meta-interrupts.
Related to commit:
3a0cb2d35d
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
New tests rely on irq_offload() actually being based on an
interrupt.
So let's base it on a new SW interrupt.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Introduce a custom HCI driver for the native POSIX port, which opens a
HCI User Channel socket to the Linux kernel to gain access to a local
Bluetooth controller.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Be more obvious about the entropy_native_posix driver
being only a test utility which does not generate real
entropy.
Fixes: #6388
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The zephyr.exe created when building a native POSIX application can take
some parameters that are documented in the "board" document, so add a
reference to that documentation here.
fixes: #6384
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Refer to the samples/net/eth_native_posix sample app
and mention that this driver only works on Linux
with admin rights
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
As the native_posix board has ethernet driver, then enable it by
default if networking is enabled in prj.conf file. This way we can
use generic networking config file when running the application
for native_posix board.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This creates zeth network interface in your host and allows user
to send and receive data sent to this network interface.
Fixes#6007
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Added a basic command line parameter parsing framework
Added the following options by now:
--stop-at=<time>: Auto-stop after <time> seconds
--seed=<seed> : random seed for entropy device
--testargs : any argument that follows is ignored in top level
and made available thru
native_get_test_cmd_line_args()
All command line parameters are still avaliable by calling
native_get_cmd_line_args(), but now you can also call
native_get_test_cmd_line_args() to get whatever was set after
--testargs
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The xtensa-asm2 work included a patch that added nano_internal.h
includes in lots of places that needed to have _Swap defined, because
it had to break a cycle and this no longer got pulled in from the arch
headers.
Unfortunately those new includes created new and more amusing cycles
elsewhere which led to breakage on other platforms.
Break out the _Swap definition (only) into a separate header and use
that instead. Cleaner. Seems not to have any more hidden gotchas.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Bugfix in the tickless mode part:
During _time_idle_exit it was not announcing to the kernel the
already passed silent ticks, but it was left for the tick interrupt
itself.
This did not cause any trouble so far as there was only the timer
interrupt in this board.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Just some exclusions to coverage in code which cannot be
reached, or can only be reached in error conditions
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Added possibility to reconfigure CONFIG_SYS_CLOCK_TICKS_PER_SEC
for the native_posix board (before it could only be 100)
+
Fixed tickless idle support
+
Minor fixes in irq wrapping
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
To avoid indeterministic behaviour of the tests
which leads to changing coverage reports, let's
finish the tests exectuion as soon as they pass
or fail.
Also let's return 0 to the shell if the test passed,
and 1 if it failed.
(Reverting
f9af42f078 and
07c9163f67
)
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Now the native console driver also handles stdin
so we can drive the shell from the command line,
a pipe or a file
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
rename main_clean_up() to posix_exit() for consistency
with all other global functions of this architecture
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Corrected the board name in the configuration short
description string. It was the old Simple_process name which was
replaced with native_posix
Corrected also the comment/title in the "Board Options" menu
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The native SOC Kconfig file was still referring to the old
configuration option SOC_INF_CLOCK which was replaced with
SOC_POSIX.
This produced a warning on configuration which is now fixed
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
To get coverage data from all samples and tests, enable this by default.
Right now we only get coverage data from tests, however many samples we
currently have can run natively and can generate more coverage and
testing.
This should be removed once we have tests provide better coverage.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Quite a lot of improvements in the native_posix board
documentation:
* Added TOC
* Reordered
* Given much more emphasis to its limitation
* Added subsection explaining how to overcome some of these
limitations
* Added rationale section
* Added section comparing this port with QEMU and ISSs
* Corrected build example (this port cannot be compiled on
Windows, regression from commit
e62ee6ab3c )
* Added note about it not working on W10 WSL (#5762)
* Several other minor fixes
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
For tests (CONFIG_TESTS) do not slow down the execution
to real time.
For samples, we assume they are interactive and therefore it is
still preferred to run them at real time.
This speeds up the native_posix part of sanitycheck
by ~50% (more the faster the computer)
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
* Added a figure explaining how layering of the posix arch
compares to the embedded builds
* One minor grammar change in last paragraph
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The native_posix board will accept command line arguments
which the application / test may pick by calling
native_get_cmd_line_args()
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Native port now adds .exe to the generated ELF
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Right now we are hardcoded to only qemu, with the native port, we make
this more generic and support this in a plugin mode where a running has
its own cmake definitons implementing the various targets.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>