Commit graph

99553 commits

Author SHA1 Message Date
Anas Nashif
a3abe967d6 sanitycheck: do not count duplicate tests
Some tests are being reused to reset or re-init state, ignore them in
accounting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
a279403c47 tests: remove dot after PASS|FAIL
That dot does not belong here, just stands in the way when parsing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
37f9dc5c2d sanitycheck: simplify argument passing and use global options
We are passing global arguments from one level to the next when those
variables are available globally. Reduce the arguments and remove unused
arguments as well.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
d3384fb71c sanitycheck: cleanup handler class
init class in one place, no need to duplicate all class members in every
subclass.
run_log is not needed in the handler class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
e0a6a0b692 sanitycheck: parse test results and create detailed report
Parse the test results and create a test report with more granular
results that can be imported to into test management/reporting system.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
73440ead7d sanitycheck: device handler, allow running tests on real hw
This will allow us to run sanitycheck on real devices and get reporting
out of it the same way we do that with Qemu.

To use this, run sanitycheck with the following new options:

 scripts/sanitycheck --device-testing --device-serial /dev/ttyACM0 -p
 frdm_k64f  -T tests/crypto/

--device-serial denotes the serial device the board is connected to.
This needs to be accessible by the user running sanitycheck. You can
run this on one board only at a time, the board is specified using the
--platform option.

This was tested with only a few boards, some board will not work
because how they reset the serial device during flashing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Ulf Magnusson
547ed9b563 kconfig: Make 'source' non-globbing and use 'gsource'
Until now, Zephyr has used a patched Kconfiglib that turns 'source' into
a globbing source (by replacing 'source' with 'gsource' at the token
level). There's two problems with this:

  - The patch needs to be maintained separately

  - Misspelled filenames are silently ignored, as they look like glob
    patterns that don't match anything

Fix it as follows:

  1. Replace all 'source' statements that use wildcards with 'gsource'

  2. Remove the custom Kconfiglib patch so that 'source' no longer globs

The sed pattern '/source.*[*?]/s/source/gsource/' was run over all
Kconfig* files to do the replacement.

source's that use environment variables that might contain glob patterns
were manually changed to gsource.

Building the docs in doc/ is a good test, as doc/Makefile deliberately
sets the environment variables to glob up as many Kconfig files as
possible.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-08 11:14:12 +02:00
Andrew Boie
5dc2ab4f47 ti_adc108s102: validate num_entries
num_entries can be as large as 255. However, based on the
_ti_adc108s102 implementation, num_entries must be less than
ADC108S102_CMD_BUFFER_SIZE or the cmd_buffer[] and
sampling_buffer[] arrays in the data struct could overflow.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-07 22:27:28 -04:00
Andrew Boie
97ccf99b9b ti_adc108s102: fix verification off-by-one
Channel IDs start at 0, need to fail if the provided ID
equals ADC108S102_CHANNELS, not just larger than it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-07 22:27:28 -04:00
Andrew Boie
a0c3aadde4 uart_qmsi: fix possible divide-by-zero
The line control value could result in a baud divisor of zero.
Check this condition and return -EINVAL if that is the case.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-07 22:25:48 -04:00
Andrew Boie
a4208365f2 pinmux: remove user mode access
The pinmux subsystem does not have any API documenation. Currently
none of the existing pinmux drivers do any kind of input validation
for the pin/op parameters, which has been shown to allow the caller
to access unauthorized memory, up to and including disabling the
MPU.

This requires a proper specification for the pinmux subsystem and
also modification of existingd drivers to validate arguments on a per
driver basis. Remove user mode access until #7390 is resolved.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-07 22:20:20 -04:00
Ulf Magnusson
ac7f223956 kconfig: Mention that checkconfig.py lacks Kconfiglib 2 support
This script has not been updated for Kconfiglib 2. Add a comment to it
that mentions it.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
11952a60bf kconfig: Remove the C Kconfig implementation
Remove the C Kconfig tools and various scripts associated with them.

scripts/kconfig/diffconfig is popular, so keep it.

I don't know whether anyone is using scripts/kconfig/config. Remove it
and see if anyone screams.

scripts/kconfig/streamline_config.pl deals with modules ('m' values) and
can safely be removed. Zephyr's Kconfig files do not use modules.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
890a5a5aa1 kconfig: Remove targets specific to the C implementation
They will no longer be available once the C Kconfig implementation is
removed.

oldconfig and allno/yesconfig implementations are available for
kconfiglib and could be added later if needed. savedefconfig (minimal
configuration generation) is available from the menuconfig.py
configuration interface.

cmake/usage/kconfig-usage.cmake becomes kinda pointless after this
change, so merge it into cmake/usage/usage.cmake.

Remove the kconfig_target, COMMAND_FOR_*, and COMMAND_RUNS_ON_WIN_*
CMake variables, as there's just the 'menuconfig' target now.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
133bad7899 scripts: install windows-curses package on Windows
The new menuconfig implementation needs it when run on Windows.

