Commit graph

41120 commits

Author SHA1 Message Date
Carlo Caione
25769e3fff samples: cmsis_rtos_v1: Grow stack size to the maximum allowed
Some architectures require more space on the stack when running samples
and tests while the philosopher test (cmsis_rtos_v1) is still using a
fixed-size stack size.

Since the test is going to use CMSIS v1 we cannot directly use
CONFIG_TEST_EXTRA_STACKSIZE to grow the stack size because the extra
space allocated can excess the maximum size allowed by CMSIS and defined
by CONFIG_CMSIS_THREAD_MAX_STACK_SIZE, causing the sample to halt on the
assertion (thread_def->stacksize <= CONFIG_CMSIS_THREAD_MAX_STACK_SIZE).

To avoid this problem (and align the test to what has been already done
on the philosopher test using CMSISv2) we set the stack size to the
maximum allowed size of CONFIG_CMSIS_THREAD_MAX_STACK_SIZE.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-01-20 18:33:34 -05:00
Ioannis Glaropoulos
7fee3efd99 soc: arm: remove explicit selection of already selected symbols
CPU_CORTEX_M_HAS_SYSTICK and CPU_CORTEX_M_HAS_VTOR do not need
to be explicitely selected in SoC/Boards definitions of
platforms implementing the Cortex-M mainline architecture; they
are already selected by ARMV7_M_ARM8_M_MAINLINE Kconfig symbol.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-20 17:23:42 -05:00
Anas Nashif
2711c4e03f tests: test k_sem_init()
Add tests for k_sem_init.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
756d8b03e2 kernel: queue: runtime error handling
Runtime error handling for k_queue_append_list and k_queue_merge_slist.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
1ed67d1d51 kernel: stack: error handling
Add runtime error checking for both k_stack_push and k_stack_cleanup.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
11b9365542 kernel: msgq: error handling
Add runtime error handling for k_msgq_cleanup. We return 0 on success
now and -EAGAIN when cleanup is not possible.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
dfc2bbcd3c kernel: mem_slab: error handling
Add runtime error checking for k_mem_slab_init and replace asserts with
returning error codes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
154af912e8 kernel: work_q: error handling
When trying to cancel a NULL work queue return -EAGAIN.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
361a84d07f kernel: pipe: runtime error checking
Add runtime error checking to k_pipe_cleanup and k_pipe_get and remove
asserts.
Adapted test which was expecting a fault to handle errors instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
5076a83ef5 kernel: semaphore: optimize code
Remove static helper functions used only once and integrate them into
calling functions.
In k_sem_take, return at the end.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
928af3ce09 kernel: semaphore: k_sem_init error checking
Check for errors at runtime and stop depending on ASSERTs.
This changes the API for
- k_sem_init

k_sem_init now returns -EINVAL on invalid data.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
86bb2d06d7 kernel: mutex: add error checking
k_mutex_unlock will now perform error checking and return on failures.

If the current thread does not own the mutex, we will now return -EPERM.
In the unlikely situation where we own a lock and the lock count is
zero, we assert. This is considered an undefined bahviour and should not
happen.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Anas Nashif
22b95a2047 base: add error checking macros
Define there options for runtime error handling:
- assert on all errors (ASSERT_ON_ERRORS)
- no runtime checks (no asserts, no runtime error handling)
  (NO_RUNTIME_CHECKS)
