Commit graph

41120 commits

Author SHA1 Message Date
Spoorthi K
cea0982f23 samples: cmsis_rtos_v2: Demo with Dining Philosopher's algorithm
The sample application to demonstrate dining philosopher's problem
implementation using CMSIS RTOS V2 APIs with semaphores and mutexes
as resources (forks).

The application makes use of CMSIS_RTOS_V2 APIs on threads, semaphores
and mutexes.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-21 10:28:10 +01:00
Tavish Naruka
72b0289de4 samples: driver: i2c scanner
Scans i2c bus for any devices present.

Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2018-12-21 10:27:53 +01:00
Robert Lubos
167486f4a4 samples: sockets: Update OT overlays for echo samples
Increase rx stack size for OpenThread overlay, as updated revision of
OpenThread requires more stack to operate.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-21 10:27:33 +01:00
Mieszko Mierunski
4a4e51ffa7 drivers: nrf: Fix UARTE fixup defines.
Due to alias changes, after UARTE is enabled current dts_fixup
is not working.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-12-20 18:32:40 +01:00
Jakub Rzeszutko
e8a77808c0 samples: reel board: correct timeout condition
After this fix each LED will blink 5 times. Previously
LED_0 has been blining 6 times while others 5 times.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-20 18:58:01 +02:00
Armando Visconti
b75a05cae6 driver: sensors: convert lsm9ds0_gyro to use information coming from dts
Convert lsm9ds0_gyro driver to get the device name as well as
i2c slave information and gpio info for triggers from device tree.
Updates the build_all test accordingly.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-20 12:35:46 +01:00
Ioannis Glaropoulos
385bc2604a include: linker: improve documentation of app shared mem symbols
This commit adds minor improvements to the documentation of the
linker symbols related to Application Shared Memory.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-20 12:35:27 +01:00
Martin Turon
6410a16adb openthread: Update openthread version to latest upstream/master.
Update zephyr integration of openthread to latest api as of 2018-12-17:

2a75d30684

Both echo_server and echo_client compile and are operational.

Signed-off-by: Martin Turon <mturon@google.com>
2018-12-20 12:24:51 +01:00
Mark Ruvald Pedersen
0efad5f7fd cmake: Whitespace and commentary fixes
Cosmetics, no functional change expected.
Fixed leading space alignment.
Replaced tabs with spaces.
Emulation error message output is now aligned.

To locate tabs in cmake, the following bash is useful:
grep -PRil "\t" * | grep -i cmake | grep -v ^sanity

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-12-20 12:23:50 +01:00
Rajavardhan Gundi
b6ab4e8a7f tests/cmsis_rtos_v2: Use CONFIG_SCHED_SCALABLE
Using multi-queue scheduler doesn't work for cmsis_rtos_v2 as it
supports a max of only 32 priority levels which is less than the
total priority levels required by cmsis_rtos_v2 (which is 56).
Hence explicitly asking the tests to use the scalable scheduler.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
50d321943e tests/cmsis_rtos_v2: Introduce tests to make use of ThreadFlags APIs
Some test programs to illustrate the usage of ThreadFlags APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
41aa164c85 lib/cmsis_rtos_v2: Implement support for Thread Flags APIs
Thread Flags are used to trigger execution states between threads.
These APIs provide functionalities like set, clear and wait.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
7ffa3455fb tests/cmsis_rtos_v2: Introduce tests to make use of EventFlag APIs
Some test programs to illustrate the usage of EventFlag APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
fa499b353d lib/cmsis_rtos_v2: Implement support for Event Flag APIs
Events are used to trigger execution states between threads.
These APIs provide functionalities like event set, clear and
wait.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
ff911f7fdf tests/cmsis_rtos_v2: Introduce tests to make use of messageQ APIs
Some test programs to illustrate the usage of msgq APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
27f4cd2356 lib/cmsis_rtos_v2: Implement support for Message Queue APIs
These APIs provide message queue functionality like create,
put and get.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
00ffaed189 tests/cmsis_rtos_v2: Introduce tests to make use of mempool APIs
Some test programs to illustrate the usage of mempool APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
e5c848878a lib/cmsis_rtos_v2: Implement support for mempool APIs
These APIs allow creating, allocating and freeing of mempools.

