Commit graph

374 commits

Author SHA1 Message Date
Anas Nashif 656f4dfdac cleanup: include/: move fs.h to fs/fs.h
move fs.h to fs/fs.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 83508a5677 cleanup: include/: move flash_map.h to storage/flash_map.h
move flash_map.h to storage/flash_map.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Johann Fischer abaeaed2af usb: sort usb config data by section
USBD_CFG_DATA_DEFINE macro has not consider that a class
could have more than one set of usb_cfg_data struct.
If a class has more than one set of usb_cfg_data
then they should be sorted the same way like by
USBD_DEVICE_DESCR_DEFINE macro.

Fixes: #16240

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-27 12:18:05 +02:00
Charles E. Youse ca4910827b boards/x86/quark_d2000_crb: drop support for Quark D2000 dev board
Remove the board directory as well as references in tests and samples.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Nicolas Pitre 1fd379da44 log_msg test: rework test_log_std_msg() to better cope with 64-bit builds
Remove #ifdef's and use a loop to avoid duplicating the code.

Suggested by Krzysztof Chruscinski.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-24 08:58:52 +02:00
Nicolas Pitre 6987937582 log facility: make its records 64-bit compatible
Log records may store either data or pointers to more records. In both
cases they must have the same size. With 64-bit pointers, the amount
of data that can occupy the same space as a pointer has to be adjusted.
And storage alignment has to accommodate actual pointers not u32_t.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-24 08:58:52 +02:00
Nicolas Pitre 0567f161d8 log facility: make its arguments 64-bit compatible
Log arguments were hardcoded to u32_t values. On 64-bit systems, this
is rather restrictive. To make things clear, arguments now have their
own type, log_arg_t, which now can be adjusted in only one location
if need be.  It is currently defined as unsigned long whose effective
width is equivalent to u32_t on 32-bit systems, and u64_t on 64-bit
systems.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-24 08:58:52 +02:00
Marc Herbert 3f9151dae6 tests: minor FCB re-ordering not to leave a random flash.bin behind
The last FCB test to run (fcb_test_last_of_n) uses uninitialized
test_data[] and leaves behind a flash.bin with random content. Pick
another one (fcb_test_reset) that leaves a deterministic flash.bin
behind and run that last instead.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-06-21 13:44:40 +02:00
Anas Nashif f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34:13 -05:00
Ulf Magnusson eba81c6e54 yaml: Remove redundant document separators
YAML document separators are needed e.g. when doing

  $ cat doc1.yaml doc2.yaml | <parser>

For the bindings, we never parse concatenated documents. Assume we don't
for any other .yaml files either.

Having document separators in e.g. base.yaml makes !include a bit
confusing, since the !included files are merged and not separate
documents (the merging is done in Python code though, so it makes no
difference for behavior).

The replacement was done with

    $ git ls-files '*.yaml' | \
        xargs sed -i -e '${/\s*\.\.\.\s*/d;}' -e 's/^\s*---\s*$//'

First pattern removes ... at the end of files, second pattern clears a
line with a lone --- on it.

Some redundant blank lines at the end of files were cleared with

    $ git ls-files '*.yaml' | xargs sed -i '${/^\s*$/d}'

This is more about making sure people can understand why every part of a
binding is there than about removing some text.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-19 10:40:10 +02:00
Laczen JMS 36edf92ca8 subsys/settings: change processing to const char
The settings module processes the variable name by splitting it up in
a set of variables. This PR removes the splitting up and keeps the
variable name as one string.

It is an alternative to #16609

The possibility is introduced to register handler including a
separator, or to register a handler for each variable.

The ability is introduced to load a subtree from flash or even to load
a single item.

Two ways to operate on variable and settings_handler names are provided:

settings_name_steq(const char *name, const char *key, const char **next)
which checks if name starts with key, returns 1/0 if it does/does not
the remaining part of name is in next.

settings_name_split(const char *name, char *argv, const char **next)
which splits up name in a part before "/"" that is found in argv and
the remaining part that is in next.

A mutex is added to make settings thread-safe

The settings_handlers list is stored in reverse alphabetical order, this
allows registration of e.g. bt and bt/mesh in separate handlers, the bt
handler itself should not contain any handling of bt/mesh.

A settings_deregister() method is added. Settings_handlers can now be
added/removed when required. This saves RAM when settings_handlers are
not needed.

Tests have been updated to reflect changes in the settings api.

Updates after meeting:
1. Removed settings_deregister

2. Changed settings_name_split() in settings_name_next:

int settings_name_next(const char *name, const char **next): returns
the number of characters before the first separator. This can then be
used to read the correct number of characters from name using strncpy
for processing.

3. New functional test added

Update in settings.h: settings_name_next() changed position -> index

Added some comments in settings.h (settings_name_steq())

Updated tests to reflect change to settings_name_next() and pointer
value comparison. The functional test can now also run on qemu_x86.

Corrected some documentation in header.

Changed registration of handlers to be non ordered.

Changed handler lookup to handle non ordered list of handlers, this
improves handler matching in case different length names are compared
and also makes it easier to add rom based handlers as they will not be
ordered.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-06-18 17:57:08 +02:00
Anas Nashif 2fb19fcbdd style: samples/tests: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Henrik Brix Andersen fd3d4156d6 tests: flash_map: configure MPU to allow flash writes on twr_ke18f
Configure the NXP MPU to allow flash writes when running the flash_map
test.

This fixes #16224.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-31 09:50:36 -05:00
Maureen Helm c8ae05dd80 tests: flash_map: Configure mpu to allow flash write
On boards that have the arm or nxp mpu, configure the mpu to allow flash
writes. Otherwise this test will fail with an mpu fault.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-05-30 17:13:13 -04:00
Krzysztof Chruscinski 3555c81111 tests: shell: shell_history: Add more tests
Extended test suite with more tests for shell_history module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-30 09:44:03 -04:00
Krzysztof Chruscinski c2cb60f613 shell: Refactor shell_history to use less RW memory
Shell history module reworked to use ring buffer for storing
commands. Dedicated buffer is used to story all command lineary.
History capacity is in bytes not in number of entries, e.g.
many short commands can be stored or few long (depending on
CONFIG_SHELL_HISTORY_BUFFER).