- full runtime error handling (the default) (RUNTIME_ERROR_CHECKS)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Dominik Kilian
b536dc20c6 debug: tracing: Fix time returned by CPU stats module
Function cpu_stats_get_ns from CPU stats module returns
invalid time, because of unnecessary conversion into u32_t.
Higher bits of time value are removed during this conversion.
All time values are u64_t, so there is no need to convert anything.

Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
2020-01-20 13:55:11 -05:00
Erwan Gouriou
87a440b8c6 dts: stm32: Define stm32l073 as stm32l072 superset
STM32L073 soc variant is a STM32L072 with LCD peripheral.
Reflect this in dts definition by including stm32l072.dtsi
in stm32l073.dtsi.
This also allows to fix an issue on stm32l073 gpioe which
declared wrong reg definition.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-20 12:17:31 -06:00
Krzysztof Chruscinski
5c7c0713b8 tests: drivers: counter: Add delay for clock stabilization
On nRF platforms, Xtal LF clock source starts hundreds of milliseconds.
Until it is not started, test may fail due to wrong timing. Add initial
delay in the test for required clocks complete their start-up.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-01-20 18:23:55 +01:00
Joakim Andersson
813e5bdd7a Bluetooth: host: Refactor use of #ifdef to IS_ENABLED()
Refactor use of #ifdef to IS_ENABLED() pattern for handling cancellation
of outgoing connection attempt. Reduce the amount of indentation by
combining outer if-statements.
Move handling of canceled create connection into a helper function.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
64b890463d Bluetooth: host: Fix advertiser with identity switches to RPA
Fix advertiser requested to use the identity address while privacy
feature is enabled will change to using RPA address when advertise is
resumed or when RPA timeout occurred.
RPA timeout does not need to run when advertiser is using identity.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
93d25321b6 Bluetooth: shell: Add shell command for advertise with identity option
Add shell command for advertise with identity option to have the
possibility to temporarily disable privacy feature in the advertise from
the shell.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
fbe3285bfa Bluetooth: host: Handle initiator at RPA timeout
Handle initiator role when RPA timeout expires. For direct connect
establishment procedure we make sure the RPA is refreshed when starting
initiator and limit the timeout to the RPA timeout.
For auto establishment procedure we cancel the initiator and restart it
again in the connection complete event that is generated when canceling
an initiator.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
99662c63bc Bluetooth: host: Handle starting roles with different random address
Handle starting of advertiser and scanner or initiator when advertiser
is using a different identity than the default identity to generate the
random resolvable address in the controller.
We need to handle this only for the privacy case because the random
address is set in the RPA timeout handler and not from the API.
When privacy is disabled we can return error code from the LE Set Random
Address HCI command instead.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
4876a8f39a Bluetooth: host: Handle scanner active at RPA timeout
Fix RPA timeout handling when the scanner is active. An active scanner
must be restarted at RPA timeout otherwise the Set Random Address
command will fail.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
137f704064 Bluetooth: host: Refactor initiator to common code and initiator state
Refactor the handling of sending the LE Create Connection command and
for whitelist and direct initiator to use the same host state flag
and common handling of the privacy address.
Also simplify the way we check if the procedure has already been started
when application tries to start it again.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
6c1f52dff7 Bluetooth: host: Set conn state before sending HCI command
Handle a possible race condition in the host connection state.
Set the conn state of the connection object before command is sent. This
is in case the calling function is not scheduled again before the
connection complete event arrives. In this case find_pending_conn will
not find the connection object.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
cc6b8c3a6f Bluetooth: host: Ifdef starting of background scanner in init
Starting a background scanner for auto-connection is an API that is only
available when whitelist API is not enabled.
There is currently no way to set this bit when the whitelist API is
enabled so there is not any issues with the current code, but it is
still not correct.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Joakim Andersson
0861c8c834 Bluetooth: host: Disconnect connection if no conn object is available
When receiving a connection complete event but no connection object are
available in the host something strange has happened. In this case
the controller might have a connection that cannot be controlled by the
application. It would then be sensible to disconnect this connection in
the controller.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-20 18:58:02 +02:00
Johann Fischer
12435e5e6c shields: remove link board can
Remove link board can, shield was discontinued in
prototype status and will be replaced by a successor.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-20 11:50:48 -05:00
Henrik Brix Andersen
5ecc6698b9 samples: canbus: add CANopen sample
Add sample demonstrating the integration of CANopenNode in Zephyr to
support the CANopen protocol.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Henrik Brix Andersen
308f204952 canbus: canopen: add LED indicator support
Add support for CANopen LED indicators according to the CAN in
Automation (CiA) 303-3 specification.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Henrik Brix Andersen
2dcbd8bbc1 canbus: canopen: add object dictionary storage
Add support for storing the CANopen object dictionary to non-volatile
storage.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Henrik Brix Andersen
56f74da757 canbus: canopen: add zephyr driver layer for CANopenNode
Add a Zephyr driver and abstraction layer for use by the 3rd party
CANopenNode module.

