Commit graph

41120 commits

Author SHA1 Message Date
Flavio Ceolin
f18e632566 logging: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-05 14:58:58 -08:00
Flavio Ceolin
051a7057a9 boards: galileo: Fix switch usage
According with MISRA-C every switch-clause must terminate with an
unconditional break.

MISRA-C rules 16.1 and 16.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-05 14:58:58 -08:00
Flavio Ceolin
b07fe48027 power: Fix switch usage
According with MISRA-C every switch-clause must terminate with an
unconditional break.

MISRA-C rules 16.1 and 16.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-05 14:58:58 -08:00
Johann Fischer
45c6ead099 drivers: eth_enc28j60: fix typo and build for half duplex
Fix typo and build for half duplex configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-03-05 13:38:43 -05:00
Andrzej Głąbek
fe06e4276f drivers: spi: nrfx: Improve a few Kconfig option prompts
Rephrase prompts for a few options in drivers/spi/Kconfig.nrfx
so that their purpose is presented a bit better.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Andrzej Głąbek
257c28a200 drivers: nrfx: Add Kconfig checks for mutually exclusive peripherals
In Nordic SoCs, SPI and TWI peripherals with the same instance number
share certain resources and therefore cannot be used at the same time
(in nRF91 Series this limitation concerns UART peripherals as well).
This patch adds Kconfig checks ensuring that only one of such mutually
exclusive peripherals can be enabled.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Andrzej Głąbek
cc185bc02b ext: nordic: Add missing NRFX_UARTE[2,3] Kconfig options
Definitions of these two options were missing, altought the symbols
that would be created for them were already referenced from
`ext/hal/nordic/nrfx_config_nrf9160.h`.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Andrzej Głąbek
d2735edf65 ext: nordic: Add NRF_SPIS[0-3] definitions to nrfx_config_nrf9160.h
These entries should have been added in the initial version of
this file (in commit 99bab3f478)
but their absence was overlooked.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Andrzej Głąbek
b6a31a80d0 drivers: spi: nrfx: Add support for SPIS3
This patch adds missing SPI_3_NRF_SPIS Kconfig option (referenced by
`ext/hal/nordic/nrfx_config_nrf9160.h`, although not defined anywhere)
and adds support for SPIS3 instance in the nrfx_spis driver shim.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Krzysztof Chruscinski
244aecf2d2 tests: drivers: counter: Fix coverity issue (190952)
Fix issue reported by coverity regarding using volatile
variables in zassert_equal macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-05 12:37:18 -06:00
Krzysztof Chruscinski
e318401426 tests: drivers: counter: Fix coverity issues 190937, 190967, 190983
Fix issue reported by coverity regarding using volatile variable
in zassert_equal macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-05 12:37:18 -06:00
Andrew Boie
f084c38d44 userspace: properly namespace linker vars
App shared memory defines a bunch of symbols in the
linker script. Namespace them properly as private
zephyr variables.

The variables which indicate the bounds of the entire
partition now end with "_part_start", "_part_size",
and "_part_end" to make them easy for scripts to
distinguish them from other generated symbols for
data/bss sizes.

Finally, the bss size is not rounded up, this was
causing unnecessary memory to be zeroed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-05 10:02:27 -08:00
Song Qiang
c8a811bc58 drivers: gpio: sifive: cleanup irq initialzation code
Clean up irq initialization code with macro definitions.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-03-05 12:42:54 -05:00
Vincent Wan
341c2308d2 ext: simplelink: Remove build warnings
This commit removes build warnings in the SimpleLink SDK's driver.c file
by updating CMakeLists.txt

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
794c18932e CODEOWNERS: Update code ownership for TI SimpleLink code
Updated for SimpleLink-related code in ext, board and soc.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
c051d97bc1 ext: simplelink: Run dos2unix on files imported from TI SimpleLink SDK
Getting rid of DOS line termination characters to be more
Linux-friendly.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
067a5f76e0 ext: simplelink: Update the README
The README is updated for the new version of the TI SimpleLink SDK.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
30c9c2954d ext: simplelink: Add a workaround for #13444 in cc_pal.h
We are undefining timeval to avoid a symbol redefinition build error.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
5bce9cb1d4 ext: simplelink: Add posix api and pthread support to Kconfig
When using the wifi driver, we should automatically select
CONFIG_POSIX_API and CONFIG_PTHREAD_IPC. This is necessary given the
code in the new SimpleLink host driver from the SimpleLink SDK uses
pthread and sem.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
28cfb09010 ext: simplelink: Use Zephyr posix headers in cc_pal.h
We should use the headers from Zephyr, not the ones provided by TI for
their posix implementations.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
2e15b0f611 drivers: wifi: simplelink: Use TI SimpleLink SDK 2.40
This commit updates the wifi driver to use the new TI SimpleLink SDK.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
f6d8a15092 ext: simplelink: Update CMakeLists.txt to build new SDK
Updating it to build the correct list of files in the SDK.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
e2f7d11ed0 ext: simplelink: Update user.h
We are using the external spawn option, hence must make a change
to point to our os_Spawn implementation.

