Commit graph

19400 commits

Author SHA1 Message Date
Yannis Damigos 306298e857 dts/arm/st: Fix SPI1 interrupt priority for STM32f0
STM32F0 family has only 2 interrupt priority bits.

Fixes #6238

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-02-20 09:47:43 -05:00
Daniel Wagenknecht b4f842db5c dts: stm32: spi2 is not supported on all F4 SoCs
Some stm32f4 SoCs don't support spi2, so remove spi2
device-tree node from stm32f4.dtsi file.

Signed-off-by: Daniel Wagenknecht <wagenknecht.daniel@gmail.com>
2018-02-20 09:47:43 -05:00
Daniel Wagenknecht 34ed38edd5 dts: stm32: fix dts inclusion for stm32f405
stm32f405 is not an expansion of stm32f411, since stm32f411 has more
SPIs than stm32f405.
Fix this by including stm32f401.dtsi in stm32f405.dtsi
(instead of stm32f411.dtsi).

Signed-off-by: Daniel Wagenknecht <wagenknecht.daniel@gmail.com>
2018-02-20 09:47:43 -05:00
Vinayak Kariappa Chettimada b55e7b784c Bluetooth: controller: Use RADIO_TIES_US to define inter event space
Use RADIO_TIES_US to define minimum inter event space
between concurrent master and slave roles below which it
will be detected as a probable drift towards each other
leading to them overlapping on each other.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-20 15:34:55 +01:00
Jukka Rissanen 10ef346aed drivers: net: loopback: Fix possible double unref
If we could not send the packet, then do not release the net_pkt
as that will be released in net_if.c:net_if_tx() if driver send()
fails.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-02-20 15:28:23 +02:00
Ravi kumar Veeramally 5490d28d8c net: app: Fix issue while configuring local context
When IPv6 and IPv4 both are enabled and net_app acting as a client,
configuring local context has one glitch.

After selection of IPv6 context as a default context  function
should return immediately, otherwise it continue to select IPv4
context as default context.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-02-20 14:50:39 +02:00
Ravi kumar Veeramally 88e8119078 net: app: Fix connection closure issues with net_app_ctx
In case of TCP and node acting as a APP_SERVER it can have multiple
concurrent connections. Calling close callback when there are still
active connections exists, causing an issue.

e.g. When a node acting as a HTTP server and can support multiple
TCP connections. Let's say one of the connection is in closing
state and the rest are still in active state. net_app_ctx is
calling close (http_closed) callback of registered upper layers.
HTTP assumes all the connections are closed and unref all the
connection related stuff.

Call the close callback only when there are no active connections.
Patch has also moved TCP stuff under one #ifdef.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-02-20 14:50:39 +02:00
Pedro Martucci a495b31ee0 sample: net: RPL mesh sample over QEMU
Create a net sample to setup a multi-node RPL mesh network using QMEU.
To enable this, it was necessary implement a hw filter on IEEE 802.15.4
UART Pipe driver and create a QEMU pipe management on cmake.

This sample use a tool developed on zephyr net-tools repository called
virtual-hub.

Signed-off-by: Pedro Martucci <pedropaulomartucci@gmail.com>
2018-02-20 14:47:14 +02:00
Pedro Martucci ede5b8ffc3 drivers/ieee802154: Add hw filtering support for upipe driver
Implements HW filtering for IEEE802.15.4 UART Pipe driver.

Signed-off-by: Pedro Martucci <pedropaulomartucci@gmail.com>
2018-02-20 14:47:14 +02:00
Jukka Rissanen 023628f3d7 net: Set net_buf alloc timeout for IPv4 ARP and IPv6 ND
Instead of having K_FOREVER when allocating a packet in IPv4 ARP
and IPv6 ND, set a timeout so that we do not have a case where we
would wait net_buf forever.

Fixes #5484

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-02-20 14:31:39 +02:00
Vitor Massaru Iha e84d1a4f31 drivers: gpio: Nios-II: Fix condition on gpio_nios2_config_oput_port()
(flags & GPIO_DIR_IN) is always zero because GPIO_DIR_IN is 0, then
we have to use GPIO_DIR_MASK.

Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
2018-02-19 20:49:20 -05:00
Luiz Augusto von Dentz ec6188bc06 net: bt: Call net_if_carrier_down when disconnected
If IPSP channel is disconnected call net_if_carrier_down instead of
net_if_down since the later may still attempt to send packets while the
former just discard them immediatelly.