Removed implicit command null termination from shell_history and
added it to shell after fetching command line from the history.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-30 09:44:03 -04:00
Krzysztof Chruscinski 80f8481feb tests: subsys: shell: Add shell_history test
Add test suite for shell_history module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-30 09:44:03 -04:00
Radoslaw Koppel 974231ee6e subsys/settings: Add const modifier to the value pointer
This commit adds const modifier for value pointer in
settings_save_one function.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2019-05-29 10:11:12 -04:00
Krzysztof Chruscinski 93fb695244 tests: subsys: logging: Test for detection of missed log_strdup
Added test to validate algorithm for missed log_strdup() call.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-29 13:52:31 +02:00
Jan Van Winkel afdbc20364 tests: Added native POSIX to flash based tests
Added native POSIX boards as target for flash related tests.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-05-28 21:14:19 -04:00
Andrei Emeltchenko 5970b66311 tests: usb: device: Refactor device api test
Refactor device api test using standard placement for descriptor table
and configuration data.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko 3880a42375 usb: Align legacy and composite interface
Remove duplicated execution path for composite configuration, USB
device stack initialization is done inside stack for both cases.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Aurelien Jarno 819e749ccd usb: move the request handler buffer to the USB device code
In order to unify the legacy and composite code, move the class and
vendor request handler buffer into the USB device code, just like in
composite mode. The option is renamed from USB_COMPOSITE_BUFFER_SIZE
into USB_REQUEST_BUFFER_SIZE and also replaces the USB_DFU_MAX_XFER_SIZE
and USB_HID_MAX_PAYLOAD_SIZE options.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Kamil Piszczek cbc2ff6631 tests: fs: nvs: unittest with corrupted sector close op
Added a test case with corner case scenario, in which sector closing
operation is interrupted (e. g. due to power-down).

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-27 12:26:20 +02:00
Kamil Piszczek 302dc9878e tests: fs: nvs: moving nvs_clear to setup method
Flash clearing operation is now moved to the setup method inside the
NVS unit test.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-27 12:26:20 +02:00
Andrzej Puzdrowski 2d48f4337d tests/fs/nvs: GC full round test
Added a test for testing full round GC on 3-sectors
configuration. In this case all kind off sector can
appeared so this test covers well more numerous
sectors configurations.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-05-24 11:13:59 +02:00
Kamil Piszczek b76edc1a1d tests: fs: nvs: garbage collector test
Added a simple test for the NVS Garbage Collector.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-22 10:22:53 +02:00
Kamil Piszczek 35a9299a76 tests: fs: nvs: test cases clean up flash on completion
Modified tests for the NVS to clean up the flash memory at the end of
their execution.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-22 10:22:53 +02:00
Yannis Damigos bf74f5410f tests/subsys/usb/device: Fix comment and message
Fix comment and message.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-05-20 09:04:08 -04:00
Andrei Emeltchenko 6378e1e4a2 tests: usb: desc_sections: Fix coverity issue
Move increment out of zassert_*().

Fixes #15770

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-17 08:06:28 -07:00
Andrei Emeltchenko 875d5a2bf6 tests: usb: desc_sections: Fix coverity issue
Coverity thinks that zassert_*() is debug stuff so move out increment.

Fixes #16163

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-17 08:06:28 -07:00
Kamil Piszczek e81090cff6 tests: fs: nvs: added basic unittests for nvs
Added basic tests for the NVS file system. One of the tests covers power
down during the flash write operation.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-13 17:07:28 +02:00
Andrei Emeltchenko d05b260e9c tests: usb: desc_sections: Cleanup test
Strip loopback name from the structures. Fix bNumEndpoints.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 19:00:02 -04:00
Andrei Emeltchenko 4626a8cb51 tests: usb: desc_sections: Check EP assignment order
Check that endpoints are assigned in the right order.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 19:00:02 -04:00
Andrei Emeltchenko c840383c6a tests: usb: desc_sections: Use automatic endpoint assignment
Use automatic assignment defined in usb_descriptor.h

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 19:00:02 -04:00
Andrei Emeltchenko fbfe75c55e usb: tests: Add second IN endpoint to test
Demonstrate automatic endpoint assignment in tests for similar
endpoint types.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Andrei Emeltchenko 7c35a4e89a tests: usb: Add endpoint allocation verification test
Add verification that interface number and endpoint addresses are
correctly allocated.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
François Delawarde 94451b22fc subsys/settings: Allow to register custom backends in settings subsystem
Major changes are:
- Expose settings backend API to enable custom backend support.
- Add a new CONFIG_SETTINGS_CUSTOM backend to allow registering a custom
backend.
- Change api of the handlers h_set() routines to allow for
backend-specific read callbacks.
- Provide a customizable settings_backend_init() routine for custom
backends.
- Move runtime settings support to be its own backend.

Signed-off-by: François Delawarde <fnde@oticon.com>
2019-04-26 11:24:31 +03:00
Kamil Piszczek dae15fa736 tests: storage: flash_map: adding qemu platform
Added QEMU platform to the Flash Map test and defined partitions for
QEMU dts.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-24 13:05:11 -07:00
Anas Nashif 27c97911b7 flash_map: fix test names
API names have changed, but not the test name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-19 13:41:02 -05:00
Andrei Emeltchenko f350c275e1 tests: usb: Add write() and set_callback() tests
Add more tests for invalid EP testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko 8cf9bf032b tests: usb: Add usb_read() for invalid endpoint
Check that reading invalid endpoint does not succeed.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko 1178042cf4 tests: usb: Add more USB DC tests and refactor names
Add more tests covering almost all DC API with invalid parameters.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko 1b1c5f72d9 tests: usb: Add write() and set_callback() tests
Add more tests for invalid EP testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko dad6ddef7f tests: usb: Cleanup tests
General test cleanup and remove optimized variables.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko d0bc6891d8 tests: usb: Add usb_read() for invalid endpoint
Check that reading invalid endpoint does not succeed.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko 9fa5d9a5bf tests: usb: Fix checking error code
Instead of checking for -EINVAL check that return is not successful
since USB device may return other error code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko 69726bbccb usb: tests: Enable other boards for test
Enable other boards with USB device supported

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Johann Fischer c13e201b18 usb: replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS
Replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-04-11 13:35:24 -04:00
Andrzej Puzdrowski bfb7e4531c tests/subsys/settings/fcb: fix unaligned test
Unaligned test might filed in case fcb area was not clen before
run.
The patch insert clean operation before this test.

fixes #15063

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-08 10:50:10 -04:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Andrew Boie 7b1ee5cf13 tests: CONFIG_TEST_USERSPACE now off by default
Unlike CONFIG_HW_STACK_PROTECTION, which greatly helps
expose stack overflows in test code, activating
userspace without putting threads in user mode is of
very limited value.

