Commit graph

41120 commits

Author SHA1 Message Date
Peter A. Bigot
d4b4b99272 soc: arm: nordic: provide custom busy_wait implementations
Implementation taken from Nordic nrfx version 1.3.1 soc/nrfx_coredep.h,
modified to remove material from other series and to conform to Zephyr
coding standards.

Note that unlike standard k_busy_wait this is susceptible to
longer-than-intended delays due to the impact of interrupt handling.

Fixes #11626

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-11-26 19:13:18 +01:00
Andrei Emeltchenko
575bd0bbc9 usb: Fix unaligned access
Use sys_put_le16() for unaligned access, this is refactored work of
PR #8495
PR #11432

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-26 09:13:56 -08:00
Olivier Martin
6c3aefa0b6 Bluetooth: host: Clear CCC when clearing all keys
CCC settings was not removed when unpairing all keys.
It means CCC settings were still present in flash and were
loading at bluetooth initialization time.

Loading these orphan CCC settings would fill `bt_gatt_ccc_cfg`
configurations and would prevent to add new CCC when pairing
with a new device.

Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
2018-11-26 18:34:41 +02:00
Sathish Kuttan
23f11933b9 dts: intel_s1000: enable DTS for GPIO
Added GPIO to SoC device tree
Updated SoC DTS fixup
Removed Kconfig variables now replaced by DT

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-11-26 06:56:48 -08:00
Ramakrishna Pallala
212b2180c9 power: Add API's to enable/disable System PM states
Add API's to enable/disable System PM states so that an
an application can enable/disable system from entering
certain Low Power states.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-11-26 06:55:57 -08:00
Andrzej Głąbek
dc7e8a9898 ext: hal: nrfx: Import soc/nrfx_coredep.h from nrfx 1.3.1
This is a follow-up to commit b45fcc6b9e.
The nrfx import is complemented with the file containing
a core-dependent delay function. The intention is to allow it
to be used in a custom k_busy_wait() implementation.

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

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-26 15:47:09 +01:00
Håkon Øye Amundsen
c086b935aa kconfig: cmake: Support for images without gaps.
Defines a Kconfig variable which allows the user to specify
that any generated hex/bin/s19 file should not have filled gaps.

This is done to support building in a multi image context,
where several image files will be merged together.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2018-11-26 06:41:05 -08:00
Ulf Magnusson
9347b0f28f kconfiglib/menuconfig: Various improvements
Update Kconfiglib and menuconfig to upstream revision e47d7eff1012e, to
add some small fixes/improvements/changes:

 - Raise errors for extra trailing tokens anywhere. They were silently
   ignored in some places:

     * end{if,menu,choice} <extra tokens>

     * {default,select,...} FOO <extra tokens>  (though e.g.
       'default FOO if' raised an error)

 - Rephrase the warning when selecting a choice symbol to make it
   clearer that select never has any effect on choice symbols.

 - Display empty menus with '----' instead of '---> (empty)'. This
   matches the C tools. It might be less confusing for symbols defined
   with 'menuconfig', which is where you most often get empty menus
   (when the symbol is n).

 - Speed up parsing performance

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-26 14:07:36 +01:00
Pawel Dunaj
baea22407d kernel: Always set clock expiry with sync with timeout module
System must not set the clock expiry via backdoor as it may
effect in unbound time drift of all scheduled timeouts.

