Commit graph

41120 commits

Author SHA1 Message Date
Sebastian Bøe
56f6e35e47 cmake: Support passing syscall include directories through CMake
Introduce the CMake variable SYSCALL_INCLUDE_DIRS to support
out-of-tree syscall declarations.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2020-01-22 09:26:12 -05:00
Robert Lubos
65ec2d9701 boards: nrf52811_pca10056: Enable nRF 802.15.4 driver by default
nrf52811_pca10056 board should enable nRF 802.15.4 radio driver
automatically when 802.15.4 subsystem is enabled, as other Nordic
802.15.4-compliant boards do.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-22 14:58:40 +01:00
Robert Lubos
78169e7885 west.yml: Update hal_nordic to get recent 802.15.4 radio driver
The radio driver was updated in the hal_nordic repository, hence the
manifest update.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-22 14:58:40 +01:00
Krzysztof Chruscinski
a8b5a2e65e kernel: device: Add const qualifier to device_config
Device config structure is placed in rom section but there was
no const prefix used. Lack of prefix suggested that structure
is in ram (ram_report is also fooled). Added const prefix to
explicitly inform that it goes to rom.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-22 06:32:36 -06:00
Henrik Brix Andersen
46ac596ee6 boards: arm: frdm_k64f: list counter support
Add counter to the list of supported features for the NXP FRDM-K64F
development board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-22 06:27:30 -06:00
Henrik Brix Andersen
75549fc560 soc: arm: nxp: kinetis: k6x: enable RTC device
Enable the RTC counter present in the NXP K6x SoC if CONFIG_COUNTER is
enabled. Add the needed dts fixup for the RTC device.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-22 06:27:30 -06:00
Henrik Brix Andersen
230b278f84 dts: arm: nxp: k6x: fix rtc dts node
Fix the RTC device tree node for the NXP K6x SoC series. This device
is compatible with nxp,kinetis-rtc.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-22 06:27:30 -06:00
Maureen Helm
ff1cd6e10c gui: Add BGR565 pixel format support to lvgl
Adds support for the BGR565 pixel format to lvgl. This fixes the lvgl
sample for mimxrt10{50,60,64}_evk boards, which were broken when the
mcux elcdif display driver was modified in commit
9041b0f119 to return the BGR565 pixel
format instead of RGB565.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-22 08:55:16 +01:00
Flavio Ceolin
e1589c2278 driver: uart: ns16550: Setting default options
Commit 68a235932f changed this driver to
not use hard-coded options. The problem was that these options were
never being set. This commit just set an initial value that can be
changed later.

Fix 68a235932f

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-22 01:52:51 -05:00
Anas Nashif
e337882189 sanitycheck: fix reporting of timeouts
Timeouts were not reported correctly in the XML file as failures,
causing some confusion in the shippable results.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-22 01:39:28 -05:00
Ulf Magnusson
dbed9027ba doc: build overview: Improve diagram, fix errors/stale info, misc.
Diagram and text improvements:

 - Redraw the configuration phase diagram to better reflect the actual
   logic. Remove some misleading arrows, like from devicetree.h to
   Kconfig. Kconfig uses the devicetree scripts directly.

 - After the old devicetree scripts were removed in commit c8c35f76ab
   ("scripts: dts: Remove deprecated extract_dts_includes.py script"),
   the dtc compiler is only run to catch any high-level warnings and
   errors from it. The output is unused.

   Update the diagram and descriptions to explain how dtc is used.

 - Mention kconfigfunctions.py and explain better how devicetree and
   Kconfig interact

 - Clarify that 'cpp' is the C preprocessor. People often confuse it
   with C++.

 - Fix a typo'd devicetree_fixups.h in the text

 - Use the :file: role for files instead of italic text

 - Add links to the devicetree and Kconfig sections of the manual, and
   use the :zephyr_file: role to turn more files into direct links

 - Make the text generic re. Make vs. Ninja

 - Lots of other minor tweaks and clarifications

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-21 22:36:35 -05:00
Anas Nashif
9fe1e2a663 sanitycheck: support excluding platforms
It is often needed to run sanitycheck and exclude a specific platform or
multiple platforms. Add an option to provide this using
--exclude-platform. The option can be used multiple times to exclude
multiple platforms at the same time.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-21 21:10:49 -05:00
Jennifer Williams
68a235932f drivers: uart: ns16550: move from hard-coded to configurable
The NS16550 UART driver is currently hard-coded as 8-n-1
with no flow control. The baud rate is set by what is in DTS.
This commit moves away from hard-coded and strictly DTS to
configurable using the UART configure API. Requires commit #bcb807.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-01-21 18:50:27 -05:00
Jennifer Williams
3a34db8501 driver: uart: ns16550: implement configure API
The UART configure API was added to uart.h and this commit
implements the initial framework for the configure API for
the ns16550 uart. This includes the configure() and config_get()
functions and uart device configuration structures of the uart
configure API for the ns16550.