Now CONFIG_TEST_USERSPACE is off by default. Any test
which puts threads in user mode will need to set
CONFIG_TEST_USERSPACE.

This should greatly increase sanitycheck build times
as there is non-trivial build time overhead to
enabling this feature. This also allows some tests
which failed the build on RAM-constrained platforms
to compile properly.

tests/drivers/build_all is a special case; it doesn't
put threads in user mode, but we want to ensure all
the syscall handlers compile properly.

Fixes: #15103 (and probably others)

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-06 14:30:42 -04:00
Andrei Emeltchenko 721f3d1cd0 usb: Refactor USB status callback
Merge cb_usb_status_composite and cb_usb_status and use common
forward_status_cb for both composite and normal devices.

Fixes #14882

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Cinly Ooi 9bfc1eb8a6 sample: nffs_fs_api: basic: Increase time for testing
Increase test timeout to 500s because it was noticed
that the default of 60s has truncated the test
suite run for nrf52840_pca10056

Signed-off-by: Cinly Ooi <cinly.ooi@intel.com>
2019-03-29 18:24:48 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Michael Scott 83aa7cecd4 boards: arm: nrf52840-based: Free up flash room for sample apps
The current flash configurations for all nRF52840's in Zephyr is
VERY constrained when it comes to allowing samples any space for
storage or custom areas.  It only leaves the last 4 pages of flash
for "storage".

The nRF52840 is also capable of using OpenThread which defaults
to using the last 4 pages of flash for storing OpenThread-related
network data.

This means that while using OpenThread under any configuration
designed to use mcuboot partition slots, there is no space left
over for storage of any kind.

Let's adjust the partition table to set storage at 8 pages of
flash (32k).  This fixes the conflict with OpenThread and leaves
room for future use cases that may arise.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-15 08:52:06 -05:00
Andrzej Puzdrowski 7a00658b8e tests/subsys/fs/nffs_fs_api: build ram back-end only for qemu_x86
Ram back-end was unnecessary included in non qemu test which
increased RAM footprint much.

Patch includes ram backend into build only for qemu_x86 build.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-03-09 10:34:17 -05:00
Varun Sharma 145d8f06e0 tests: subsys: fs : Fix coverity issue
Fix Unchecked return value in func: nffs_test_util_create_file_blocks

Coverity-CID: 190955
Fixes: #13860

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2019-03-07 09:39:39 -05:00
Andrew Boie 90132d3543 tests: jwt: lower heap size
The heap, plus a few globals relevant to mbedtls get put in
their own memory partition.

With systems that have power-of-two region size/alignment
constraints, this results in a 64K partition being created,
even though we are using just a whisker above 32K.

Lower the heap size a little so everything fits in 32K.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-07 04:27:32 -06:00
Andrzej Puzdrowski 15159dddf1 settings: always uses the storage partition for FCB
It was possible via Kconfig to assign any partition for FCB using
its number. Partitions flash_area_id becomes non predefined
(are auto-generated). So it is possible only to guess which
number will be signed to certain area.

Unfortunately it is not possible to transfer FLASH_AREA_XXX_ID
label via Kconfig.

Patch assigns settings to the storage partition and remove
SETTINGS_FCB_FLASH_AREA property from settings Kconfig.

fixes #13388

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-03-04 16:51:19 +01:00
Daniel Leung 602a79cfeb tests: fs/nffs_fs_api: fix uninitialized reference time variable
The reftime variable used for performance numbers is not initialized
prior to being used. Initialize it to the current uptime so delta
can be calculated correctly.

Fixes #13877
Fixes CID-190936

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-03-02 12:27:30 +01:00
Daniel Leung 8b523e944b tests: fs/fat_fs_dual_drive: check fs_seek return values
Inside test_file_truncate(), the results of fs_seek() are not
checked. So adds some checks there.

Fixes #13874
Fixes CID-190939

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-03-02 12:26:37 +01:00
Flavio Ceolin b92f104b66 tests: fs: Add missing return check
Checking the return of fs_stat to ensure that there is not hidden error.
Problem spotted by coverity.

CID 190949

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-01 09:50:15 +01:00
Jukka Rissanen c478b5bb6e can: Rename can_msg and can_msg_filter structs
In order to follow the naming from Linux, change the name of
can_msg to zcan_frame, and can_msg_filter to zcan_filter.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Jukka Rissanen 14d4023338 tests: can: Add CAN frame struct handling tests
Make sure that can_copy_*() functions work as expected.
These functions are used by SocketCAN support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Andrzej Puzdrowski b1a7e71436 settings: fix base64 encode test
settings_line_len_calc() calculates only setting record
payload size, not record layout in flash size.

this patch remove inadequate test for this function.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-02-21 19:09:04 -05:00
Andrzej Puzdrowski 5bc3ad2a1c tests/subsys/settings: fcb unaligned value test
Added test for check whether value lenght is properly
stored for unaligned settings record size.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-02-21 19:09:04 -05:00
Carlos Stuart 75f77db432 include: misc: util.h: Rename min/max to MIN/MAX
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.

This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.

All files that use these macros have been updated.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-14 22:16:03 -05:00
Krzysztof Chruscinski b44e06ea5b tests: subsys: logging: Enable log_core test on nios2
Nios2 platform was disabled due to compilation error. Meanwhile,
issue has been solved and tests can be re-enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-12 07:51:50 -05:00
Andrei Emeltchenko 030f06ae7b tests: usb: Use UTIL_LISTIFY macros
macros allows to define variable number of instances.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-12 07:49:04 -05:00
Kumar Gala 2508818bc3 tests: fs: nffs_fs_api: Convert FLASH_AREA to DT_FLASH_AREA
Use DT_FLASH_AREA prefixed defined instead of FLASH_AREA as the non-DT
version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
Kumar Gala 1b2496866c tests: fs: multi-fs: Convert FLASH_AREA to DT_FLASH_AREA
Use DT_FLASH_AREA prefixed defined instead of FLASH_AREA as the non-DT
version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
David Brown f8b838d404 jwt: Add JSON web token library
This patch adds a JSON web token library that adds the capability
to sign JSON tokens.  This was located in subsys due to the dependency
on MBEDTLS, which resides in /ext.

Signed-off-by: David Brown <david.brown@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-08 15:32:58 -06:00
Findlay Feng 2d2e1614b5 dfu/flash_img: use flash_map instead of flash API
Patch introduces flash_map subsystem to operate on flash
image instead of direct operation using flash_driver API.
Changes allows to support operation on the image in any flash
device.

flash_map was not available when this subsystem was introduced.