Use an environment marker to only install windows-curses on Windows. See
https://www.python.org/dev/peps/pep-0508/#id23.

From some googling, sys_platform might be more widely supported than
platform_system, so use that.

Suggested-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
418cc0eafe doc: Update for menuconfig.py
Update the Application Development Primer to describe the new menuconfig
configuration interface:

 - Update the section explaining how the configuration is navigated,
   changed, and saved

 - Add a section explaining how to jump directly to a symbol in the
   configuration interface

 - Replace mconf screenshots with menuconfig.py screenshots. Remove some
   screenshots that are no longer used.

 - Remove the section explaining how to load arbitrary .config files
   from within the configuration interface. That feature hasn't been
   implemented yet in menuconfig.py.

 - Do various minor language cleanup

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
7229a9a560 scripts: kconfig: Switch 'menuconfig' over to menuconfig.py
Make 'make/ninja menuconfig' run menuconfig.py instead of mconf from the
C Kconfig tools. Get rid of the 'pymenuconfig' target.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
b737fcb9ba scripts: kconfig: Add incremental search to menuconfig
Pressing [/] brings up a dialog with an edit box where a regex can be
entered. The list of matching symbols is always shown below it.
Selecting a symbol and pressing [Enter] jumps directly to it in the menu
tree. If the symbol is invisible, show-all mode is turned on
automatically.

This commit also includes a bunch of more-or-less unrelated changes from
poking around with the code:

  - Some redundant styles were merged. Probably wouldn't want to have a
    different style for each separator line, for example...

  - [ESC] in the top menu now works like [Q]

  - Returning to a parent menu now makes sure that the selected row is
    visible, even if the terminal was shrunk between entering the child
    menu and leaving it.

  - A _max_scroll() helper was factored out to reduce code duplication.
    It takes a list of items and a window in which the list is
    displayed, with one row per item, and returns the minimum scroll
    value that will make the final item visible.

  - The save dialog now pops up a message to confirm that the save was
    successful.

  - Lots of minor code nits all over (renamings, etc.)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Anas Nashif