Note this commit does not resolve the pre-existing hard-coded
8-n-1 implementation.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-01-21 18:50:27 -05:00
Anas Nashif
831e7df993 ci: use latest docker (0.11.0)
Needed for EDTT testing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-21 18:13:28 -05:00
Andy Ross
86ac7dc10a samples/userspace/shared_mem: Fix SMP race
There was some unlocked initialization code in the "enc" thread that
would race with the "pt" and "ct" threads if another CPU was available
to run them (it was safe on UP because "enc" entered the queue first
and was cooperative, the others wouldn't run until it blocked).

Move it to main() and remove the enc_state guard variable which is no
longer doing anything.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
Andy Ross
4c2fc2aed7 kernel/queue: Fix SMP race
Calling z_ready_thread() means the thread is now ready and can wake up
at any moment on another CPU.  But we weren't finished setting the
return value!  So the other side could wake up with a spurious "error"
condition if it ran too soon.  Note that on systems with a working
IPI, that wakeup can happen much faster than you might think.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
Andy Ross
3235451880 kernel/swap: Add SMP "wait for switch" synchronization
On SMP, there is an inherent race when swapping: the old thread adds
itself back to the run queue before calling into the arch layer to do
the context switch.  The former is properly synchronized under the
scheduler lock, and the later operates with interrupts locally
disabled.  But until somewhere in the middle of arch_switch(), the old
thread (that is in the run queue!) does not have complete saved state
that can be restored.

So it's possible for another CPU to grab a thread before it is saved
and try to restore its unsaved register contents (which are garbage --
typically whatever state it had at the last interrupt).

Fix this by leveraging the "swapped_from" pointer already passed to
arch_switch() as a synchronization primitive.  When the switch
implementation writes the new handle value, we know the switch is
complete.  Then we can wait for that in z_swap() and at interrupt
exit.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
Andy Ross
e06ba702d5 kernel/sched: Address thread abort termination delay issue on SMP
It's possible for a thread to abort itself simultaneously with an
external abort from another thread.  In fact in our test suite this is
a common thing, as ztest will abort its own spawend threads at the end
of a test, as they tend to be exiting on their own.

When that happens, the thread marks itself DEAD and does all its
scheduler bookeeping, but it is STILL RUNNING on its own stack until
it makes its way to its final swap.  The external context would see
that "dead" metadata and return from k_thread_abort(), allowing the
next test to reuse and spawn the same thread struct while the old
context was still running.  Obviously that's bad.

Unfortunately, this is impossible to address completely without
modifying every SMP architecture to add a API-visible hook to every
swap that signals completion.  In practice the best we can do is add a
delay.  But note the optimization: almost always, the scheduler IPI
catches the running thread and kills it from interrupt context
(i.e. on a different stack).  When that happens, we know that the
interrupted thread will never be resumed (because it's dead) and can
elide the delay.  We only pay the cost when we actually detect a race.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
Andy Ross
60247ca149 kernel/sched: Correct IPI usage
These two spots were calling z_sched_ipi() (the IPI handler run under
the ISR, which is a noop here because obviously the current thread
isn't DEAD) and not arch_sched_ipi() (which triggers an IPI on other
CPUs to inform them of scheduling state changes), presumably because
of a typo.

Apparently we don't have tests for k_wakeup() and
k_thread_priority_set() that are sensitive to latency in SMP
contexts...

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
Andy Ross
86430d8d46 kernel: arch: Clarify output switch handle requirements in arch_switch
The original intent was that the output handle be written through the
pointer in the second argument, though not all architectures used that
scheme.  As it turns out, that write is becoming a synchronization
signal, so it's no longer optional.

Clarify the documentation in arch_switch() about this requirement, and
add an instruction to the x86_64 context switch to implement it as
original envisioned.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
Andy Ross
74c582dc06 Revert "x86: qemu_x86_64: workaround SMP issues in x86"
Races seem fixed, at least the ones measurable by existing tests.

This reverts commit 3f3c72a911.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
Henrik Brix Andersen
cf64c6bcca tests: drivers: counter: add user mode test
Add a single counter API test case (not using callbacks) running in
user mode. Convert the existing test setup to use semaphores for
counting events to be able to utilize the same test setup and teardown
functionality in both user and supervisor mode tests.

Most of the counter API basic test suite still needs to run in
supervisor mode due the use of callback functions.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-21 11:36:55 -05:00
Henrik Brix Andersen
0f60477667 drivers: counter: add missing syscalls
Add missing syscalls and fix already present syscalls for the counter
API.

Fixes #14650.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-21 11:36:55 -05:00
Dominik Ermel
9c0fb144ee tests/fs: NFFS has been replaced with Littlefs in multifs tests
With removal of NFFS from Zaphyr it would be no longer possible to
test multifs with NFFS and LittleFS will be now used instead.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-01-21 17:30:03 +01:00
Andrzej Puzdrowski
cbea659ca7 doc/releases: NFFS removal record
Add removal record to the incoming release note.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
cc81e02e17 tests/subsys/fs/multi-fs: suppres kconfig issue
This patch is for suppress CI Kconfig issues caused
by temporary dead code in this test-suie.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
68f51f66c6 doc: cleanup after NFFS removal
Patch introduce references to LittleFS instead of NFFS where it
was suitable. In other places NFFS mentions were removed

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
5f89145d6b boards: remove NFFS mentions from comments/doc
Replaced NFFS mentions by LittleFS in all <board>.dts comments
to storage partitions.
Replaced NFFS by LittleFS in a few boards documentation.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
69c0c43029 manifest: remove nffs reference
NFFS support repository reference was removed
as unneeded anymore by removal of NFFS support in the codebase.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
c0aa294690 fs: remove NFFS subsystem
NFFS is removed as it has serious bugs (by design) which haven't
been resolved since extended range of time.
One of most serious issues bunch were described here:
https://github.com/apache/mynewt-nffs/issues/10

Since lack of support NFFS upsterem it doesn't make sense to keep
it in zephyr.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
b61e6d3787 tests/fs: remove nffs testsuite
NFFS was removed, so it tests need to be removed too.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
f7af1dc3a2 tests/subsys/fs: disable multi-fs testsuite
As multi-fs testsuite uses FS and NFFS it must be disabled
as NFFS was removed. Further thin test should be reworked to use
litlefs in place of NFFS.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
e446505473 tests/subsys/settings/functional/file: use littlefs
Switch to using LittleFS instead of NFFS, which was removed.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
7331a9ea26 samples/subsys/shell/fs: remove nffs configuration
NFFS configuration was removed.
Added working configuration for nRF boards.
Documentation aligned to fact that littlefs is supported.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
e104741b7c samples/subsys/mgmt/mcumgr/smp_svr: use LitleFS as FS back-end
This patch addapt the sample to using LittleFS as the FS back-end.
After NFFS will be removed this ensures mcumgr FS command functionality.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>

smp_svr cleanu
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
7402297b20 tests/lib/gui/lvgl: use littlefs
Switch to using LittleFS instead of NFFS, which will be removed.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski
04b2c170c1 tests/subsys/settings: remove nffs related testsuite
settings nffs targeted test were removed.
the file function settings suite was disabled as need some
rework in order to use litlefs.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Adam Kondraciuk
2ff0105954 drivers: flash: nrfx: Change write_block_size parameter to 32-bits
According to NRF product specifications the smallest write unit is
32-bits. Added parameter 'CONFIG_EMULATE_ONE_BYTE_WRITE_ACCESS'
which allows one byte flash write using more complex operation.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2020-01-21 15:26:23 +01:00
Christian Hirsch
5fcb5d0b75 drivers: counter: fix nRF prescaler overflow
use u32_t in init_rtc to be able to use the full 12 bit prescaler values
fixes #22014

Signed-off-by: Christian Hirsch <christian.hirsch@tuwien.ac.at>
2020-01-21 08:24:11 +01:00
Henrik Brix Andersen
14363db47f doc: release-notes-2.2: mention CANopen protocol support
Mention CANopen protocol support as an enhancements for v2.2.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 22:48:42 -05:00
Henrik Brix Andersen
cfdabcf448 doc: update doc footer copyright year
Update the documentation footer copyright year.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-20 22:48:23 -05:00
Antony Pavlov
f144e39ced boards: arm: add initial support for NUCLEO-L152RE board
The board features a STM32L152RET6 MCU.

Tested samples:

    * hello_world
    * basic/blinky
    * basic/button
    * gui/lvgl + SHIELD=ssd1306_128x64
    * philosophers
    * sensor/hmc5883l
    * subsys/shell/shell_module + CONFIG_EEPROM_SHELL=y
    * synchronization

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2020-01-20 18:08:43 -06:00
Antony Pavlov
fc1cdf233d soc: arm: stm32l1: Add STM32L152Xe stuff
The STM32L151 and STM32L152 differ in that
the STM32L152 features an LCD controller.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2020-01-20 18:08:43 -06:00
David D
22326f6d99 test: drivers: spi: added a test case
Added a test case for calling spi_transceive() with a null tx buffer

Signed-off-by: David D <a8961713@gmail.com>
2020-01-20 18:38:39 -05:00
David D
b96525c82c drivers: spi: Fixing null-pointer dereference in stm32
Fixes #21935

Signed-off-by: David D <a8961713@gmail.com>
2020-01-20 18:38:39 -05:00
Ulf Magnusson
40b49e22ea kernel: kconfig: Make SCHED_IPI_SUPPORTED invisible
Toggling this symbol probably doesn't make sense, because the
architecture is already known when Kconfig runs.

SCHED_IPI_SUPPORTED is enabled through being selected by the ARC_CONNECT
(maybe that one shouldn't be configurable either) and X86_64 symbols.

Note that it's not possible to disable the symbol when it's being
selected, so trying to turn it off on e.g. X86_64 won't work either.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-20 18:38:10 -05:00
Andrzej Puzdrowski
32109512f2 drivers/flash: group nRF sub-option under menuconfig
Grouped all nRF driver sub-option under SOC_FLASH_NRF
menuconfig.

This makes menuconfig cleaner.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-20 18:37:47 -05:00
Marcin Niestroj
bbe8e63c46 spi: stm32: deduplicate code creating SPI instances
Create new instances of SPI using single STM32_SPI_INIT() macro
invocation, similar as it is done for STM32 UART driver. Add also
implicit '#ifdef CONFIG_SPI_id' check, so it further reduces required
lines of code for each SPI instance definition.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-01-20 18:36:24 -05:00
Håkon Øye Amundsen
995e3676f3 cmake: allow appending dependencies to report targets
To facilitate extending the generated reports without having to
patch this file, leverage generator-expression so that
dependencies can be added to the 'zephyr_property_target' target.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-01-20 18:35:01 -05:00