Fixes: #11502

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2018-11-26 12:24:59 +01:00
Aurelien Jarno
38efc2d426 shell: add a missing space in the help message
The help message is missing a space between "auto-complete" and "all".
Fix that.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-26 01:04:45 -05:00
Rajavardhan Gundi
73562dc863 tests: intel_s1000: Fix the spi flash tests for R/W
The tests are modified to reflect the changed return values
the spi flash read and write APIs return.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-24 07:58:05 -05:00
Rajavardhan Gundi
4b3f3ab056 drivers: flash: spi_nor: Correct the return values for R/W
Fixed the return values for read and write APIs for spin_nor.c
which were not inline with what the corresponding interfaces
were meant to return.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-24 07:58:05 -05:00
Vikrant More
d0b74e2f7e samples: mesh: nrf52: improve in execution if trnasition time is Zero
If transition time is not equal to Zero then & then only values
related to transition get calculated.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-24 10:29:30 +02:00
Johan Hedberg
a633ded383 samples: reel_board/mesh_badge: Fix long name truncation
If the first name is longer than HELLO_MAX sending would fail due to
there not being sufficient MIC space (or worse overrun the net_buf).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-24 00:54:32 +01:00
Johan Hedberg
2f030f94f4 samples: reel_board/mesh_badge: Fix string parsing from buffer
This code was still incorrectly causing corrupt strings to be
generated. Now it should be correct.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-24 00:54:32 +01:00
Vikrant More
66a2bf03ba samples: mesh: nrf52: implementation as Mesh Model specs 3.1.1.1
Now if Gen. OnOff state set by client as '1' with some
transition time then value of Lightness will not jump to default
or last value instantly instead it would gradually increase during
that transition period.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-23 22:29:29 +02:00
Vikrant More
fc0a310e15 samples: mesh: nrf52: coding style improvements
Create independent function handlers for some Servers. This
would not initiate state binding if current state is equal to
Client requested state.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-23 22:29:29 +02:00
Grzegorz Kolodziejczyk
d7b3fe4ab4 samples: reel_board/mesh_badge: Match onoff state with LED light
Inverse logic for onoff state while driving LED GPIO. For LED light on
GPIO pin is 0, 1 for LED light off.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-23 22:04:26 +02:00
Rajavardhan Gundi
e50ce17578 tests: intel_s1000: Change flash offset from 0x10000 to 0x3F0000
Use the last sector of 4MB flash to run the flash API tests.

Fixes #11462.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-23 14:52:00 -05:00
Mieszko Mierunski
9dc3870276 drivers: nrf: Support I2C initial speed configuration from dts
Current implementation had fixed initial speed, this commit
fixes TWI and TWIM shims to use configuration from DTS.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-23 12:39:36 -05:00
Aurelien Jarno
92f7c7c3b5 drivers: usb_dc_sam: kill a coverity warning
Coverity complains that packet_len can get assigned a negative value if
usb_dc_ep_mps() returns an error. This is correct, however it only
happens if the endpoint address is invalid, and in that case the value
is not used as the endpoint address is also validated in
usb_dc_ep_write().

Fix the issue by moving the assignment after the endpoint address
validation and by accessing the value directly instead of getting it
through usb_dc_ep_mps().

Fixes #11481
Coverity-CID: 189742

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-23 09:19:44 -05:00
Marcin Szymczyk
e4c447aac3 usb: add SoF event
Start of Frame events can now be accessed from USB classes.
This will be useful when implementing idle rate functionality.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-11-23 09:18:41 -05:00
Gil Pitney
0d222025d6 doc: boards: cc3220sf_launchxl: Add notes on secure socket offload
Reference working sockets example http_get, and add reference
to SimpleLink Certificate Handling.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-11-23 09:16:21 -05:00
Gil Pitney
9991bcb4c5 net: samples: sockets: http_get: Add secure socket offload support
Update the http_get sockets sample to enable association of secure
tags with certificate filenames.

This allows certificates and keys to be provisioned to the file
system on secure flash, without having to include the actual
certificates in the application.

Validated on the cc3220sf_launchxl board.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-11-23 09:16:21 -05:00
Gil Pitney
c51cf1e463 drivers: wifi: simplelink: Implement setsockopt() for TLS offload
Implements setsockopt() for the socket offload driver
to process the TLS tags sent in via the Zephyr setsockopt() API,
when CONFIG_NET_SOCKETS_SOCKOPT_TLS is chosen.
For each tag, the credential filenames are retrieved and
set via SimpleLink's sl_SetSockOpt() API.

Also, creates a new KConfig option for TLS_CREDENTIAL_FILENAMES.
This new option is used by apps/protocols to add TLS credentials
via filenames referring to the actual content stored on a secure
file system or flash.

Handles the IPPROTO_TLS_* socket protocol families in the
socket() offloaded API.