Fixes #5317

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-02-19 14:46:33 +02:00
Luiz Augusto von Dentz 656bab0361 net: Introduce net_if_carrier_down
This introduces net_if_carrier_down so the L2 driver can inform when it
has lost connectivity so all packets shall be flushed and the interface
should be put down.

Fixes #5317

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-02-19 14:46:33 +02:00
Paul Sokolovsky 7e06be2218 samples: sockets: http_get: Include Host: header in request
The Host header is even mandatory in HTTP 1.1, and indeed without
it, many virtual hosting setups don't work (which are many), so to
be faithful to what README says: "You can edit the source code to
issue a request to any other site on the Internet", let's
complicate the sample by including it.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-19 10:39:14 +02:00
Leandro Pereira 517df4d73c subsys: net: http: Send "Internal Server Error" on unknown error code
Avoid using an uninitialized pointer when adding headers to the HTTP
context.

Coverity-CID: 178792
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-02-19 10:37:57 +02:00
Anas Nashif 5766a88c63 tests: fatal: rename function to be consistent
Get the reporting right and consistent with other tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 5e9279a35c tests: sleep: rename function to be consistent
Get the reporting right and consistent with other tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 10c0bea562 tests: mslab: cleanup output and use ztest
Get the reporting right and consistent with other tests. Use ztest
possible where possible and remove too many lines and confusing output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 0ebaaf400b tests: static_idt: cleanup test
Use some more ztest magic and cleanup test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif b16f89a094 tests: move multilib test to common/
A very minimal test that can join other tests under common.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 4192a24f8c tests: lib: use meaningful test names
Use proper test names instead of relying on path name where the test is
located.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 84d14e823b tests: move bitfields test to common/
Test is very minimal and can be combined with an existing common
testsuite.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 5783775584 tests: move c lib test to lib/
This is not a kernel test, move it to where it belongs under lib/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif c797a9ef7b tests: libc: cleanup naming and expand string tests
move to a more cosnistent test naming using test_ to improve reporting
and parsing. Expand string tests and run them as separate ztest tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 46f0718eb1 tests: crypto: aes: use meaningful test names
instead of using numbers, change name to what is actually being testing
to improve reporting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 10d75d478d tests: crypto: stop relying on path for naming
Use proper test names instead of relying on path name where the test is
located.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 841835554d tests: kernel: stop relying on path for naming
Use proper test names instead of relying on path name where the test is
located.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 7e5853888c tests: boot_page_table cleanup
Use ztest macro for asserts instead of plain conditionals. Cleanup style
a bit.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 516ded7dff tests: work_queue: use ztest properly
Convert test to ztest in a clean way and other cleanup.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Anas Nashif 57f158802b tests: mem_pool: move proper to ztest
Convert test to ztest correctly and other minor cleanup.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-18 09:16:40 -05:00
Leandro Pereira 25a59cded9 drivers: sensor: vl53l0x: Use proper variable type for return code
VL53L0X_PerformSingleRangingMeasurement() returns a signed 8-bit
integer, not an unsigned 8-bit integer, making the "< 0" comparison
worthless.

Coverity-CID: 182593
Coverity-CID: 182597
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-02-17 09:19:35 -05:00
David B. Kinder e5dcd0236c doc: Update doc building instructions
Instructions for generating documents locally needed some updates
because of build environment changes and use of newer tool versions.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-02-17 09:15:46 -05:00
Leandro Pereira 2a98e7cfb4 samples: drivers: crypto: Print correct buffer comparison on failure
When testing whether the CTR mode decrypted the payload properly, a
comparison of `decrypt.out_buf` with the known plain text `plaintext`
is performed, but the buffer comparison that is printed uses
`plaintext` and `encrypt.out_buf` instead.

Coverity-CID: 181847

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-02-17 09:15:10 -05:00
Leandro Pereira 02dc6eb960 subsys: fcb: Check for mutex lock failure when walking FCB
Coverity-CID: 182195
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-02-17 09:14:16 -05:00
Paul Sokolovsky f303e9d115 samples: sockets: Add big_http_download sample
This sample downloads a more or less big file (~6MB as preconfigured)
over HTTP and checks its hash for integrity. It also repeat such a
download indefinitely, counting total number of bytes transferred.