We are also supplying errno values that are missing from Zephyr errno.h
and the external errno setter function, to allow the SimpleLink
driver.c to compile.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
496c261e42 ext: simplelink: Add updated CC3220 board files
This commit adds updated board files to configure the peripheral
drivers on the CC3220.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
8476c451c4 ext: simplelink: Import files from TI CC32XX SDK 2.40.01.01
Add/Update files taken from TI CC32XX SDK, including
    - peripheral drivers
    - driverlib (HAL)
    - WiFi host driver and porting layer interface headers

Origin: Texas Instruments cc32xx SimpleLink SDK
URL: http://www.ti.com/tool/download/simplelink-cc32xx-sdk
Purpose: Provide driver libraries and HAL for TI CC32XX SoC
Maintained-by: External

Fixes #11126

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
55b3f05932 include: net: Move fcntl implementation into socket_offload.h
This is done to conform with how the rest of the socket APIs are
implemented during socket offload. Otherwise link error would
result due to the symbol being redefined in lib/os/fdtable.c.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Ioannis Glaropoulos
e0b369a63c samples: mpu: correct Kconfig setting in project configuration
We need to set CONFIG_HW_STACK_PROTECTION=y, instead of the
internal symbol CONFIG_MPU_STACK_GUARD, in order for fatal.c
to be able to parse the error code. MPU_STACK_GUARD is,
anyway selected if HW_STACK_PROTECTION is set.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-05 11:34:06 -05:00
Pawel Dunaj
b5589cc6b6 drivers: spi: nRF SPI add control of MISO pin pull
Allow change of the MISO pin pull in SPI/SPIM.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2019-03-05 16:09:25 +01:00
Jukka Rissanen
301aeda9ef doc: net: Update the L2 documentation
The L2 documentation was describing functionality that has changed
recently. Now it should match the current reality.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-05 08:29:31 -05:00
Ravi kumar Veeramally
0aa61651ce net: tests: Fix DHCPv4 tests
net_pkt_alloc_with_buffer() takes IP header and protocol header
length while calculating total length internally. Need not
specify explicitly. Also mutex was not properly initialized.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-03-05 08:29:02 -05:00
Ravi kumar Veeramally
ecfe1fc7e3 net: dhcpv4: Introduce config option for max delay
As per RFC2131 4.1.1 requires we wait a random period
between 1 and 10 seconds before sending the initial
discover. But tests can not wait that longer. So this
option helps test to configure the value to minimum.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-03-05 08:29:02 -05:00
Jacob Siverskog
99074fc75e toolchain: Fix typo and grammar in error message
Minor grammatical changes.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-03-05 08:28:40 -05:00
Jacob Siverskog
5105947924 toolchain: Improve error message on mismatching SDK version
Add useful information to the error message printed when the installed
SDK does not fulfill version requirements.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-03-05 08:28:40 -05:00
Paul Sokolovsky
a3cffb8e63 net: sockets: Trace socket/accept/close operations for debug logging
This is required to debug almost any issue with sockets.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-05 08:28:25 -05:00
Andrew Boie
e686aefe09 mbedtls: provide user mode access
The mbedtls library has some globals which results in faults
when user mode tries to access them.