Note: "Mempool" in CMSIS actually means memslabs in Zephyr.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
c58733c302 tests/cmsis_rtos_v2: Introduce tests to make use of Semaphore APIs
Some test programs to illustrate the usage of Semaphore APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
b39f6268c1 lib/cmsis_rtos_v2: Implement support for semaphore APIs
These APIs allow creating, acquiring, releasing and deleting
of semaphores.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
a1eaa23fe3 tests/cmsis_rtos_v2: Introduce tests to make use of Mutex APIs
Some test programs to illustrate the usage of Mutex APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
19b57ce2e8 lib/cmsis_rtos_v2: Implement support for mutex APIs
These APIs allow creating, acquiring, releasing and deleting
the mutexes.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
2b22e30888 tests/cmsis_rtos_v2: Introduce tests to make use of Timer APIs
Some test programs to illustrate the usage of timer APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
0285c69a3a lib/cmsis_rtos_v2: Implement support for timer APIs
These APIs provide the support of virtual timers. All timers
can be started, restarted, or stopped. Timers can be configured
as one-shot or periodic.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
d6c50517d9 tests/cmsis_rtos_v2: Introduce tests to make use of Thread APIs
Some test programs to illustrate the usage of thread APIs.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
7d499e3471 lib/cmsis_rtos_v2: Implement support for generic wait APIs
APIs to introduce wait i.e osDelay and osDelayUntil are defined
here. They are analogous to k_sleep in the kernel.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
e3fe0cafab lib/cmsis_rtos_v2: Implement support for Kernel APIs
Implement support for Kernel management APIs like
osKernelInitialize, osKernelGetTickCount, osKernelGetSysTimerCount
etc.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
4af7b6ccf4 lib/cmsis_rtos_v2: Implement support for thread APIs
These APIs allow defining, creating and controlling of thread
related functionalities.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Rajavardhan Gundi
b609175aff CMSIS RTOS V2: Introduce CMSIS RTOS V2 API header file
CMSIS RTOS API provides a generic RTOS interface for embedded
processors (actually for Cortex-M processors but are generic
enough to be used elsewhere). This header file is for V2 version.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-20 12:23:22 +01:00
Paul Sokolovsky
2ffb951630 console: Kconfig: Update for recent changes
Buffer sizes aren't required to be power of 2 for a while. Describe
that by setting buffers sizes to 0, one can get non interrupt driven
operation.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-20 12:21:49 +01:00
Paul Sokolovsky
0925411356 tty: Remove buffer params from tty_init()
Let's have more orthogonal and cleaner API, where buffers are
configured by tty_set_rx_buf/tty_set_tx_buf, and only them. It
means that newly initialized tty starts in unbuffered mode, which
is somewhat a sidestep from a main usecase behind tty, which is
buffered operation, but again, having a cleaner API (and good
docs, explaining users how it should be and what they should do)
prevails.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-20 12:21:49 +01:00
Paul Sokolovsky
a7df3a1e09 tty: Support unbuffered operation to extend usecase coverage
The whole "tty" concept is conceived around efficient
interrupt-driven operation. However, it's beneficial to add
non interupt-driven operation under the same API:

1. Wider usecase coverage in general.
2. Allows to use the same familiar API (based on POSIX concepts)
even for UART implementations without interrupt support.
3. Allows to switch operation dynamically based on the needs.
For example, if the system is in degraded mode and interrupt
handling cannot be trusted/disabled, allows to still output
diagnostic information to user. This was the original motivation
to provide such a mode, to support logging subsystem's "panic"
mode.

To implement this feature, tty_set_rx_buf() and tty_set_tx_buf()
functions are provided, allowing to reconfigure buffers used
dynamically. If configured buffer length is 0, the operation
switched to unbuffered.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-20 12:21:49 +01:00
Ioannis Glaropoulos
fe2f30ad4c dts: nordic: simplify definition of flash and sram sizes in dts
We only need to add the reg property in flash0 and sram0,
in the different DTS headers for the nRF SOCS. We do not
seem to need to define the nodes again. This commit applies
this simplification for flash and sram sizes definition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-20 12:21:23 +01:00
Mark Ruvald Pedersen
6e158b1794 cmake: Document CMAKE_SYSTEM_-variables, and add CMAKE_SYSTEM_VERSION
Aid user in understanding what CMake expects of:

 * Document and add CMAKE_SYSTEM_VERSION
 * Document CMAKE_SYSTEM_NAME
 * Document CMAKE_SYSTEM_PROCESSOR
 * Document BUILD_SHARED_LIBS
 * Document Policies CMP0002, CMP0079

CMAKE_SYSTEM_VERSION is required officially by CMake, but appears
unused -- at least now we are compliant.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-12-20 11:15:20 +01:00
Mark Ruvald Pedersen
59036db195 cmake: Move root CMakeLists.txt's comment-header to top
Inform user early on that ./CMakeLists.txt is not the top-level file.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-12-20 11:14:59 +01:00
Mark Ruvald Pedersen
94a9d8086c cmake: boilerplate: move compiler-flag checks into boilerplate
CheckCCompilerFlag and CheckCXXCompilerFlag does not belong to
extensions.cmake since they are standard CMake files. Boilerplate
seems more appropriate.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-12-20 11:14:20 +01:00
Mark Ruvald Pedersen
5e90da7bef cmake: Remove setting CMAKE_FIND_ROOT_PATH_MODE_* variables
These variables affect how CMake locates programs, libraries, include
files, and CMake packages. But the defaults are sufficient for Zephyr.