Signed-off-by: Findlay Feng <i@fengch.me>
2019-02-08 09:13:09 -06:00
Findlay Feng 04bf2e1bd1 dfu/mcuboot: use flash_map instead of flash API
Patch introduces flash_map subsystem to operate on flash
footprint instead of direct operation using flash_driver API.
Flash area ID is used in API instead of direct flash-bank-offsets.
Changes allows to support operation on the partition in any flash
device.

flash_map was not available when this subsystem was introduced.

Signed-off-by: Findlay Feng <i@fengch.me>
2019-02-08 09:13:09 -06:00
Andrei Emeltchenko 43d7c5bd2c tests: usb: Add more basic device API tests
Add more tests testing basic API and native_posix driver.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 07:56:24 -05:00
Andrei Emeltchenko 9832f1c1cb tests: device: Remove wpanusb mentions from the test
Remove wpanusb prefixes for the test to be more generic.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 07:56:24 -05:00
Andrei Emeltchenko 0c1f8eb28d teste: desc_sections: Add simple test
Add one more simple test.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 07:56:24 -05:00
Andrew Boie 41f6011c36 userspace: remove APPLICATION_MEMORY feature
This was never a long-term solution, more of a gross hack
to get test cases working until we could figure out a good
end-to-end solution for memory domains that generated
appropriate linker sections. Now that we have this with
the app shared memory feature, and have converted all tests
to remove it, delete this feature.

To date all userspace APIs have been tagged as 'experimental'
which sidesteps deprecation policies.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-08 07:04:30 -05:00
Kumar Gala b89a808b26 tests: subsys: settings: Use DT_FLASH_AREA_<FOO>_ID define
Set Kconfig symbol SETTINGS_FCB_FLASH_AREA based on the
DT_FLASH_AREA_<FOO>_ID define instead of being hard coded.

We replace 3 with DT_FLASH_AREA_IMAGE_SCRATCH_ID and
we replace 4 with DT_FLASH_AREA_STORAGE_ID.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 10:31:27 -06:00
Kumar Gala 25eae07217 tests: subsys: fs: fcb: Use DT_FLASH_AREA_<FOO>_ID define
Rather than using hard coded 2, use DT_FLASH_AREA_IMAGE_1_ID
that is now generated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 10:31:27 -06:00
Andrzej Puzdrowski ee5106e3d3 tests/subsys/storage/flash_map: use auto-generated fa ID
After addition of flash_map auto-generation it is needed to
use generated flas_area name instead of hard-code.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 10:31:27 -06:00
Andrei Emeltchenko 5b3bd4e099 tests: usb: Include desc_sections test for native_posix
After including native_posix USB controller we can perform some simple
tests on native_posix.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-06 17:53:04 -05:00
Anas Nashif 58632f8da7 doc: change board dts documentation with new URLs
flash-partitions page has moved...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 07:04:40 -05:00
Andrei Emeltchenko bf9c6d72e8 usb: Add instance parameter to descriptors definitions
This allows to place instances of the class one after another in the
linker section.

Fixes #12908

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-01 19:11:32 -05:00
Andrei Emeltchenko a49125ca90 tests: usb: Test USB data allocations in sections
USB relies on descriptors and configuration data allocations in
specific sections. This simple test verifies that at least size of the
data is correct.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-01 19:11:32 -05:00
Andrei Emeltchenko b483804c75 usb: tests: Add basic unit test for USB drivers
Add basic tests testing simple endpoint enable and configuration.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-01 19:03:12 -05:00
Krzysztof Chruscinski 80a60412c9 tests: subsys: logging: Add log_output test suite
Add test to log_output module. Test suite covers usage of
log_output_string function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-29 17:24:37 +01: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
Jan Van Winkel 26c9c7480e tests: mcuboot: Erase image slot before starting test
Erase image slot 0 in MCUBOOT test write confirm before starting
actual test.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-21 12:00:55 -05:00
Jan Van Winkel bea1568217 tests: mcuboot: Do not read past image bounds
Make sure that the MCUBOOT test case bank erase does not read passed
image bounds.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-21 12:00:55 -05:00
Carles Cufi 962f900c0b test: nffs: Remove unsupported ICs from CMake files
The smaller Nordic ICs are not supported for those tests due to not
enough RAM.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-17 12:01:16 -06:00
Carles Cufi 9897904254 tests: nffs: Run NFFS tests on nRF52840
After the builds have been fixed, enable the tests on the 256KB-RAM
Nordic IC.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-17 12:01:16 -06:00
Carles Cufi 4f10f8ba2e tests: nffs: Tweak Kconfig to fit in RAM
NFFS tests do not fit in RAM on nRF5x, tweak the configurations so that
they do.

Fixes: #12065

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-17 12:01:16 -06:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Varun Sharma 3d9213ac57 tests: subsys: fs: multifs: Enable fs shell using new shell
Fixes #11356, resolved compilation issue wrt to NFFS_FLASH_DEV_NAME

Enabled new shell implementation for testing fs shell

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2018-12-14 13:14:17 +01:00
Krzysztof Chruscinski 0899a6c0b7 logging: severity-wise filtering of function name prefix presence
Extended logger configuration to allow function name prefix for
messages with certain severity levels. By default only debug
messages are prefixed with function name.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-13 14:21:25 +01:00
Andrzej Puzdrowski 55024fe5f0 tests: subsys: settings: tests value get len API
This Patch add tests for API in nffs and fcb back-ends.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski e5a09ccb3e settings: add API for check value size
Such API is convinient for check the persistent storage
value size or whether the value is NULL.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski 03efd7d049 tests: subsys: settings: extend fcb back-end testing
Since it is possible to test back-end with base64 and without
test suite should be extended.

This patch introduce tests with and without base64 encoding

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski cb2445d8fe tests: subsys: settings: extend nffs back-end testing
Since it is possible to test back-end with base64 and without
test suite should be extended.

This patch introduce tests with and without base64 encoding

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski ccb914dc61 tests: subsys: settings: fcb-int tests rework
Introduction of stream-style encoding required rework
of tests.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski c2550d17a0 tests: subsys: settings: fs-backend tests rework
Introduction of stream-style encoding required rework
of tests.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski 35edac74f7 tests: subsys: settings: fcb-backend tests rework
Introduction of stream-style encoding required rework
of tests.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski 6ace20e189 tests: subsys: settings: common tests rework
Introduction of stream-style encoding required tests reworks.
Test for checking especially byte-string encoding is not required
anymore as any value is kept as byte-string.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski 84a88f107c tests: subsys: settings: stream encoding tests
Added tests for recently introduced sterem-style encoding.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Adithya Baglody f6e7c8b1b5 tests: subsys: fs: Fixed headers which were creating objects.
These tests were creating objects from header file in the bss.
Fixed it by moving the objects to appropriate object files.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-12-07 10:32:41 -05:00
Krzysztof Chruscinski 7c68befb15 logging: Fix initial log level in shell
Shell log backends were initialized from shell context. After
lowering logger thread priority order has been flipped. That
revealed a bug where shell logger backend was enabled before
backend ID's has been assigned during logger initialization.