Instantiate a memory partition for mbedtls's globals.
The linker will place all globals found by building this
library into this partition.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-05 08:27:20 -05:00
Andrew Boie
62fad96802 userspace: zero app memory bss earlier
Some init tasks may use some bss app memory areas and
expect them to be zeroed out. Do this much earlier
in the boot process, before any of the init tasks
run.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-05 08:27:20 -05:00
Ioannis Glaropoulos
43a3593fce arch: arm: fix thread and interrupt stack start calculations
Based on the definition of _ARCH_THREAD_STACK_DEFINE() macro
for ARM, the MPU Stack Guard region is placed inside the
allocated stack object, only if
CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT and CONFIG_USERSPACE
are both set. For ARM stack objects, allocated using the
_ARCH_THREAD_STACK_DEFINE() macro, such as the threads' stacks
and the interrupt stack, the above must be reflected on how we
set the initial start of the stacks.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-05 08:26:40 -05:00
Krzysztof Chruscinski
987586d914 logging: Use vprintk for string formatting by default
Previously, _prf function was used when present and _vprintk
was used otherwise. _prf supports reacher formatting but at
cost of 3k flash and >250 bytes on stack. Stack usage then
depended on which function was used and that was causing
troubles when trimming stack sizes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-05 08:24:50 -05:00
Ulf Magnusson
73efd78432 net: gptp: Remove ref. to undef. CONFIG_NET_GPTP_STACK_SIZE
No Kconfig symbol called NET_GPTP_STACK_SIZE has ever been defined in
the Zephyr repo. Drop the CONFIG_* prefix from the #define.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-05 08:23:22 -05:00
Maureen Helm
d5ce82b01a drivers: timer: Fix build warnings in rv32m1 driver
Converts the rv32m1 timer driver to use 'DT_' prefixed defines instead
of deprecated non-prefixed defines.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-05 08:18:52 -05:00
Maureen Helm
9773327ef8 drivers: pinmux: Fix build warnings in rv32m1 driver
Converts the rv32m1 pinmux driver to use 'DT_' prefixed defines instead
of deprecated non-prefixed defines.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-05 08:18:52 -05:00
Maureen Helm
c12e8b28b9 drivers: interrupt_controller: Fix build warnings in rv32m1 driver
Converts the rv32m1 interrupt controller driver to use 'DT_' prefixed
defines instead of deprecated non-prefixed defines.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-05 08:18:52 -05:00
Maureen Helm
fc898ef4e6 drivers: clock_control: Fix build warnings in rv32m1 driver
Converts the rv32m1 clock control driver to use 'DT_' prefixed defines
instead of deprecated non-prefixed defines.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-05 08:18:52 -05:00
Maureen Helm
0a5a61dd79 drivers: gpio: Fix build warnings in rv32m1 driver
Converts the rv32m1 gpio driver to use 'DT_' prefixed defines instead of
deprecated non-prefixed defines.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-05 08:18:52 -05:00
Michael Scott
b56035c940 doc: net: lwm2m: add LwM2M high-level API documentation
The LwM2M public APIs were never well documented.  Let's fix
that by adding the needed information to include/net/lwm2m.h

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/12958

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-05 08:10:06 -05:00
Carles Cufi
1cdf2460f4 Bluetooth: controller: Fix unchecked return value
Check the return value of mayfly_enqueue() and assert if not successful.

Coverity ID: CID 190991
Fixes #13833.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-03-05 13:08:12 +01:00
Pawel Dunaj
3dd44d16e6 tests: bluetooth: MESH shell is observer not central
Use BT_OBSERVER instead of BT_CENTRAL for this test.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2019-03-05 11:22:39 +01:00
Pawel Dunaj
4858a868e6 bluetooth: host: Expand TX thread stack for BT_CENTRAL
Expand TX stack size as more RAM is needed when keys are
stored.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2019-03-05 11:22:39 +01:00
Maksim Masalski
eead071b18 bluetooth: fix unchecked return from lll_clk_off in ll_test_end
Inside ll_test_end(), result of lll_clk_off() is not checked
which might result in releasing resources acquired for radio.

Coverity-CID: 190954
Fixes: #13861
Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
2019-03-05 11:21:55 +01:00
Marcin Szymczyk
6983645552 usb: add hid-cdc example
This example combines 2 HID classes and 2 CDC ACM classes to create
a composite, multi-instance device.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-03-05 09:35:26 +01:00