Commit graph

195 commits

Author SHA1 Message Date
Alberto Escolar Piedras
2cd70e6f1b coverage: Bugfix: Missing coverage in nrf52_bsim
In #9717, 777407b9ea
coverage support was broken for all NATIVE_APPLICATION except
native_posix
This includes the nrf52_bsim board
Fix it.

Fixes: #13009

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-02-03 10:42:24 -05:00
Andrei Emeltchenko
45d5340221 native_posix: Enable native posix USB driver if USB enabled
Enables native_posix USB virtual driver when USB is selected.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-01 19:03:12 -05:00
François Delawarde
4fac841869 debug: CTF Tracing with POSIX backend
This commit implements a CTF-backend for Zephyr's tracing API.
The CTF-backend itself is split in a middle-layer and a bottom-layer.
- Middle-layer decides the payload in event transactions,
- Bottom-layer implements the IO transport.

A simple POSIX bottom-layer is provided so far.

Signed-off-by: François Delawarde <fnde@oticon.com>
2019-02-01 08:56:02 -05:00
Krzysztof Chruscinski
1d9e5ee108 logging: Refactoring 'in place' mode to reduce memory footprint
Changed 'in place' mode to bypass logger system and directly
call active backends. With this approach memory footprint of
the logger can be significantly reduced in terms of RAM and ROM.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-29 17:24:37 +01:00
Alberto Escolar Piedras
f7b0398e7e nrf52_bsim: Fix copy pasted comment
A comment which had been copied straight from the native_posix
board refered to the nrf52_bsim board as native_posix,
which it is not, and may confuse users.
Fix it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-26 08:46:53 -05:00
Anas Nashif
4fa0f7bc58 doc: move shell API documentation
Move API reference to where the logger is being documented.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Alberto Escolar Piedras
d5b691adba nrf52_bsim: Update to support incoming changes to clock driver
Incoming updates to the nRF clock driver require some extra enum
definitions from the nRFx HAL which were not available in HW
model versions before 1.4 => update it.
Also as the nrf52_bsim does not yet support DTS, include a define
for the clock IRQ interrupt number (as the new clock driver will
be using the DTS macro instead of the nRF MDK value.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-19 07:09:38 -05:00
Alberto Escolar Piedras
acefd36501 native_posix: Remove all references to the defunct legacy shell
Remove all references in the documentation and Kconfig options
to the legacy shell to avoid confusing users and developers

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-18 18:25:05 -05:00
Adithya Baglody
777407b9ea gcov: Add coverage supported boards.
Not all boards can get the coverage reports. The report generation
needs minimum of 64KB SRAM. This patch added support for mps2_an385,
qemu_cortex_m3, qemu_x86. This is just a subset. Also the previously
supported board native_posix is included in this patch.

If a board has 64KB RAM, it can generate reports by just
adding HAS_COVERAGE_SUPPORT in Kconfig.board.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2019-01-16 06:12:33 -05:00
Ioannis Glaropoulos
302a746bd6 drivers: clock control: nrf: rename CLOCK_CONTROL_NRF5 Kconfig symbol
This commit renames the CLOCK_CONTROL_NRF5 Kconfig symbol to
CLOCK_CONTROL_NRF. The change is required to aleviates confusion
when selecting the symbol in nRF9160 SOC definition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-15 18:03:24 +01:00
Alberto Escolar Piedras
aefc072afb nrf52_bsim: Improve compile time check of HW models version
In 4940a3cac2 a compile time
check of the HW model version was added. This check worked
fine for cases in which the problem was that people had not
fetched a new enough version of the HW models.
But in some cases people will have fetched a new enough version
but be (unknowingly) in a past detached HEAD (or old tag).

With this change we ensure that the required tag is an actual
ancestor for the current HW models version HEAD

Also fail with an error, instead of just printing a warning.
Users can still disable this warning if they know what they are
doing.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-08 10:59:57 -05:00
Alberto Escolar Piedras
ce12abd9e4 nrf52_bsim: Add support for dynamically registering cmd line args
With this change, drivers or components can register on runtime
their own command line arguments.
What this change does is to use the dynamic command line arguments
API from BabbleSim's libUtil and provides a function for the
drivers to add their own.

Note that this change requires v1.3 of the HW models (which remove
a dependency on the board command line arguments structure)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-07 10:27:09 -05:00
Alberto Escolar Piedras
f57bc1cae0 nrf52_bsim: arg parsing: Do not use bs_args_typical_dev_post_check
This function can only be used when the arguments structure memory
layout starts as in bs_basic_dev_args_t.
This assumption is just too dangerous in this board as somebody
may change the structure in the future unaware of this weird
requirement.
=> Do not use this function but do what it does in place.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-07 10:27:09 -05:00
Alberto Escolar Piedras
592d26bb3a nrf52_bsim: arg parsing: Be more user friendly with -nosim
When the -nosim option is used the user may still want to set
either the simulation ID string (-s) or the device number (-d)
to control the tracing prefixes and/or dump folder, but may not
care to set both of them.
=> This change allows it, while the old behaviour is otherwise
maintained (setting both or none with -nosim)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-07 10:27:09 -05:00
Jan Van Winkel
6cb629c35b driver: SDL based display emulation driver
This driver introduces an emulated LCD display for the native POSIX
board. The emulated display driver makes use of SDL2 to render the
displays frame buffer into a dedicated desktop window.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 20:37:29 -05:00
Alberto Escolar Piedras
6e0f367396 nrf52_bsim: Require v1.2 of the HW models
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>
2018-12-06 09:14:38 -05:00
Patrik Flykt
25e8e4d4e7 boards: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Andrew Boie
42cfd4ff26 kernel: expose k_busy_wait() to user mode
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>
2018-11-15 16:20:36 -05:00
Kumar Gala
758d5b14a9 boards: Remove board.h from boards that don't need it
These boards don't need board.h to work so remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-14 06:44:02 -06:00
Ulf Magnusson
4638652214 Kconfig: Use 'default' instead of 'def_bool' in Kconfig.defconfig files
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>
2018-11-13 16:04:01 -05:00
Alberto Escolar Piedras
5b5bd09d5b nrf52_bsim: Support full include paths of nrfx hal files
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>
2018-11-10 09:11:02 -05:00
David B. Kinder
babc199545 doc: fix misspellings in docs
Scan and fix for misspellings missed during regular
reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-11-02 20:10:20 -04:00
Alberto Escolar Piedras
4940a3cac2 nrf52_bsim: Add compile time check of HW models version
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>
2018-11-01 09:13:42 -04:00
Alberto Escolar Piedras
ec1cb2947c native_posix doc: Remove possible macOS support note
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>
2018-10-31 12:04:56 -07:00
Alberto Escolar Piedras
d7f6067904 nrf52_bsim: Codestyle fix
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>
2018-10-24 15:57:05 +01:00
Alberto Escolar Piedras
3f65164ad1 nrf52_bsim: Fix typo in warning message
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>
2018-10-24 11:12:49 +01:00
Alberto Escolar Piedras
b3ea738a84 nrf52_bsim: Fix possible NULL pointer dereference
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>
2018-10-23 17:33:34 +01:00
Anas Nashif
1e5b3b490c nrf52_bsim: declare BSIM_OUT_PATH as required env var
Do not use with sanitycheck if BSIM_OUT_PATH is not defined.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-19 10:57:54 -04:00
Alberto Escolar Piedras
1c6674a96d nrf52_bsim: Explicitly list the applicable HW models version
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>
2018-10-15 09:36:37 -04:00
Alberto Escolar Piedras
ceaa46d07b new simulated board: nrf52_bsim
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>
2018-10-15 09:36:37 -04:00
Alberto Escolar Piedras
4ebf2afeb3 native_posix: doc: Remove legacy shell links
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>
2018-10-02 14:04:22 -07:00
Alberto Escolar Piedras
24abcf8094 native: doc: Improve UART documentation
Some minor improvements in the UART documentation.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-10-02 14:04:22 -07:00
Alberto Escolar Piedras
7aabc36d42 native_posix: doc: reorder peripherals section
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>
2018-10-02 14:04:22 -07:00
Alberto Escolar Piedras
bdd20467e2 native_posix: doc: do not list command line options in doc
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>
2018-10-02 14:04:22 -07:00
Alberto Escolar Piedras
013f279111 uart: Add driver for posix arch
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>
2018-09-27 17:24:34 +02:00
Andrei Emeltchenko
b47e37c792 native_posix: Add logger configuration backend
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>
2018-09-18 14:56:10 +02:00
Alberto Escolar Piedras
ba5476a2a0 native_posix: Add control of traces color
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>
2018-09-18 14:56:10 +02:00
Flavio Ceolin
67ca176754 headers: Fix headers across the project
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>
2018-09-17 15:49:26 -04:00
Flavio Ceolin
5884c7f54b kernel: Explicitly ignoring _Swap return
Ignoring _Swap return where there is no treatment or nothing to do.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Anas Nashif
a2248782a2 kernel: event_logger: remove kernel_event_logger
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>
2018-08-21 05:45:47 -07:00
Alberto Escolar Piedras
3ac2dc920e native_posix: Minor fix in message printed on kill
The message which was printed when killing the process was not
correct. Fixed it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-08-20 17:49:18 -07:00
Alberto Escolar Piedras
e861661c11 native_posix: argparsing: Fix possible segfault
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>
2018-08-20 17:49:18 -07:00
Alberto Escolar Piedras
00b07615fa native_posix: Add missing headers and function prototypes
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>
2018-08-02 19:14:19 +02:00
Alberto Escolar Piedras
a76fa45e4a native_posix: minor doc fixes
A few minor fixes in the native_posix documentation.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-08-01 12:13:20 -07:00
Alberto Escolar Piedras
55f6620c3e native_posix: Refactor cmd line options
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>
2018-07-30 22:13:46 -04:00
Alberto Escolar Piedras
f742d0e2a2 native: Allow cmd line options to be registered dynamically
Allow command line arguments to be registered dynamically
instead of being statically defined.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-30 22:13:46 -04:00
Alberto Escolar Piedras
550225b668 native: Generalize native tasks
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>
2018-07-30 22:13:46 -04:00
Alberto Escolar Piedras
5cc928fbd4 native_posix: Add realtime control and real time clok model
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>
2018-07-24 22:59:07 -04:00
Alberto Escolar Piedras
ba45d54bf9 native_posix: command line parsing fix
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>
2018-07-24 22:59:07 -04:00
Alberto Escolar Piedras
362e5ddb6b native_posix: Be more precise with stop-at
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>
2018-07-24 22:59:07 -04:00
Alberto Escolar Piedras
15d847add8 native: Add NATIVE_EXIT_TASK hooks
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>
2018-07-18 15:43:12 -04:00
Alberto Escolar Piedras
0a5de7df71 native_posix: override C standard version to 2011
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>
2018-07-05 12:55:07 -04:00
Alberto Escolar Piedras
e1af33b428 doc: native_posix: Add paragraph about ASan
Added one paragraph about having the option to use
Address Sanitizer and how to use it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-04 15:11:20 -04:00
Alberto Escolar Piedras
bdab07a2fd native_posix: Do not select COVERAGE by default
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>
2018-07-03 08:36:06 -04:00
Ulf Magnusson
fb0366b339 boards: Kconfig: Remove redundant 'default n' properties
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>
2018-06-27 17:15:31 -05:00
Alberto Escolar Piedras
985f43e38b native_posix: Let users use math functions
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>
2018-06-23 00:39:08 -04:00
Alberto Escolar Piedras
ebbb744b03 native: Fix host BT driver kconfig warning
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>
2018-06-13 18:48:26 +02:00
Alberto Escolar Piedras
3a87e0ed05 native: Fix entropy generator kconfig warning
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>
2018-06-13 18:48:26 +02:00
Alberto Escolar Piedras
477b5497a7 native: Add command line options to control real timeness
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>
2018-06-11 17:29:27 -04:00
Alberto Escolar Piedras
2e405fbc6d native_posix & kernel: Remove legacy preemption checking
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>
2018-06-11 17:25:58 -04:00
Alberto Escolar Piedras
a7de06a687 native_posix: irq_offload to use a sw interrupt
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>
2018-06-11 17:25:58 -04:00
Johan Hedberg
7d9896575b Bluetooth: Add HCI User Channel driver for native POSIX port
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>
2018-06-11 17:14:43 -04:00
Alberto Escolar Piedras
29ed87c930 native: entropy: warn of security risk
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>
2018-05-17 07:51:00 +03:00
David B. Kinder
9af44d8256 doc: add native posix command line help
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>
2018-05-14 17:24:03 -04:00
Anas Nashif
ea9a345182 boards: native_posix: mark netif as supported
To be able to run many networking tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Alberto Escolar Piedras
9782755a55 native doc: minor improvement in ethernet driver
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>
2018-04-04 15:30:07 -04:00
Jukka Rissanen
22399c327e drivers: eth: native_posix: Enable ethernet by default if needed
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>
2018-04-03 17:47:53 -04:00
Jukka Rissanen
0f66426f4a drivers: eth: Add ethernet driver for native posix arch
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>
2018-03-18 20:47:36 -04:00
Alberto Escolar Piedras
19e3500f24 native: doc: command line related improvements
A few new additions in the documenation regarding the
command line options

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-03-02 07:10:39 +01:00
Alberto Escolar Piedras
30ae79ae39 native: added entropy device
Added pseudorandom entropy device for the native_posix board

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-23 07:34:07 -05:00
Alberto Escolar Piedras
f004e0475e native: added more proper command line parameters parsing
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>
2018-02-23 07:33:11 -05:00
Andy Ross
9c62cc677d kernel: Add kswap.h header to unbreak cycles
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>
2018-02-16 10:44:29 -05:00
Alberto Escolar Piedras
6c483ead26 native: timer bugfix in tickless mode part
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>
2018-02-08 15:56:48 -08:00
Alberto Escolar Piedras
3b924ede3e native: coverage exclusions
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>
2018-02-07 16:28:16 -05:00
Alberto Escolar Piedras
66c1652fb8 native: native_posix timer + irq fix
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>
2018-02-07 16:28:16 -05:00
Alberto Escolar Piedras
a99a14c3b7 native: added posix_get_hw_cycle()
Added function (for all ARCH_POSIX boards) to get the
the current clock cycle of the CPU

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-07 16:28:16 -05:00
Alberto Escolar Piedras
1e46d39068 native test: End tests as soon as they pass fail
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
f9af42f078c93eca8b9f461f91b6cafddb57a35d and
07c9163f67
)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-05 06:26:53 -08:00
Alberto Escolar Piedras
0e1c6e1f59 native: doc: typo in figure
Corrected a typo in native_posix's architecture figure

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-02 07:48:46 -08:00
Alberto Escolar Piedras
e3f727cc6e native: added stdin handling for shell
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>
2018-02-02 07:48:46 -08:00
David B. Kinder
701bb2afba doc: fix misspellings in boards and samples docs
Fix misspellings found in board and sample docs missed during regular
reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-01-30 20:27:43 -05:00
Alberto Escolar Piedras
abd54484fc native: doc fix regarding ztest not stopping
Tests using ztest do not stop anymore since commit
07c9163f67
=> fixed documentation

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-01-29 23:23:56 -05:00
Alberto Escolar Piedras
a35364dd1a native: minor consistency rename
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>
2018-01-29 23:23:56 -05:00
Alberto Escolar Piedras
cf81893344 native: Corrected board name in config short description
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>
2018-01-25 18:54:26 +05:30
Alberto Escolar Piedras
dd968b97ea native: fixed configuration warning
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>
2018-01-25 18:54:26 +05:30
Anas Nashif
2fd36fac81 native_posix: enable coverage by default
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>
2018-01-25 04:45:35 +05:30
Alberto Escolar Piedras
2eab036233 native: documentation improvements
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>
2018-01-25 04:44:36 +05:30
Alberto Escolar Piedras
a9ae315f07 native: don't slow down tests
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>
2018-01-24 06:51:22 +05:30
David B. Kinder
fd04de2d10 doc: fix misspellings in Kconfig files
periodic scan for typos missed during normal reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-01-12 20:58:56 -05:00
Alberto Escolar Piedras
5aa0d88b58 native: native_posix doc improvements
* 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>
2018-01-11 19:02:07 -05:00
Alberto Escolar Piedras
66a1454ce6 native: Accept command line arguments
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>
2018-01-11 18:02:54 -05:00
Alberto Escolar Piedras
e04764dbc7 native: Handle gracefully SIGTERM and SIGINT
When SIGTERM or SIGINT are received handle them
by gracefully exiting the program.

Fixes #5477

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-01-02 15:26:34 -05:00
Sebastian Bøe
b3dbfb9986 posix: ld: Don't print memory usage
Don't print memory usage, the results are not meaningful for posix
boards.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-28 11:24:21 -05:00
Anas Nashif
6ca6edcca1 native: build .exe files for posix arch
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>
2017-12-27 14:16:08 -05:00
Anas Nashif
c15d3c9126 cmake: support other emulation platforms/runners
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>
2017-12-27 14:16:08 -05:00
Anas Nashif
6b55598ad4 board: posix: add native_posix board definition
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-27 14:16:08 -05:00