Commit graph

98463 commits

Author SHA1 Message Date
Jakub Rzeszutko e59b8cbef9 subsys : shell : Added API changing prompt
1. Added API to change shell prompt in runtime.
2. Added prompt buffer length configuration in Kconfig.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-09-24 13:17:24 +02:00
Johan Hedberg 559578c09a Bluetooth: Add API to iterate through existing bonds
So far the stack hasn't provided any way for the application to access
the existing bonds. This patch adds such an API.

Fixes #10122

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-24 13:27:26 +03:00
Alberto Escolar Piedras 204acc8232 subsys: logger: fix merge error
Fix merge error introduced in:
ba01a3952f
(as part of #9362)
which deleted the native_posix backend for the logger.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-24 12:06:12 +02:00
Luiz Augusto von Dentz 8c02af73be Bluetooth: shell: Add l2cap-recv command
This adds l2cap-recv which can be used to set a delay when confirming
the receptions of packets:

> l2cap-recv 1000
Incoming conn 0x00401c20
Channel 0x004220c8 connected
Channel 0x004220c8 requires buffer
Incoming data channel 0x004220c8 len 230
00000000 00 00 00 00 e6 00 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000010 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000020 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000030 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000040 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000050 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000060 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000070 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000080 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
00000090 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000a0 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000b0 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000c0 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000d0 7f 7f 7f 7f 7f 7f 7f 7f  7f 7f 7f 7f 7f 7f 7f 7f
000000e0 7f 7f 7f 7f 7f 7f
Delaying response...
Confirming reception

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Luiz Augusto von Dentz 9f79862300 net: buf: Use net_buf_add_mem in net_buf_append_bytes
This ensures the memory copies are properly logged when debug is
enabled.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Luiz Augusto von Dentz 16fdd74908 Bluetooth: L2CAP: Make use of net_buf_append_bytes
This uses net_buf_append_bytes to reassemble the SDU segments instead of
doing it manually.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Luiz Augusto von Dentz da83616ede Bluetooth: L2CAP: Fix identation of struct members
Align identation of struct members.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Luiz Augusto von Dentz 62f41df283 Bluetooth: L2CAP: Prevent the channel to stall
If the remote stack is not able to fully utilize each segment it is
possible it would run out of credits before completing the SDU, these
changes detects if that would happen and attempt to restore enough
credits for the SDU to be received.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Luiz Augusto von Dentz 8af4786e9f Bluetooth: L2CAP: Restore credits after receiving an SDU
This simplify the logic of restoring the credits after each SDU instead
of using an arbitrary threshold which was not configurable per channel.

Because the credits are restored only when the full SDU has been
reassembled it means the channels needs to be set up with enough for
the configured MTU otherwise there is a risk of the channel to run out
of RX credits before the packet is fully reassembled, because of such
corner case the code will now warn if a channel is setup with not enough
init_credits.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Luiz Augusto von Dentz 3151d26572 Bluetooth: L2CAP: Add return to recv
This adds a int return to recv callback which can be used to notify the
stack about errors when receiving a packet. In addition to that the user
can return -EINPROGRESS to inform the stack the data will be processed
asynchronously which can be complete by calling
bt_l2cap_chan_recv_complete.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Joakim Andersson 0287a04340 Bluetooth: host: Fix name conflict with kernel smp_init in smp.c
When activating SystemView internal kernel header files will be
included. This causes a name conflict with smp_init in smp.c
and smp_init in kernel_internal.h

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2018-09-24 10:53:20 +03:00
Johan Hedberg cf6f87f25b Bluetooth: samples/peripheral_sc_only: Improve logging
The periphreal_sc_only sample app wasn't very clearly logging
information about pairing failures and could give the false
impression that everything work when it doesn't. Enable some more
logging Kconfig features and take advantage of the pairing complete &
failed callbacks to give more information to the user.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-24 10:48:40 +03:00
Anas Nashif d5d902a140 Revert "sanitycheck: fail on check_compliance issues"
This reverts commit 43398eb240.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-23 16:40:13 -04:00
Anas Nashif ba4643b778 sanitycheck: remove special ansi charachters from xml
XML does not like special ansi charachters (coming from logger), so
remove them.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-23 13:04:05 -04:00
Anas Nashif 43398eb240 sanitycheck: fail on check_compliance issues
We were forcing sucess even if check_compliance had failed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-23 13:04:05 -04:00
Anas Nashif b3829adc78 samples: shell: enable kernel shell
Enable kernel shell and adapt test data and remove limited whitelisting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-23 11:43:33 -04:00
Krzysztof Chruscinski 73c01f9e9f shell: modules: Adapt kernel commands to new shell
Kernel commands ported to new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-23 11:43:33 -04:00
Krzysztof Chruscinski 8feab483c9 shell: fix shell_log_backend dependency
Fixed case when shell_log_backend.c was included even though
shell was disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-22 22:28:17 -04:00
Anas Nashif 780c1c28ee doc: Update intro with ble mesh and kernel features
Expand introduction about Zephyr with additional details.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-22 06:53:55 -04:00
Bryan O'Donoghue 674ccd3698 boards: arm: atsamd21: Add SAMD21 XPlained board
This patch adds support of the SAMD21 XPlained board. The board has a
similar pinout to the SAMD20 XPlained with a different pin-mapping.

Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
2018-09-21 17:52:32 -07:00
Bryan O'Donoghue 343c48f7d0 arch: atmel_sam0: sam21j18a: Convert _U to __U to fix compile warning
Fix compilation of sam0 serial driver on sam21dj18a by converting _U()
to __U() and _L() to __L() in sam21dj18a.h.

Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
2018-09-21 17:52:32 -07:00
Kamil Piszczek e48434bc71 Bluetooth: gatt: gatt_discover_next with inclusive handle range
This fix ensures that the handle range used for next GATT discovery is
always inclusive. Previously, the discovery procedure could not be
started with equal value of start and end handle.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2018-09-21 18:52:52 -04:00
Sebastian Bøe 350c3d7734 dts: Simplify overlay build scripts
Miscellaneous refactorings to simplify the overlay build scripts.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-21 18:51:26 -04:00
Erwan Gouriou 242c729539 doc: provide shield usage documentation
Following introduction of shield feature,
provide requested documentation.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 18:51:26 -04:00
Erwan Gouriou 7ee8b7a512 samples: Provide x-nucleo-iks01a1 shield sample
This sample is made to demonstrate use of shield x-nucleo-ik01a1.
It will display embedded sensor data endlessly.
It requires a board with Arduino i2c as minimum configuration

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 18:51:26 -04:00
Erwan Gouriou 6af514b67f build: enable shields dir treatment
In dts.cmake, build shield list. For each shield, check if
associate KCONFIG is enabled and if it is, add matching files
to following new cmake variables:
-DTC_SHIELD_OVERLAY_FILE
-DTC_SHIELD_FIXUP
Then, consume these variables when needed.

Shield overlay is conceived as the very first overlay applied
to the board dts. It intends to build a new board that should
then behave as any other board versus common or user's overlay.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 18:51:26 -04:00
Erwan Gouriou ec408d3a12 boards: add support for shields x-nucleo-iks01a1 and -iks01a2
Provide definition files for x-nucleo-iks01a1 and
x-nucleo-iks01a2 arduino shields

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 18:51:26 -04:00
Nazar Chornenkyy 3591c85290 boards: arm: Add Cypress PSoC6 cy8ckit_062_wifi_bt_m4 board support
Added cy8ckit_062_wifi_bt_m4 board configuration to build FW for CM4
core.
CM4 core does not start itself, it have to be started by CM0+ FW.

Signed-off-by: Nazar Chornenkyy <nazar.chornenkyy@cypress.com>
Signed-off-by: Oleg Kapshii <oleg.kapshii@cypress.com>
2018-09-21 18:50:59 -04:00
Nazar Chornenkyy b9b2e58db4 boards: arm: Add Cypress PSoC6 cy8ckit_062_wifi_bt_m0 board support
Added cy8ckit_062_wifi_bt_m0 board configuration to build FW for CM0+
core.

Signed-off-by: Nazar Chornenkyy <nazar.chornenkyy@cypress.com>
Signed-off-by: Oleg Kapshii <oleg.kapshii@cypress.com>
2018-09-21 18:50:59 -04:00
Nazar Chornenkyy edd6c7df41 drivers: serial: Add Cypress PSoC6 UART driver
Added basic PSoC6 UART driver and added two UART nodes in the PSoC6
device tree to have output from CM0+ and CM4 cores.

Signed-off-by: Nazar Chornenkyy <nazar.chornenkyy@cypress.com>
Signed-off-by: Oleg Kapshii <oleg.kapshii@cypress.com>
2018-09-21 18:50:59 -04:00
Nazar Chornenkyy 93f938c44e arm: Add Cypress PSoC6 SoC support
Added initial support and created the corresponding device tree part for
building PSoC6 SoC as part of Zephyr.

Signed-off-by: Nazar Chornenkyy <nazar.chornenkyy@cypress.com>
Signed-off-by: Oleg Kapshii <oleg.kapshii@cypress.com>
2018-09-21 18:50:59 -04:00
Kumar Gala 4d6b662149 ext: hal: cypress: Protect floating point code with CONFIG_FLOAT
There is a little bit of floating point code in cy_sysclk.c.  For now
add compile protection for this code using CONFIG_FLOAT.  This code
utilizes some libm functions like ceil().  So if / when the functions
Cy_SysClk_EcoConfigure & Cy_SysClk_FllConfigure are needed we'll also
new to probably pull in newlib.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-21 18:50:59 -04:00
Nazar Chornenkyy 2aa3815a09 ext: hal: cypress: Integrate Cypress PDL into Zephyr Build system
Add initial support for building Cypress PDL as part of Zephyr.

Signed-off-by: Nazar Chornenkyy <nazar.chornenkyy@cypress.com>
Signed-off-by: Oleg Kapshii <oleg.kapshii@cypress.com>
2018-09-21 18:50:59 -04:00
Nazar Chornenkyy 650852703e ext: hal: cypress: Import Cypress PDL for PSoC6 SoC Support
This includes:
* the Cypress Peripheral Driver Library (PDL) For PSoC6 SoC.

Origin: Cypress PDL for PSoC6
URL: https://github.com/cypress/pdl
Version: 3.1.0 (SHA: 2af49fe057320981c11117462a0962d956fc3056)
Purpose: Add support for Cypress PSoC SoC
License: Apache
Maintained-by: External

Signed-off-by: Oleg Kapshii <oleg.kapshii@cypress.com>
Signed-off-by: Nazar Chornenkyy <nazar.chornenkyy@cypress.com>
2018-09-21 18:50:59 -04:00
Alexander Polleti f568673e1b c++: Fix compilation of C++ file that includes i2c.h
Within a C++ file I include i2c.h and got 6 of the following errors:

zephyr/include/i2c.h:199:42: error: invalid conversion from
	‘const void*’ to ‘const i2c_driver_api*’ [-fpermissive]
  const struct i2c_driver_api *api = dev->driver_api;
                                     ~~~~~^~~~~~~~~~

I fixed it with a c style conversion for each instance, so
const struct i2c_driver_api *api = dev->driver_api;
becomes

const struct i2c_driver_api *api =
	(const struct i2c_driver_api *)dev->driver_api;

I handled the instances for i2c_slave_driver_api alike.

I tested this with a one of my own boards and communication with a
I2C sensor.

Signed-off-by: Alexander Polleti <metapsycholo@gmail.com>
2018-09-21 18:49:52 -04:00
Sebastian Bøe 72e7bfa680 cmake: Remove unnecessary KCONFIG_ROOT configuration
It is no longer necessary to set the KCONFIG_ROOT variable when the
KConfig file is in the application root directory.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-21 13:37:21 -04:00
Sebastian Bøe 89a197be84 cmake: Re-direct KCONFIG_ROOT when convention is used
Automatically detect the Kconfig file in it's conventional placement
${APPLICATION_SOURCE_DIR}/Kconfig and set KCONFIG_ROOT accordingly.

'Convention over configuration' is an imporant principle for
minimizing metadata and keeping things consistent. We use this
principle for instance with the file prj.conf.

This commit applies this principle to also re-direrct KCONFIG_ROOT.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-21 13:37:21 -04:00
Findlay Feng 3c834bdf27 kernel: Fix list-node add again corruption case in timeout handling
The node of the timeout temporary list cannot be continued
to index the next node after being added again.

Signed-off-by: Findlay Feng <i@fengch.me>
2018-09-21 13:29:09 -04:00
Anas Nashif 0f55538762 gitlint: accept "'" in committer names
Allow "'" in names, for example xxx O'xxx.

Fixes #10152

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-21 12:49:23 -04:00
Andrzej Głąbek 7ed7d535e9 drivers: adc: nrfx: Use SAADC HAL for setting the burst mode
Replaces direct accesses to the peripheral registers structure
with the proper SAADC HAL function that appeared recently in nrfx.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-09-21 09:12:14 -07:00
Andrzej Głąbek 11716e4664 ext: hal: nordic: Update nrfx adaptation layer
Adds new entries needed by nrfx in version 1.3.0 so that it is
properly adapted for being used in Zephyr.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-09-21 09:12:14 -07:00
Andrzej Głąbek 836cb5b76a ext: hal: nordic: Update nrfx to version 1.3.0
Updates nrfx to the recently released version containing new drivers
for NFCT and USBD peripherals and enhanced SAADC HAL.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v1.3.0
commit: 67710e47c7313cc56a15748e485079831ee6a3af
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-09-21 09:12:14 -07:00
Maureen Helm d2d076445c tests: build_all: Add missing dts fixups for apds9960
The apds9960 sensor driver recently added support for trigger mode, but
the gpio dts fixups weren't added to the build_all test. Adds the
missing dts fixups and updates the sensor trigger test to include the
apds9960 sensor driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-21 17:35:16 +02:00
Anas Nashif 0a73ea04fa kernel: remove deprecate k_call_stacks_analyze
This API was deperecated and is not being used in the tree anymore, so
remove it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-21 10:33:05 -04:00
Jukka Rissanen 02e9f9c8e6 net: route: Check that neighbor exists before deleting it
If the neighbour does not exists, then the route to it cannot
be deleted so we can return error to caller in that case.

Coverity-CID: 188173
Fixes #10090

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-21 17:32:18 +03:00
Jukka Rissanen 3b8c37de45 net: route: Check NULL value in debug print
In net_route_add(), do not try to print route information if
route to neighbor is not found.

Coverity-CID: 188172
Fixes #10091

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-21 17:32:18 +03:00
Kumar Gala c57f3a09bc scripts/dts/extract: Fix handling of value extraction based on cells
If size or address cells happened to be 2 we'd get the wrong value since
we where shift the least significant 32-bit's up.  Adjust the math based
on the value of the cell amount to fix things.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-21 07:23:49 -07:00
Bobby Noelte 14ced2f021 scripts/dts/extract: Cleanup reg extraction
Rename address / size cell variable to clarify that its the number
of address / size cells.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-21 07:23:49 -07:00
Erwan Gouriou 1ac3517c6a dts: Add missing 'compatible' property in flash base nodes
'compatible' property was missing in flash base nodes for
some .dtsi files. Fix this.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 07:23:49 -07:00
Erwan Gouriou cc054c8044 scripts/dts/extract: factorize 'reg' prop extraction
reg class is updated to take into account whole use cases
of reg extraction so extract_reg_prop could be removed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 07:23:49 -07:00