def4a4c152 CODEOWNERS: more fix and and updates
Change some entries where path has changed, remove obsolete entries.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:37 -04:00
Anas Nashif
d9ff55f2e3 CODEOWNERS: add more owners to tests/*
Add more people to tests/* to get more reviews and to get notified when
tests/* change.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:37 -04:00
Anas Nashif
7a6f7136bb doc: process test documentation
Also parse test documentation. When add tests to doxygen, we get
warnings about device.h macros not being defined. Exclude this now and
track this in issue #7367.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
c44f4e0ee5 tests: alert: add doxygen documentation
Add doxygen comments to test functions.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
c57326e1b6 tests: fix doxygen comments
Fix many warnings resulting from doxygen comments in tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
540e11ced7 tests: rename main test to main.c
For many tests, avoid splitting into files and put eveything in main.c.
For many of the tests, use main.c as the test source file to keep things
consistent.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
bc672895ba tests: remove duplicate tests
Remove a few duplicates and avoid calling tests multiple times for
setup/teardown.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
fa0a670dea tests: integration: do not run test on hw
This is is just sample for integration tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
8603f7a4ce tests: flash_map: use proper test name
Use a meaningful name for the test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
ee6b8761cd tests: ipv6: convert to ztest
Use ztest instead of custom routine to iterate over tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
478f6807a4 tests: http: call tests via ztest macro
Move tests to be ztest items instead of calling them directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
efb52c5bc0 tests: neighbor: use ztest asserts
Use ztest macro and convert to ztest proper.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Anas Nashif
93109f2d8e tests: enhance test meta-data/improve test naming
Enhance the test meta-data and test names. This will is needed for
better and consistent reporting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
qianfan Zhao
81bac40b79 gitignore: let git ignore *.patch file only to top tree
add '/*.patch' to .gitignore

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-05-06 22:22:53 -04:00
Paul Sokolovsky
a85321229a newlib: libc-hooks: Print "exit" message with newline
Calling POSIX exit() function in Zephyr w/newlib leads to printing
"exit" to stdout followed by infinite loop. That message was
printed without a newline though, leading to confusing artifacts
in the console output.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-05 20:13:46 -04:00
d1bd3a6fe7 dma: define and document the source and dest adjust enum.
This is used in #6306 to make the driver more readable.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-05-05 00:58:42 -04:00
Paras Jain
12c5bfaf14 tests : ipv6_fragment : Avoid NULL pointer access
Assign the pointer only when it is not NULL.
Coverity-CID: 185397

Signed-off-by: Paras Jain <parasjain2000@gmail.com>
2018-05-05 00:39:48 -04:00
Ioannis Glaropoulos
8d1b013f3c arch: arm: thread built-in stack guard implementation
This commit activates the built-in stack guard on the main_thread
before jumping to it upon system initialization. Stack guard is
activated if BUILTIN_STACK_GUARD is enabled by the user. The
commit also activates built-in thread stack guards at every
context switch, if BUILTIN_STACK_GUARD enabled by the user.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-05-04 17:26:57 -04:00
Ioannis Glaropoulos
91dc3bd0f9 arch: arm: ignore stack pointer limit checks during HF and NMI
Ignore stack pointer limit checking during a HardFault or NMI
exception, to allow for the Fault handling function to execute
properly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-05-04 17:26:57 -04:00
Ioannis Glaropoulos
4a41f42e73 arch: arm: set interrupt stack protection with MSPLIM
This commit implements the build-in interrupt stack protection
via the native MSPLIM register in ARMv8-M MCUs that support the
Main Extension. Main stack pointer overflows will cause Stack
Overflow UsageFaults. In addition, the commit introduces a new
config option, BUILTIN_STACK_GUARD, allowing the user to enable
and use the built-in stack protection in ARMv8-M firmware.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-05-04 17:26:57 -04:00
Johan Hedberg
a29554360a Bluetooth: shell: Add settings support
Enable settings and increase the system workqueue size to deal with
the stack usage. This also makes it possible to test unpairing support
with the shell's 'clear' command.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Johan Hedberg
6af5d1cd1f Bluetooth: Compress bt_keys struct
There's a bit of unnecessary space in the bt_keys struct. Re-design
some fields for a more compact format, which is particularly helpful
now that the struct gets stored as-is to flash through the settings
API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Johan Hedberg
f36ea83628 Bluetooth: Add support for persistent pairing keys storage
Integrate the bt_keys submodule with bt_settings. Add a new
bt_keys_store() API to write keys to flash, and extend the existing
bt_keys_clear() to remove the keys from flash.

Along with this, add some helpers for genrating settings key values
containing a bluetooth address, as well as for decoding them to get
the binary bt_addr_le_t.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Johan Hedberg
470349c25a Bluetooth: settings: Add support for per-submodule handlers
Add a new linker section for a list of submodule settings handlers,
and iterate the list from the various settings callbacks.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Johan Hedberg
d22b7c9f2d Bluetooth: Remove bt_storage API
The same functionality is now supported by the settings-based
solution, so remove bt_storage out of the way. There were stubs in
bt_storage to handle per-peer information (e.g. pairing keys) but this
was never actually implemented in full. The next step is to add this
support to the settings-based solution.

Leave the code for generating temporary IRK and identity address in
case BT_SETTINGS is not enabled. Also leave the code for using vendor
HCI to read the identity address, in which case the settings
implementation will not touch it.

Introduce a new bt_unpair() API to replace the removed
bt_storage_clear(), since the latter was actually doing more than just
storage management: it was also handling runtime storage of pairing
information. Later, the bt_unpair() implementation will be extended to
clear settings-based pairing storage.

There is one feature that the bt shell module looses: the ability to
give a specific identity address to the "init" command as a parameter.
We might look later in the future if this is really needed, and add a
separate API for this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Johan Hedberg
b997a283f7 Bluetooth: Introduce skeleton for settings-based storage
Introduce a basic skeleton for peristent storage based on the settings
subsystem. Also enable support for this to the peripheral sample
application, so the new code gets exersized by CI. For now, the
implementation provides the same level support as the bt_storage API
ever did, i.e. for the identity address and the IRK.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Andrzej Puzdrowski
f4dcb4593d subsys: fs: fcb: fix - crc write size not aligned
This is bug-fix for issue #7311
FCB: CRC write size in append_finish doesn't honor
flash min write size

This patch changes write size to the minimum supported
write size.


Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-05-04 17:25:29 -04:00
Sebastian Bøe
60b01f3f54 kconfig: Refactor kconfig.py to use __main__ and argparse
Kconfig.py is not following the de-facto (real?) coding standards of
Zephyr. This commit refactors kconfig.py with two changes:

Use __main__ and def main().

Use argparse instead of sys.argv.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-05-04 17:25:14 -04:00
Andrzej Puzdrowski
4388f6f314 boards/arm/nrf52_blenano2: add storage flash partition
This patch adds DT description of generic storage flash
partition. This fixes issue #7227.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-05-04 15:37:46 -05:00
Manivannan Sadhasivam
26babfc622 drivers: led: Add system call handler support
Add system call handler support to LED subsystem. No buffers are
involved in any of the API's and hence the syscall support is
straightforward.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-05-04 10:07:39 -07:00
Andrzej Puzdrowski
4954fe06f2 subsys: fs: fix generic storage partition selection
FS_FLASH_MAP_STORAGE keyword enables the storage partition,
but it was depend on flash_map module which is unused by
NFFS. This patch makes it independent thanks
to it is possible to enable the storage partition
without flash_map module.

FS_FLASH_MAP_STORAGE was renamed to
CONFIG_FS_FLASH_STORAGE_PARTITION
as it is independent for flash_map.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-05-04 10:14:01 -04:00
Jukka Rissanen
af8a0b1a5d net: tc: Proper packet priority to traffic class mapping
The IEEE 802.1Q chapter I.3 contains a proper network packet
priority to traffic class mapping. The original mapping was
clearly incorrect.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-04 11:06:43 +03:00