CANopenNode depends on the CO_driver.h file for platform-specific type
definitions, locking primitives, and CAN bus driver API.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Henrik Brix Andersen
ef33cb6d43 modules: add CANopenNode
Include the CANopenNode CANopen stack as a module in Zephyr.
CANopenNode is licensed under the Apache-2.0 license.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Henrik Brix Andersen
66e109cab7 drivers: can: flexcan: use initialization from MCUX v2.7.0
Update the NXP Kinetis FlexCAN driver to use the initialization
parameters for disabling self-reception and enabling listen-only mode
added in MCUXpresso v2.7.0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 09:25:02 -06:00
Christian Taedcke
2d9750734c net: ipv6: Add routing according to interface prefix
If no other route is found, the network interface prefixes are
evaluated. If a matching interface is found, the packet is sent out on
this interface.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-01-20 17:22:49 +02:00
Christian Taedcke
6dc1904b9d net: ipv6: Set INET6 addr family before routing the rx packet
The address family of the received packet must be set, before routing
it. E.g. the ethernet driver would drop the packet if this is not
done.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-01-20 17:22:49 +02:00
Jan Van Winkel
b153f0b914 drivers: display: Add support for RGB565 to SDL display
Added support for RGB565 and BGR565 to SDL display driver

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Jan Van Winkel
6ebd0e3f02 samples: display: Added support for BGR565
Added support for BGR565 to display sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Jan Van Winkel
9041b0f119 drivers: display: Set mcux elcdif pixel format to BGR565
Return BGR565 as supported mcux elcdif pixel format for RK043FN02H
display panel.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Jan Van Winkel
9814e743fd driver: display: Added BGR565 pixel format
Added BGR565 pixel format ti display format enumeration.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Jan Van Winkel
ecaa7102d2 driver: display: Clarified byte order of pixel formats
Clarified that the byte order of multi byte pixel formats is in big
endian order.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Ulf Magnusson
c08565dad4 doc: Link to Documentation Generation from Documentation Guidelines
Gerson Fernando Budke missed the Documentation Generation page. Nice to
link to it from the Documentation Guidelines page, in case people are
looking for documentation information and find it first.

Maybe the two pages could be put under a common Documentation section
too, though it's nice to have Documentation Generation clearly visible
in the top-level User Guides index.

Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-20 10:12:19 -05:00
Ulf Magnusson
1810840afe doc: Move Documentation Guidelines right after Documentation Generation
List Documentation Guidelines right after Documentation Generation in
the index for User and Developer Guides. Makes it easier to spot.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-20 10:12:19 -05:00
Ioannis Glaropoulos
1d60bca3fe soc: arm: arm: Select CPU DWT feature symbol for ARM Cortex-M SoCs
The Data Watchpoint and Trace (DWT) is an optional debug unit
for the Cortex-M family cores (except ARMv6-M; i.e. M0 and M0+)
that provides watchpoints, data tracing and system profiling
capabilities. We select it for the ARM Cortex-M SoCs
- Beetle
- Musca A, Musca B
since it is present in these SoCs.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-20 14:05:47 +01:00
Stephanos Ioannidis
155c1f5ffe soc: arm: ti_simplelink: Select CPU DWT feature symbol
The Data Watchpoint and Trace (DWT) is an optional debug unit for the
Cortex-M family cores (except ARMv6-M; i.e. M0 and M0+) that provides
watchpoints, data tracing and system profiling capabilities.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-20 14:05:47 +01:00
Stephanos Ioannidis
4cef583dc7 soc: arm: ti_lm3s6965: Select CPU DWT feature symbol
The Data Watchpoint and Trace (DWT) is an optional debug unit for the
Cortex-M family cores (except ARMv6-M; i.e. M0 and M0+) that provides
watchpoints, data tracing and system profiling capabilities.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-20 14:05:47 +01:00
Stephanos Ioannidis
88d79a49d2 soc: arm: st_stm32: Select CPU DWT feature symbol
The Data Watchpoint and Trace (DWT) is an optional debug unit for the
Cortex-M family cores (except ARMv6-M; i.e. M0 and M0+) that provides
watchpoints, data tracing and system profiling capabilities.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-20 14:05:47 +01:00
Stephanos Ioannidis
f9453832aa soc: arm: silabs_exx32: Select CPU DWT feature symbol
The Data Watchpoint and Trace (DWT) is an optional debug unit for the
Cortex-M family cores (except ARMv6-M; i.e. M0 and M0+) that provides
watchpoints, data tracing and system profiling capabilities.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-20 14:05:47 +01:00
Stephanos Ioannidis
d658883a7c soc: arm: nxp_lpc: Select CPU DWT feature symbol
The Data Watchpoint and Trace (DWT) is an optional debug unit for the
Cortex-M family cores (except ARMv6-M; i.e. M0 and M0+) that provides
watchpoints, data tracing and system profiling capabilities.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-20 14:05:47 +01:00
Stephanos Ioannidis
09843584ec soc: arm: nxp_kinetis: Select CPU DWT feature symbol
The Data Watchpoint and Trace (DWT) is an optional debug unit for the
Cortex-M family cores (except ARMv6-M; i.e. M0 and M0+) that provides
watchpoints, data tracing and system profiling capabilities.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-20 14:05:47 +01:00
Stephanos Ioannidis
16bb973044 soc: arm: nxp_imx: Select CPU DWT feature symbol
The Data Watchpoint and Trace (DWT) is an optional debug unit for the
Cortex-M family cores (except ARMv6-M; i.e. M0 and M0+) that provides
watchpoints, data tracing and system profiling capabilities.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-20 14:05:47 +01:00