NEVER: Only host system's root will be searched.
ONLY: Only the paths specified by a variable will be searched. Typically
      these paths point to cross-compilers.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-12-20 11:14:02 +01:00
Mark Ruvald Pedersen
722f86652c cmake: boilerplate: Move app-library to be with its documentation
Move documentation and declaration to be in the same place.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-12-20 11:13:44 +01:00
Andrzej Puzdrowski
3f422e2efe drivers: flash: fix the regular access range check
The check was susceptible for overflow.
This patch corrects this malfunction.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-19 17:47:08 +01:00
Andrzej Puzdrowski
cd4fbdeac8 drivers: flash: support NRF UICR operations
Nordic UICR are non-volatile memory registers for
configuring user-specific settings. Basically it is subset of flash
memory available in the SoC.

Add support for operations on NVM which belongs to UICR.
UICR are written or read as ordinary flash memory.
For erasing UICR it is required to call erase with UICR start
address and its size (this is caused by what hardware supported).

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-19 17:47:08 +01:00
Marti Bolivar
15384b79c3 scripts: west: fix 'west debug'
We can't invoke west's main as a subprocess, or control-C from GDB in
a 'west debug' will terminate the program. Import it and run main as a
function in the same process instead.

Clean up some cruft and remove unused code while we're here, to keep
this file shorter.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-12-19 17:34:14 +01:00
Ravi kumar Veeramally
95c7079433 samples: net: Port mbedtls benchmark sample to zephyr
This application benchmarks the various cryptographic primitives
offered by mbed TLS.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-12-19 16:24:03 +01:00
Dhananjay Gundapu Jayakrishnan
bfe0c2e748 drivers: sensor: temp_nrf5: update assert condition in nRF temp sensor
nRF 16MHz clock is used by both BLE radio and temperature sensor.
During BLE connection if the temperature sensor is also used then
at some point assert condition is hit in temp_nrf5_sample_fetch().
The error code -EBUSY seen during clock_control_off() is that clock
is no longer needed for the temperature sensor, but it cannot be
just turned off because it is still needed for BLE connection.

Signed-off-by: Dhananjay Gundapu Jayakrishnan <dhananjay.jayakrishnan@proglove.de>
2018-12-19 09:03:47 -06:00
Kumar Gala
90fbeb0a10 dts: nrf: Fix missed device tree warnings
Fix the following warning that shows up in some NRF device tree files:

	Warning (simple_bus_reg): /soc/pwm@4002D000: simple-bus unit
	address format error, expected "4002d000"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-19 08:26:22 -06:00
Robert Lubos
82d956fdf8 drivers: ieee802154: nrf5: Prevent driver from spamming logs
ieee802154_nrf5 uses net_analyze_stack function in a loop, which
prints logs at inf level. As net_core's log level is used in
this function which by default is set to inf, it kept spamming stack
usage logs.

Prevent this behavior by adding additional log level check in the driver
itself, so that this log will only be printed if
IEEE802154_DRIVER_LOG_LEVEL is set to debug.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-19 08:20:55 -06:00
Kumar Gala
e9a1d6493d dts: arm: nxp: imx: Use 'nxp,imx-{i,d}tcm' compatible
On i.mx6/7 the TCMU and TCML regions are specific to instruction or
data.  So use the nxp,imx-itcm for TCML and nxp,imx-dtcm for TCMU.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-19 08:14:33 -06:00
Kumar Gala
f7a8ed75ae dts: Rename imx-rt-{i,d}tcm compatible
The imx-rt-{i,d}tcm bindings can actually be utilized on the i.MX6/7 as
well for the TCM{L,U} regions of memory as they are specific to
instruction or data.

So let's rename imx-rt-{i,d}tcm to imx-{i,d}tcm.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-19 08:14:33 -06:00
Krzysztof Chruscinski
1cc9e98ae6 logging: Refactor RTT backend to handle host absence
Refactored blocking operation of RTT backend. Log_output buffer
is used directly in case of blocking operation. Detection of
host presence added. Prevent use of RTT lock when in panic mode.
Removed pending on data being read by the host on every message.

Refactor gives savings of 300 bytes in ROM and 120 bytes in RAM.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-19 14:53:48 +01:00
Vinayak Kariappa Chettimada
99ae80b632 Bluetooth: controller: Fix Conn Param Req procedure stall issue
Fix an issue wherein local or remote initiated Connection
Parameter Request procedure would stall without generation
of LE Connection Update Complete HCI event because a local
or remote initiated PHY Update procedure has overwritten the
currently active Link Layer Control Procedure type.

Signed-off-by: Vinayak Kariappa Chettimada <vinayak.kariappa@gmail.com>
2018-12-19 14:47:38 +01:00
Flavio Ceolin
e40c9525d4 arch: arm: Explicitly ignoring return of memcpy
According with MISRA-C the value returned by a non-void function has
to be used. As memcpy return is almost useless, we are explicitly
ignoring it.

MISRA-C rule 17.7

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-19 14:37:25 +01:00