This was validated on the cc3220sf_launchxl with the http_get sockets
sample, with the globalsign_r2.der file loaded to secure flash via
the TI Uniflash tool, and using the TI Catalog of known good
root CA's.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-11-23 09:16:21 -05:00
Kumar Gala
582e676248 dts: arc: emsk: Remove emsk_dt.h and CONFIG options from dtsi
There are different interrupt numbers for R22 v R23.  Before this was
being handled via using Kconfig symbol CONFIG_BOARD_EM_STARTERKIT_R23 in
emsk_dt.h.  Since we want to remove use of Kconfig in dts we handle this
via different dtsi files and having the proper one included by the
proper board revision dts file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-23 09:13:55 -05:00
Kumar Gala
8d92653f26 dts: arc: emsk: Remove DT_APB_CLK_HZ from emsk_dt.h
As we want to remove emsk_dt.h we just fold the DT_APB_CLK_HZ into the
emsk.dtsi.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-23 09:13:55 -05:00
Kumar Gala
7feb430b38 dts: arc: emsk: Remove DT_{I,D}CCM_SIZE from emsk_dt.h
Towards removing Kconfig from DTS we need to move setting of the sizes
of ICCM/DCCM into the SoC specific DTS files and out of emsk_dt.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-23 09:13:55 -05:00
Ravi kumar Veeramally
b848f8f9c5 net: rpl: Remove __deprecated tag to one function
net_rpl_get_interface() function which returns always NULL is
defined if NET_RPL is not enabled. so remove deprecated tag to
this particular function. Otherwise it will cause unnecessary
compilation warnings.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-23 09:10:23 -05:00
Andrei Emeltchenko
4e21f0651a samples: mesh_badge: Update project config
Add CONFIG_BT.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-23 09:10:01 -05:00
Andrei Emeltchenko
76beaf6c1c reel_board: Do not include Bluetooth to every project
Including Bluetooth to every project unnecessary increase size of the
project, for example hello world sizes:

Memory region         Used Size  Region Size  %age Used
           FLASH:       48492 B         1 MB      4.62%
            SRAM:       11236 B       256 KB      4.29%
        IDT_LIST:         136 B         2 KB      6.64%

after the patch:

Memory region         Used Size  Region Size  %age Used
           FLASH:       13344 B         1 MB      1.27%
            SRAM:        4004 B       256 KB      1.53%
        IDT_LIST:          72 B         2 KB      3.52%

3+ times difference.
PS: It also crashes when 802.15.4 enabled.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-23 09:10:01 -05:00
Johann Fischer
aee6764c32 drivers: ssd1673: fix SPI GPIO CS configuration
Use DT_SSD1673_SPI_GPIO_CS_DRV_NAME for CS configuration.

Resolves: #10720

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-11-23 08:39:20 -05:00
Krzysztof Chruscinski
2d6a226b2e logging: Fix lost printk output when no newline
Log_output module was always postfixing printk strings
with '\r'. If printk message did not ended with '\n'
it lead to last printk message being overwritten.

Fixed by adding '\r' only when string was ended by '\n'.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-22 19:18:41 -05:00
Anas Nashif
e4505892bc boards: add docs for quark_se_c1000_devboard
Add documentation for the quark_se_c1000_devboard with links to platform
guidelines and other details.

Fixes #11166

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-22 15:10:47 -05:00
Anas Nashif
8f807946b1 boards: quark_d2000_crb: fix board name
Fixed typo in documentation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-22 15:10:47 -05:00
Aurelien Jarno
ae20f807da soc: same70: enable data cache on sam_e70
The Cortex-M7 CPU included in the SAM e70 SoCs has a data cache that
significantly boost the performances. However the SAM GMAC Ethernet
driver is using a scatter-gather technique to exchange data with the
Ethernet driver. This requires the use use of a non-cached memory area.
This is currently not supported on Zephyr, but support for it is being
discussed in PR#11199.

In the meantime, enable the data cache during the SoC initialization,
unless the SAM GMAC Ethernet driver is enabled.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-22 13:17:14 -05:00
Aurelien Jarno
b53c6c1fe3 soc: same70: enable instruction cache on sam_e70
The Cortex-M7 CPU included in the SAM e70 SoCs has an instruction cache
that significantly boost the performances. Enable it during the SoC
initialization.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-22 13:17:14 -05:00
Aurelien Jarno
532550cba1 drivers/i2s_sam_ssc.c: enable cache support
Enable cache operations before starting a DMA operation if the CPU has a
cache. All the support was already in place, it just needs to be
enabled.