ID assignment is moved to log backend enabling function making
it independent of order of initialization.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-05 14:35:33 +01:00
Patrik Flykt 440b535602 tests: 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
Krzysztof Chruscinski d3c651d748 tests: subsys: logging: Add test for message drop notification
Extended logger suite to test correctness of reporting dropped
log messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-03 14:22:42 -08:00
Jakub Rzeszutko b7a5874830 tests: shell: migrate tests to the new shell
Testing:
1. Shell built-in commands.
2. Wildcards module.
3. Static commands creation and execution.
4. Dynamic commands creation and execution.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-11-22 11:32:29 +01:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Krzysztof Chruscinski 5e346812ac logging: Refactor LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros
Changed LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros to take log
level as optional parameter. LOG_MODULE_DECLARE can now also be used
in static inline functions in headers. Added LOG_LEVEL_SET macro
which is used when instance logging API is used to indicate maximal
log level compiled into the file.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Pushpal Sidhu 1f1faa9195 tests: fat_fs_api: add renaming tests
Test both directory and file renaming.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2018-11-02 12:21:22 -04:00
Anas Nashif 9c2c677da8 tests: remove logger-hook test
We now use logger backends with new logger system.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-31 10:11:14 -04:00
Reto Schneider 7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Krzysztof Chruscinski 5d28fcd689 logging: Add optional function name prefix
Extended logger to support optional log message prepending with
function name.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-24 11:14:26 +01:00
Krzysztof Chruscinski c696e68bb9 logging: Added support for 10 arguments in log message
Extended supported number of arguments in log message. Support for
messages consisting of more than 2 chunks had to be added. So far
messages could consist of one chunk (up to 3 args) or two chunks
(2 args in first chunk and 7 in second chunk). Once 2+ chunks
support is added number of arguments is techinically limited to
15 (4 bit field). log_core and log_output extended to suppor 10
arguments.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-24 11:14:26 +01:00
Krzysztof Chruscinski fe7416a27e tests: subsys: logging: Fix log_core test
Log_core test was failing due to test structure elements not being
correctly reset before the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-17 09:13:01 -04:00
Anas Nashif deaab90641 tests/samples: cleanup tags
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.

Avoid short abbriviations and using full names for fs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Varun Sharma 7622fc37a0 subsys: fs: Migrate to new logging subsys
subsys:fs : Migrate from `SYS_LOG` to `LOG` logging mechanism.

tests: subsys: fs: Enabled CONFIG_LOG in prj.conf

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2018-10-15 09:18:03 -04:00
Krzysztof Chruscinski 5f6070e2f7 logging: Add autostart option to LOG_BACKEND_DEFINE
Extended macro to accept flag indicating if given backend must be
initialized and enabled when log subsystem starts. Typically, simple
backends will have autostart flag set. More complex may require
explicit enabling (e.g. shell over BLE can only be enabled when
BLE connection is established).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-11 13:29:50 +03:00
Krzysztof Chruscinski 26031f7bfd lib: ring_buffer: add raw byte access mode
Extended ring buffer to allow storing raw bytes in it. API has been
extended keeping 'data item' mode untouched.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-09 13:58:44 -04:00
Krzysztof Chruscinski ff5f00f2c3 lib: ring_buffer: Rename sys_ring_buf_ to ring_buf_item_
Deprecate API prefixed with sys_ring_buf_ and rename it
to ring_buf_item_ since this API is not a typical ring buffer
but ring buffer of data items (metadata + 32bit words).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-09 13:58:44 -04:00
Anas Nashif fbbb3da192 tests: logging: disable default log modules
log modules of kernel are creating noise, set them to off to have this
test work as expected.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Krzysztof Chruscinski d0776bcc02 tests: logging: add log_strdup test to log_core test
Extended log_core test suite to test string duplication.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-01 15:26:14 -04:00
Krzysztof Chruscinski a15438e8f5 logging: add mechanism for handling transient strings
Extending logger to support logging transient strings (with %s).
With dedicated call (log_strdup), string is duplicated to a buffer
from internal logger pool. Logger implicitly manages the pool.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-01 15:26:14 -04:00
Piotr Zięcik 1c16cfcc30 arch: arm: Make ARM_MPU the sole option controlling MPU usage
This commit removes all MPU-related (ARM_CORE_MPU and NXP_MPU)
options exept ARM_MPU, which becomes master switch controlling
MPU support on ARM.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-09-20 14:16:50 +02:00
Piotr Zięcik 9331064ff9 arch: nrf52: Remove ARM_MPU_NRF52X option.
The ARM_MPU_NRF52X option is just selecting ARM_MPU option,
which could be also controlled through menuconfig.

This commit removes the ARM_MPU_NRF52X option and replaces
its usage by ARM_MPU option.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-09-20 14:16:50 +02:00
Krzysztof Chruscinski ba808d789e samples: subsys: shell: Port sample to new shell subsystem
Ported shell sample to use new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Krzysztof Chruscinski cd850647d5 tests: subsys; logging: log_core test to cover LOG_MODULE_DECLARE()
Extending log_core test suite to test LOG_MODULE_DECLARE() macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 08:38:35 -04:00
Alberto Escolar Piedras eca0fb6ca0 tests: subsys: logging: log_core fix with inplace process
tests/subsys/logging/log_core does not work if inplace processing
is set and the process thread is disabled.
So let's set the valid configuration in its project file

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-18 14:56:10 +02:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Maureen Helm df2cc4084a tests: usb: Enable usb tests on frdm_k64f
Enables the bos and os_desc tests on the frdm_k64f platform.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-14 13:22:03 -05:00
Maureen Helm 4c81e94af1 tests: usb: Don't enable stdout console
This was causing a stack overflow on the frdm_k64f platform.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-14 13:22:03 -05:00
Varun Sharma 28f5da6c38 subsys: shell : fs new shell module for fs mount operation
Fixes # 7348, also includes test cases

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2018-09-13 09:27:45 -04:00
Anas Nashif 81b272119a docs: fixed documenation pointers
Fixed URL to documentation, now latest docs are under /latest/..
Fixes #9932

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-12 12:03:18 -04:00
Kumar Gala 4fede8dd0b log: make name param explicit
Rather than having some implied name for the logging name, explicitly
pass it in the macros LOG_MODULE_REGISTER & LOG_MODULE_DECLARE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-11 13:25:55 -05:00
Flavio Ceolin 0866d18d03 irq: Fix irq_lock api usage
irq_lock returns an unsigned int, though, several places was using
signed int. This commit fix this behaviour.