This is thus a kind of traffic load testing sample. (Ported to C
from MicroPython original).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-17 09:11:29 -05:00
Giuliano Franchetto 8e534f7bf4 uart: fixing pin range being too tight for the nrf52840
The nrf52840 has 2 gpio ports, and 48 GPIO. We need to
adapt the range to allow the gpio on port 1 to be used
by this driver

Signed-off-by: Giuliano Franchetto <giuliano.franchetto@intellinium.com>
2018-02-17 09:06:20 -05:00
Michael Hope 8ee282e319 led_strip: add a APA102 driver.
The APA102 is a RGB LED with integrated controller.  LEDs can be
daisy-chained and use SPI for communication.  The SPI port is
configured via Device Tree.

Tested on the Adafruit Trinket M0.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-02-17 08:53:23 -05:00
Leandro Pereira d9538ec6b3 drivers: system_apic: Correctly assert interrupt line number
The interrupt line number is an unsigned integer; it makes no sense to
compare if it is greater than or equal to 0.

Coverity-CID: 182602
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-02-16 22:59:40 -05:00
Anas Nashif 3b2434f25c tests: move sprintf test out of kernel
sprintf is not a kernel feature, move it out to lib/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-16 16:09:42 -05:00
Anas Nashif edd85e17dc tests: sprintf: move to ztest
Use ztest for this test instead of legacy way of testing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-16 16:09:42 -05:00
Anas Nashif d18ef7fd75 tests: common: use consistent test names
prefix all tests with test_ and make test names consistent for easy
reporting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-16 16:09:42 -05:00
Andy Ross 60fd06830e xtensa: Make _arch_curr_cpu() work outside SMP
The xtensa headers use this for simplicity when SMP is not enabled.
It should still build on older platforms that don't include the
asm2-style CPU pointer scheme.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross 392b3b5aa6 xtensa/asm2: Don't needlessly build asm2 sources
Non-asm2 devices without a generated SoC interrupt file will see a
compile failure due to the missing header.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross 57f30bd8cc esp32: Move hard firmware function addresses to the linker script
This matches the way other firmware-provided functions are done.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross 648ce1b1ff mpu_stack_guard_test: Disable on xtensa
As with the other non-MPU architectures, we don't want to run this
test.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross 28192fd8ea kernel/kswap.h: Hook event logger from switch-based _Swap
The new generic _Swap() forgot the event logger hook

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross 6eef2f1485 misc: Add a FORCE_NO_ASSERT kconfig directive
The mbedtls test is hitting a compiler bug where two subtests will
soft fail on qemu_xtensa when assertions are enabled.  This is despite
the fact that:

+ The failure is entirely internal to the mbedtls suite.
+ The mbedtls code does not use zephyr asserts
+ The mbedtls code does not call into zephyr code that might assert.
+ The behavior persists even when an irq_lock() is held across the
  entire test, ruling out any asserts in interrupt/exception context.
+ And EVEN WHEN the mbedtls library blobs are bytewise identical
  between assert and non-assert cases.

The bug seems to be a layout thing where the mbedtls code behavior
differently based on code address and/or link-time optimizations
(xtensa has a few).

Unfortunately sanitycheck enables assertions by setting CFLAGS
directly and not via kconfig, so we can't fix this by turning the
feature off in an app right now.  This patch adds a simple "override"
flag that can be set by apps like this that hit bugs.

Again, note that zephyr assertions are not used nor needed by this one
test.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross 992ea243d5 tests/kernel/fatal: Add xtensa/asm2 to the "error returns" family
This test had to special case ARM, where error handlers are not
NORETURN functions.  The xtensa/asm2 layer has the same behavior
(albeit for a different reason).  Add it to the list, and clean up the
explanation a bit.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross e922df5069 kernel: Allow k_thread_abort(_current) from ISRs
Traditionally k_thread_abort() of the current thread has done a
synchronous _Swap() to the new context.  Doing this from an ISR has
never worked portably (some architectures can do it, some can't) for
this reason.

But on Xtensa/asm2, exception handlers now run in interrupt context
and it's a very reasonable requirement for them to abort the excepting
thread.

So simply don't swap, but do the rest of the bookeeping, returning to
the calling context.  As a side effect it's now possible to terminate
threads from interrupts, even if they have been interrupted.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross 0244d01fda xtensa/asm2: Don't return into dead threads
It's not impossible that something we just handled (e.g. a machine
exception) called k_thread_abort() on our current thread.  Don't try
to return into it, check the DEAD state.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00