With the previous commits, it allows the I2S tests to pass on a SAM E70
Xplained board with the CPU cache enabled.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-22 13:16:42 -05:00
Aurelien Jarno
a3a3383387 tests/i2s: align memory slabs to 32 bytes
The memory slabs used for I2S are used through DMA. In case the CPU has
a cache, we need to ensure minimum alignment so that an entire number of
cache lines can be cleaned or invalidated.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-22 13:16:42 -05:00
Krzysztof Chruscinski
96a610b736 shell: Fix log messages queueing for multiple instances
Shell log backend was using k_fifo to enqueue log messages.
It was using field in log message that was used for same
purpose in log_core before passing message to backends.
However, this method supported only single shell as
other shell was corruption the fifo because field was
reused.

Modified shell log backend to use k_msgq for pending
messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-22 13:14:49 -05:00
Paul Sokolovsky
45b1d73164 drivers: serial: uart_cmsdk_apb: Ack IRQs before callback to avoid races
This effectively reverts part of earlier 49bb163756 which moved
interrupt acknowledgement until after return from the user callback.
This was done confusing the flow of this driver with how some other
drivers do it, where pending interrupt status is checked by
uart_irq_rx_ready()/uart_irq_tx_ready(), which should be called by
the callback. But the uart_cmsdk_apb driver actually uses different
hardware register in these functions. And acking IRQs after user
callback can lead to race condition and losing an IRQ, and the
simple fix in this case is just move acknowledgement to where it
was before.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-22 13:14:19 -05:00
Paweł Zadrożniak
55674d8e17 drivers: usb: nordic: change USBD driver locking scheme
Nordic USB driver shim uses nrfx_usbd driver from nrfx package.
The driver was protected by a semaphore during every transfer
to prevent access from multiple threads at the same time.
This leads to the problem when a class schedules transfer on one
endpoint before host asks for the data (to be sent later) - driver
is locked and other endpoints (including control EP) are blocked.
Currently, only driver calls are wrapped with semaphore without
waiting for the transfer to complete, allowing scheduling transfers
on different endpoints. This is allowed bu nrfx_usbd, however
shim prevents user from scheduling multiple transfers on one
EP (required by nrfx_usbd).

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2018-11-22 13:13:16 -05:00
Anas Nashif
7a85c19f1a ci: update to latest docker image
Added the Pillow module for dealing with fonts for the display
subsystem.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-22 12:17:19 -05:00
Armando Visconti
a33474673d CODEOWNERS: Add @avisconti as maintainer
Add @avisconti as maintainer for following stuff:

- ArgonKey board
- STM32 I2S driver
- ST motion sensor drivers

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-11-22 12:16:57 -05:00
Luiz Augusto von Dentz
6798a421e1 Bluetooth: GATT: Ensure GATT service is registered first
Accourding to Bluetooth specification the Service Changed
Characteristic shall not have its handle changed once it has been
bonded, so this moves the GATT service to be the very first service
registered that way it is guaranteed that it won't change even if
device is flashed with a different configuration which end up changing
the handles after it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-11-22 17:27:48 +02:00
Ravi kumar Veeramally
19c598f081 net: coap: Deprecate net_pkt based CoAP library
Deprecating net_pkt based CoAP library due to Socket based
CoAP library.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-22 09:08:46 -05:00
Anas Nashif
3d906dc4c1 net: coap: Move both CoAP implementations into one Kconfig
Two separate folders and Kconfig options causing confusion on
CoAP and CoAP_SOCK implementations. This patch simplifies it.
Current CoAP Kconfig option moved to COAP_NET_PKT.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-22 09:08:46 -05:00
Ravi kumar Veeramally
7d0aecfc2a net: rpl: Deprecate RPL
RPL support has been deprecated from Zephyr.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-22 09:01:04 -05:00
Christian Taedcke
90473af3cb ext: gecko: Update Silabs Gecko HAL to v5.6.1
Origin: Silicon Labs Gecko SDK
URL: https://www.silabs.com/products/development-tools/software/simplicity-studio
Version: v5.6.1
Purpose: Add support for Silicon Labs EXX32 SoCs
License: Zlib
Maintained-by: External

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2018-11-22 07:57:19 -06:00
Mieszko Mierunski
1bfa721373 drivers: nrf: nrf uarte fix TX interrupts disabling.
Make sure that TX interrupts are disabled after transmission
is finished.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-22 14:06:01 +01:00