In order to avoid this error happens again, a coccinelle script was
added and can be used to check violations.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-08-16 19:47:41 -07:00
Anas Nashif 57db41516e tests: remove subsys from test identifier
subsys should not be part of the identifier, it is folder structure.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-16 13:20:53 -07:00
Kumar Gala ebc3ce3a0e Revert "log: make name param explicit"
This reverts commit 2cb17a0332.  It
doesn't handle the dynamic logging case and thus breaks things.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-08-15 11:19:46 -05:00
Kumar Gala 2cb17a0332 log: make name param explicit
Rather than having some implied name for the logging name, explicitly
pass it in the macros LOG_MODULE_REGISTER & LOG_MODULE_DECLARE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-08-15 09:41:02 -05:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Krzysztof Chruscinski 3c63d05dfc logging: Add metadata to hexdump
Extended hexdump API with a raw string attached to the data.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-08-14 07:14:34 -07:00
Maureen Helm 45f34a4313 tests: flash_map: Add k64-based boards to platform whitelist
Adds the frdm-k64f and hexiwear_k64 boards to the platform whitelist.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-31 08:44:45 -04:00
Maureen Helm 08470c0f7f tests: flash_map: Don't enable stdout console
This was causing a stack overflow on the frdm_k64f platform.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-31 08:44:45 -04:00
Maureen Helm 08db8c19a3 tests: flash_map: Enable mpu and allow flash write
It shouldn't be necessary to disable the mpu for this test. Enable
CONFIG_MPU_ALLOW_FLASH_WRITE=y instead.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-31 08:44:45 -04:00
Maureen Helm f16a7ea836 tests: flash_map: Disable write protection before erase
The flash API requires write protection to be disabled before erasing
the flash. It appears that the nordic platforms for which this test was
originally implemented do not enforce the requirement to disable write
protection. The mcux flash driver, however, does enforce the
requirement, so fix the test to make it work on kinetis platforms.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-31 08:44:45 -04:00
Sebastian Bøe c9e12493b2 cmake: Remove duplicate invocations of target_link_libraries on app
It is not necessary to link 'app' with ELMFAT or NFFS because their
usage requirements are covered by the 'APP_LINK_WITH_MBEDTLS'
mechanism that automatically links 'app' with the interface library
FS.

This patch removes the redundant target_link_libraries invocations.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-07-25 08:27:45 -04:00
Anas Nashif 8cdb5d5d24 tests: nffs: fixed types
We have been mixing u32_t and uint32_t. Using u32_t when the API expects
something else.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-18 12:32:23 -04:00
Krzysztof Chruscinski 6b01c89935 logging: Add log initialization to system startup
Log API can be used before user can explicitly initialize the logger.
In order to ensure that logger core is ready to buffer log messages
it must be initialize as early as possible. Initialization does not
include initialization of default backend since driver may not be
ready and backend is needed only when log messages are processed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-14 08:32:44 -04:00
Andrei Emeltchenko c8af08e5d4 usb: osdesc: Use definition for string descriptor index
Use definition and add description block.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-12 23:10:22 -04:00
Andrei Emeltchenko 5a9c069c83 usb: tests: Add testing os_desc feature
Add testing usb_handle_os_desc_feature()

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-12 23:10:22 -04:00
Andrei Emeltchenko 65cbe9db57 usb: tests: Add unit tests for MS OS Descriptors testing
Add test for testing MS OS String Descriptor version 1.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-12 23:10:22 -04:00
Andrei Emeltchenko 6e15dc789a usb: tests: Fix BOS test related to linker order
The current test expects particular order of cap_webusb and cap_msosv2
structures, create alternative structure for comparison.

Fixes: #8732

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-04 15:10:31 -04:00
Krzysztof Chruściński 17ae882b43 tests: subsys: logging: Add tests for log_msg and log_list
Tests for intrnal logging subsystem modules.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2018-06-29 10:16:45 +02:00
Sebastian Bøe c1c25dea1a cmake: Remove stray CMakeLists.txt file
Remove the CMakeLists.txt file that is in the 'common' directory of
nffs_fs_api. It has likely been added by mistake as it does not make
any sense as it is written.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-22 12:28:01 -04:00
Andrei Emeltchenko b9c82121c6 usb: bos: unit: Add unit test for BOS testing
Add testing USB Binary Device Object Store descriptors and macros.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Anas Nashif fb2e142b0e tests: fix test identifiers
Fix test identifiers and use subsystem correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-07 18:01:49 -05:00
Anas Nashif 3057da079a tests: logger-hook: increase ztest stack size
We are getting stack corruption on some platforms, so increase stack to
allow the test to run.

Fixes #8085

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-05 14:13:17 -04:00
Andrzej Puzdrowski 66e84540f7 tests: subsys: settings: fcb: Fix failure on nrf52_pca10040
Tests failed on the target because flash area reserved
for fcb data storage was to small.
This path add dts overlay file for nrf52_pac10040 board which
increases this flash area to proper size.

Fixes #8038

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-06-01 09:00:42 -04:00
Inaky Perez-Gonzalez 14fe2727b8 tests: unfold nffs_fs_api
The introduction of `sanitycheck --list-tests` fails to properly parse
the subcases in tests/subsys/fs/nffs_api/ beacause four of them are
all packed with #ifdefs in a single src/main.c.

So this breaks that testcase in four:

- creating a common folder with the code itself
- moving the common code in */src/main.c to common/test_nffs.h and
  adding ../common/*.c to the sources
- thinning each testcase.yaml to have only the needed testcase
  definition
- adding zephyr_include_directories(../common) to the cmakefiles

so we now produce with --list-tests

    - filesystem.nffs.basic.append
    - filesystem.nffs.basic.corrupt_block
    - filesystem.nffs.basic.corrupt_scratch
    - filesystem.nffs.basic.fs_mount
    - filesystem.nffs.basic.gc
    - filesystem.nffs.basic.gc_on_oom
    - filesystem.nffs.basic.incomplete_block
    - filesystem.nffs.basic.large_write
    - filesystem.nffs.basic.long_filename
    - filesystem.nffs.basic.lost_found
    - filesystem.nffs.basic.many_children
    - filesystem.nffs.basic.mkdir
    - filesystem.nffs.basic.open
    - filesystem.nffs.basic.overwrite_many
    - filesystem.nffs.basic.overwrite_one
    - filesystem.nffs.basic.overwrite_three
    - filesystem.nffs.basic.overwrite_two
    - filesystem.nffs.basic.read
    - filesystem.nffs.basic.readdir
    - filesystem.nffs.basic.rename
    - filesystem.nffs.basic.split_file
    - filesystem.nffs.basic.unlink
    - filesystem.nffs.basic.wear_level
    - filesystem.nffs.cache.cache_large_file
    - filesystem.nffs.cache.fs_mount
    - filesystem.nffs.large.fs_mount
    - filesystem.nffs.large.large_system
    - filesystem.nffs.large.large_unlink
    - filesystem.nffs.performance.fs_mount
    - filesystem.nffs.performance.performance
   30 total.

vs before, that we did:

    - filesystem.nffs.basic.append
    - filesystem.nffs.basic.corrupt_block
    - filesystem.nffs.basic.corrupt_scratch
    - filesystem.nffs.basic.fs_mount
    - filesystem.nffs.basic.gc
    - filesystem.nffs.basic.gc_on_oom
    - filesystem.nffs.basic.incomplete_block
    - filesystem.nffs.basic.large_write
    - filesystem.nffs.basic.long_filename
    - filesystem.nffs.basic.lost_found
    - filesystem.nffs.basic.many_children
    - filesystem.nffs.basic.mkdir
    - filesystem.nffs.basic.open
    - filesystem.nffs.basic.overwrite_many
    - filesystem.nffs.basic.overwrite_one
    - filesystem.nffs.basic.overwrite_three
    - filesystem.nffs.basic.overwrite_two
    - filesystem.nffs.basic.read
    - filesystem.nffs.basic.readdir
    - filesystem.nffs.basic.rename
    - filesystem.nffs.basic.split_file
    - filesystem.nffs.basic.unlink
    - filesystem.nffs.basic.wear_level
    - filesystem.nffs.cache.append
    - filesystem.nffs.cache.corrupt_block
    - filesystem.nffs.cache.corrupt_scratch
    - filesystem.nffs.cache.fs_mount
    ...
    - filesystem.nffs.cache.split_file
    - filesystem.nffs.cache.unlink
    - filesystem.nffs.cache.wear_level
    - filesystem.nffs.large.append
    - filesystem.nffs.large.corrupt_block
    - filesystem.nffs.large.corrupt_scratch
    ...
    - filesystem.nffs.large.split_file
    - filesystem.nffs.large.unlink
    - filesystem.nffs.large.wear_level
    - filesystem.nffs.performance.append
    - filesystem.nffs.performance.corrupt_block
    ...
    - filesystem.nffs.performance.unlink
    - filesystem.nffs.performance.wear_level
   92 total.

(so it was repeating ALL the subcases for eatch main testcase)

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2018-05-23 15:07:24 -04:00
Punit Vara 7a3ace35dd tests: Remove newline character
Remove new line character from all zassert_*
messages. Following script has been used to do this.

https://github.com/punitvara/scripts/blob/master/remove_newlinech.py

zassert test framework adds newlines character implicitly.

issue: #7170

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-05-23 12:59:12 -04:00
Adithya Baglody c07ec386bf tests: subsys: fs: Enable proper configuration for qemu_x86.
The sample was running with incorrect kconfigs.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-05-15 17:48:18 +03:00
Andrzej Puzdrowski 3be0c56d50 tests/subsys/settings/fcb: add deleted settings compression test
New test for check whether deleted item is not copied to the newest
fcb sector during compression procedure.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-05-11 09:56:52 +02:00
Ramakrishna Pallala c239ea701f tests: subsys: fs: Add test for FAT FS dual instance case
Add a test application to demonstrate the dual instances of
FAT file system.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-05-08 08:53:01 -04:00
Ramakrishna Pallala 01b831751d tests: subsys: fs: Add changes to support multiple FS instance
Set FAT FS mount point name as per ELM FAT Library drive
name format.

Add file system specific headers wherever necessary.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-05-08 08:53:01 -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 11120bf1c7 tests: remove comma from whitelist
items in platform_whitelist are not comma separated.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-03 09:28:36 -04:00
Andrzej Puzdrowski 3298d60ff9 tests: subsys: settings: Add FCB-beckend initialization test
Added test for initialization with FCB backend.
This test should goes over reset so it test blank and
subsequent initialization and data restoring capability
after the reset.



Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-04-27 13:20:14 +02:00
Johan Hedberg 9968cda453 fs: Convert NFFS partition to a generic one
The NFFS partition at the end of flash is also useful for any other
file system or even the Flash Circular Buffer (FCB). Rename the
partition from 'nffs_partition' to 'storage_partition' and make it
depend on a new hidden Kconfig entry which the relevant users will
select (such as NFFS and FCB).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-04-26 16:06:55 +05:30
Johan Hedberg 9a2b5357ea tests: settings: Remove references to non-existent Kconfig variable
There's no such Kconfig variable as CONFIG_SOC_FLASH_NRF5.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-04-26 11:58:07 +03:00
Andrzej Puzdrowski 9fe30535d7 susbsys: settings: fix coverity issues
API settings_subsys_init call was changed so that it returns
error (so returns int instead of void).
Prototype of storage helper function export_func for
settings_handler::h_export was changed so that it returns error
(so returns int instead of void).
Fixed few other error handling issues by ignoring return
values.

Tests were aligned to above patches.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-04-25 22:25:32 +05:30
Anas Nashif 55ce5510f5 tests: cleanup subsystem tests meta-data
Cleanup testnames, tagging and filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Anas Nashif fe476cc036 tests: ztest: test_main takes no arguments
Some tests were using test_main with arguments causing conflicts during
build.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-01 14:14:16 -04:00
Andrzej Puzdrowski 94ff339cbf subsys: Add a new settings subsystem
Adapt the MyNewt non-volatile configuration system to become a settings
system in Zephyr.
The original code was modifed in the following ways:

* Renamed from config to settings
* Use the zephyr FCB, FS API, and base64 subsystems
* lltoa like function was added to sources as it was required but not
  included in Zephyr itself.
* The original code was modified to use Zephyr's slist.h as single
  linked list implementation.
* Reworked code which was using strtok_r, added function
  for decoding a string to a s64_t value.
* Thank to the above the settings subsys doesn't require newlibc anymore.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-28 10:44:20 -04:00
Carles Cufi 8aa9a37902 drivers: flash: nrf: Rename nrf5 to nrf
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.

Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 20:07:09 +01:00
Ramakrishna Pallala d3a6d933f6 tests: subsys: fs: Add test for multiple file systems
Add a new test for testing multiple file systems mounted
simultaneously on Zephyr. The test enables FATFS and NFFS
togeather and uses RAM as backend storage device.

The intention of this test is to demonstrate multiple file systems
support and perform basic file and directory operations. This test
heavily reused the existing fat_fs_api and nffs_fs_api test sources.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-03-10 21:38:04 -05:00
Ramakrishna Pallala 3228e70bbf tests: subsys: fs: Adapt nffs_fs_api test as per VFS changes
Adapt nffs_fs_api test as per the VFS layer changes.

Add new test for NFFS file system mount.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-03-10 21:38:04 -05:00
Ramakrishna Pallala eb30e80bed tests: subsys: fs: Adapt fat_fs_api test as per VFS changes
Adapt fat_fs_api test as per the VFS layer changes.

Add new test for FatFs file system mount.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-03-10 21:38:04 -05:00
Andrzej Puzdrowski 6db7b43daf test: subsys: storage: flash_map: fix test of get sectors API
Test of f. flash_area_get_sectors was failing because parameter for
passing capacity of the sectors array was uninitialized.
This patch fix this bug.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-03-08 10:18:57 +01:00
Anas Nashif 0be346eed4 tests: do not use comma separated strings
platform_whitelist does not deal with comma separated strings. Also
remove build_only option, this should also run on those devices.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-15 08:53:25 -05:00
Christopher Collins 821dc37f3f subsys: storage: flash_map: Fix warning
Prior to this commit, `flash_area_layout()` was being passed a pointer
to the incorrect type (`uint32_t *` where `int *` was expected).  This
caused the following warning to be reported:

```
[...]/subsys/storage/flash_map/flash_map.c: In
function 'flash_area_get_sectors':
[...]/subsys/storage/flash_map/flash_map.c:191:32:
warning: passing argument 2 of 'flash_area_layout' from incompatible
pointer type [-Wincompatible-pointer-types]
  return flash_area_layout(idx, cnt, ret, get_sectors_cb, &data);
                                ^~~
[...]/subsys/storage/flash_map/flash_map.c:136:12:
note: expected 'int *' but argument is of type 'uint32_t * {aka long
unsigned int *}'
 static int flash_area_layout(int idx, int *cnt, void *ret,
            ^~~~~~~~~~~~~~~~~
```

This commit changes the argument type to `u32_t` for both functions.

Signed-off-by: Christopher Collins <ccollins@apache.org>
2018-02-14 14:36:52 -05:00
Andrzej Puzdrowski b3614c0b17 subsys: fs: fcb: remove f_area_id from fcb structure
It is faster to operate directly on flash_area pointer instead
of fetch it all the time using the fcb flash area id.
Also as f_area_id was needed only for get appropriate flash_area
pointer, so it is better to pass it only while initialization
the fcb and not store it in fcb instance data at all.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-02-07 09:51:26 -05:00
Andrzej Puzdrowski 9d56247cc7 test: subsys: fs: fcb: align to using sectors
fcb sectors description switch from using array of flash_area
structures to array of flash_sector structures.
This patch aligns tests to this change.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-02-07 09:51:26 -05:00
Christopher Collins a528d4d3d7 storage: flash_map: fix directory name typo
tests/subsys/storage/flash_mpa --> tests/subsys/storage/flash_map

Signed-off-by: Christopher Collins <ccollins@apache.org>
2018-02-07 09:51:26 -05:00
Andrzej Puzdrowski 6f7699fb14 tests: subsys: fs: nffs_fs_api: cleanup configuration for nRF5x
Removed CONFIG_FLASH_PAGE_LAYOUT because it is already selected
by NFFS kconfig itself. Some other keywords were duplicated.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-01-29 12:50:35 +01:00
Andrzej Puzdrowski 351a2c7872 tests: subsys: fs: nffs_fs_api: fix nRF5x failures
CONF_FILE was overwritten by boilerplate.cmake so not proper
settings were took for tests. NRF5 flash driver had changed
its name to one defined by DT (see #5773) - which causes
incompatibility witch previous settings.

This patch solves this problems.


Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-01-29 12:50:35 +01:00
Kumar Gala 26e4da52cf arm: nordic: flash: Use FLASH_DEV_NAME define
We want to move to use a common FLASH_DEV_NAME across the various flash
drivers. So samples, tests, or other code can be a bit more generic.  So
replace CONFIG_SOC_FLASH_NRF5_DEV_NAME with FLASH_DEV_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-25 15:23:00 -06:00
Anas Nashif 5d3a534807 samples: use console harness for some samples
The output of those samples can be parsed and verified by sanitycheck,
so lets use the console harness for this.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Andrzej Puzdrowski ae9560636f tests: subsys: fs: Add tests Flash Circular Buffer module
Tests added were adopted from MyNewt.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-01-15 15:46:37 -05:00
Andrzej Puzdrowski 25269fb0ed subsys: storage: Add flash_map abstraction module
Introduce flas_map module is abstraction over flash memory and its
driver for using flash memories along with description of
available flash areas.
Module provides simple API for write/read/erase and so one.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-01-15 15:46:37 -05:00
Anas Nashif e029e94100 tests: fs: fix README and adapt for cmake
Change build instructions to use CMake and remove confusing
'Troubleshooting' section.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-11 12:50:14 -05:00
Anas Nashif 94066e0f15 tests/samples: remove unknown option LOG_CBUFFER/LOGGER_BACKEND
Those options are not part of Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 08:08:45 -05:00
Punit Vara 71948788eb tests: logger-hook: convert sample to ztest and move to test/
issue: #3302

Signed-off-by: Punit Vara <punit.vara@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-05 18:17:59 -05:00
Anas Nashif d4784555d0 tests: remove build_only option
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 2292d7881d tests: move gdb_server to test_build
No need for this to be a standalone test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Andrzej Puzdrowski 2adbed8d6d tests: subsys: dfu: mcuboot: fix return value not handling issue
Function flash_read was calling without checking return value.
(Coverity CID: 178794)
This patch cover this issue.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-11-14 06:58:54 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00