Commit graph

41120 commits

Author SHA1 Message Date
Oane Kingma
c52787c4d1 boards/arm: Add initial support for SiLabs Giant Gecko GG11 STK
This commit adds initial support for the Silicon Labs EFM32
Giant Gecko GG11 StarterKit.

Features supported for now are NVIC, SysTick, GPIO, Flash,
Counter, I2C, UART and Ethernet. Support for Watchdog and
ADC will follow as soon as their respective PRs are merged.

Signed-off-by: Oane Kingma <o.kingma@interay.com>
2020-01-24 10:28:33 -06:00
Oane Kingma
e91da4ae45 soc/arm/silabs_exx32: Add support for EFM32GG11B SoC
This commit adds support for the Silicon Labs EFM32GG11B
series of SoCs.

Signed-off-by: Oane Kingma <o.kingma@interay.com>
2020-01-24 10:28:33 -06:00
Ulf Magnusson
a5f6233428 kconfig.py: Convert to use f-strings
Use f-strings instead of .format() to make things more readable. They
were added in Python 3.6, which Zephyr requires now.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-24 15:57:23 +01:00
Peter Bigot
1a5368a07b drivers: sensor: bma280: convert from Kconfig to devicetree
Define a binding for the Bosch BMA280 sensor.  Remove the Kconfig
settings and update the driver to use the devicetree information.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-24 15:52:09 +01:00
Jukka Rissanen
16805018bb samples: net: dns: Small refactoring
Moving the code around and enhancing debug prints. No changes in
functionality.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-24 16:22:18 +02:00
Jukka Rissanen
f9c18dd962 net: dns: Support multiple simultaneous mDNS requests
As mDNS requests set DNS id to 0, we cannot use it to match
the DNS response packet. In order to allow this functionality,
create a hash from query name and type, and use that together
with DNS id to match request and response.

Fixes #21914

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-24 16:22:18 +02:00
Ulf Magnusson
e25394bca9 dts: bindings: nxp,lpc-iap: Remove deprecated 'title' field
Merge all the information into 'description:' and remove 'title:'.
Gets rid of a deprecation warning.

See commit 2934ee2cda ("dts: bindings: Remove 'title:' and put all info.
into 'description:'").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-24 10:53:36 +01:00
Ulf Magnusson
ba2f95ab39 kconfig: Show unsatisfied deps. when assignments don't take
Show which dependencies are unsatisfied when symbols don't get their
assigned value.

For example, assume that FOO below is assigned with CONFIG_FOO=y. Note
that BAR, BAZ, and STR = "hmm" are 'n'.

    config FOO
           bool "foo"
           depends on BAR && BAZ && QAZ && STR = "hmm"

    config BAR
           def_bool n

    config BAZ
           def_bool n

    config QAZ
           def_bool y

    config STR
           def_string "zmh"

This now prints this warning:

    warning: FOO (defined at /home/ulf/z/z/Kconfig:10) was assigned the
    value 'y' but got the value 'n'. Check these unsatisfied
    dependencies: BAR (=n), BAZ (=n), STR = "hmm" (=n). See ...

Fixes: #21888

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-23 23:04:09 +01:00
Sebastian Bøe
d3a8fd40b9 cmake: Add option for exporting build metadata to Make
Add an opt-in feature that will generate a Makefile with build
variables like CC, and KBUILD_CFLAGS for consumption by third-party
Make-based build systems.

This emulates the 'outputexports' target that KBuild supported and is
supported for the same reasons that KBuild supported it. Easier
integration with third-party build systems.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2020-01-23 15:09:12 -05:00
Anas Nashif
c9171be27e samples: drivers: fix build of spi_fujitsu_fram sample
Use DTS filtering and get binding based on DTS variable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-23 14:18:40 -05:00
Jonas Norling
5f2d038410 net: ipv6: nbr: Add neighbor when responding to NS
A neighbor solicitation packet for an address that is not ours should
not cause the sender to be added to the neighbor cache. See RFC 4861
section 7.2.3.

Add the neighbor to the cache when we have decided to respond to the
NS packet.

Fixes #21869.

Signed-off-by: Jonas Norling <jonas.norling@greeneggs.se>
2020-01-23 21:10:48 +02:00
Jonas Norling
744665f5f4 net: ipv6: nbr: Factor out parsing of ll address option
Use the same code when parsing source link-layer address option for
both RA and NS packets. It looked like handle_ns_neighbor() could
actually read too much data into lladdr.addr when handling 8-byte
addresses (802.15.4).

Signed-off-by: Jonas Norling <jonas.norling@greeneggs.se>
2020-01-23 21:10:48 +02:00
Ravi kumar Veeramally
326302eda0 samples: net: echo_server: Do not bail out on Accept errors
Echo-server sample should not bail out on failed
accept() calls. This sample should close socket
in case of any errors and keep listening on socket
for further incoming connections.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-01-23 21:07:18 +02:00
Ravi kumar Veeramally
d228dd0c85 samples: net: echo_server: Add signed certs and keys
Current sample certs and keys are not signed. Adding
signed certificates and keys. CA file also added.
This helps users to test with different kind of
configurations.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-01-23 21:07:18 +02:00
Anas Nashif
dd65f7c38a sanitycheck: change distribution of tests per set
Sort by testcase name and path and not by platforms. This way we do not
have the same platform executing on CI system causing failures to
overload.

Right now we have almost all qemu targets executing on 1 or 2 nodes,
causing those systems to be overloaded. Instead of taking the default
sorting by platforms, we now sort by testcases, so the distribution is
more "random", but still reproducible.

Remove the ordering function that would put native_posix in the first
set, it is not being used anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-23 14:02:59 -05:00
Jose Alberto Meza
d23c570644 samples: drivers: espi: Showcase eSPI OOB channel APIs
Add sample usage for eSPI OOB driver transactions

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-01-23 12:17:48 -05:00
Jose Alberto Meza
d1f0fbfec5 drivers: espi: xec: Add support for eSPI OOB channel operations
Implement send/receive out-of-band packet APIs

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-01-23 12:17:48 -05:00
Audun Korneliussen
917afdf89d subsys/fs/fatfs: Add kconfig option for FAT LFN (Long Filename)
ELM FatFS implementation supports LFN, enabled via ffconf.h
configuration file. Additionally, code page (character set),
max file name length, and memory mode (LFN working buffer location)
are configurable options closely related to LFN.
Without LFN filenames are restricted to 8.3 filename format.

Add kconfig options to expose following FatFS configurations:
enable LFN, specify max filename length, specify code page
(character set), specify LFN working buffer location.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2020-01-23 17:50:19 +01:00
Joakim Andersson
bf33338652 Bluetooth: host: Fix net buf assert on att encrypt change event
Fix assert in net_buf triggered on att encrypt change event.

	ASSERTION FAIL [net_buf_simple_headroom(buf) >= len] @
	  ZEPHYR_BASE/subsys/net/buf.c:881

This happens because when the att request was allocated, it was not
properly initialized and req->retrying was left as true.
This caused the att encrypt change handling to assume an att request
needed to be resent, starting resending with an invalid request and
request buffer.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-23 18:08:24 +02:00
Ulf Magnusson
f84abe9011 Bluetooth: shell: kconfig: Do not select FLASH_SHELL from BT_SHELL
Fixes some selects with unsatisfied dependencies. FLASH_SHELL depends on
FLASH_PAGE_LAYOUT, but only FLASH_SHELL is selected. The select was
introduced in commit 3aa2a1c6db ("flash: make flash shell generic").

Spoke to Johan Hedberg. The BT_SHELL code does not depend on
FLASH_SHELL. He didn't think people would assume that BT_SHELL by itself
enables the FLASH_SHELL commands either.

Just remove the select.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-23 17:54:08 +02:00
Andrzej Puzdrowski
997be3d04d drivers/flash/flash_simulator: erase posix flash in initialization
After startup the native_posix flash was filed by 0x00 instead
of 0xff, which is not coherent with erased byte value which
is 0xff for the native_posix target.

Such inconsistent behavior makes for instance running
a storage system designed(or configured) for a flash device
with 0xff as erased byte values problematic.

This patch makes flash erased after new flash device file creation.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-23 10:51:42 -05:00
Rihards Skuja
f59b92b3ee runners: openocd: don't throw when no config is provided
In some cases the config is already provided for us e.g. when setting
OPENOCD_NRF5_SUBFAMILY. Also it looks like config was always supposed to
be optional (there are checks for it on do_run()).

Signed-off-by: Rihards Skuja <rihardssk@mikrotik.com>
2020-01-23 10:38:57 -05:00
Alex Porosanu
3412612085 bluetooth: controller: refactor CMake related files
Zephyr aims to enable supporting of multiple SW defined
BLE LL. There is a complex hierarchy of defines in the
CMake files controlling the compilation units that part of
the final library. Adding another SW LL implementation
from a different SoC provider will make the main controller
CMake file unmaintable.
As such, split the into vendor-specific CMake files for
easier additions.

Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
2020-01-23 16:08:00 +01:00
Joakim Andersson
751868a806 samples: smp_svr: Handle advertise start in disconnected callback.
With a recent change introduced a connectable advertiser will reserve
a connection object when started. In the disconnected callback the
disconnected connection object is not yet released, so the application
is not able to allocate this connection object for a new connectable
advertiser until after the disconnected callback.

reserve conn commit: 46bf20036a

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-23 14:13:17 +02:00
Benjamin Valentin
2539a1751d soc: atmel_sam0: update dts_fixup.h for TRNG
Update dts_fixup.h to re-use the SAM TRNG driver.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2020-01-23 12:40:59 +01:00
Benjamin Valentin
2fef2002e8 soc: atmel_sam0: add SAM TRNG to DTS
We can use the SAM entropy node here.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2020-01-23 12:40:59 +01:00
Benjamin Valentin
633d57508f drivers: entropy: sam: Add support for sam0
SAM0 uses the same TRNG as SAM, so it's trivial to add support
for this line of MCUs.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2020-01-23 12:40:59 +01:00
Ulf Magnusson
31822c6d5b doc: kconfig: Explain why zephyr/.config assigns promptless symbols
I think a lot of the confusion with promptless symbols being assigned
might come from opening zephyr/.config, seeing that it assigns a bunch
of promptless symbols, and assuming that Kconfig must respect those
assignments, even though it doesn't.

Explain why zephyr/.config assigns promptless symbols (it's because it
doubles as configuration output). That should clarify things a bit.

Also mention what "invisible" means for symbols early on in the page.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-23 12:32:42 +01:00
Øyvind Rønningstad
05f0d85b6a extensions.cmake: Replace TEXT_START with ROM_START
In zephyr_linker_sources().
This is done since the point of the location is to place things at given
offsets. This can only be done consistenly if the linker code is placed
into the _first_ section.

All uses of TEXT_START are replaced with ROM_START.

ROM_START is only supported in some arches, as some arches have several
custom sections before text. These don't currently have ROM_START or
TEXT_START available, but that could be added with a bit of refactoring
in their linker script.

No SORT_KEYs are changed.

This also fixes an error introduced when TEXT_START was added, where
TEXT_SECTION_OFFSET was applied to riscv's common linker.ld instead of
to openisa_rv32m1's specific linker.ld.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-01-23 03:22:59 -08:00
Ioannis Glaropoulos
5fcbe4e5d5 arch: arm: cortex-m: move openocd sections after _vector_end
openocd linker sections are not supposed to be part of the
vector table sections. Place the sections after we define
the _vector_end linker symbol.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-23 03:22:59 -08:00
Ioannis Glaropoulos
e94551e2b7 arch: arm: cortex-m: properly name ROM sections in the linker
This commit does the following:
- renames the 'text' ROM section to 'rom_start', to reflect
  that this section is the first section of the image.
- renames the 'TEXT_SECTION_NAME_2' section to 'text', since
  that section (whose start is pointed by _image_text_start)
  holds the entire image text section.

The commit removes the confusion by having multiple ROM sections
named as 'text' in ARM Cortex-M builds.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-01-23 03:22:59 -08:00
Ioannis Glaropoulos
29d88c6c73 arch: arm: cortex-m: linker.ld: do not indent preprocessor directives
We should not use indentation for pre-processor directives.
This commit fixes the indentation in the ARM Cortex-M linker
script.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-23 03:22:59 -08:00
Carlo Caione
b9fc192779 drivers: uart_pl011: Enable shared interrupts support
The PrimeCell UART (PL011) IP can use one single combined/shared
interrupt line instead than different IRQ lines for TX/RX/Err/... This
is the most common configuration supported in the Linux world but not
currently supported in Zephyr. QEMU emulates a PL011 UART with a single
interrupt line as well.

To support this configuration we have to hookup the PL011 driver with a
shared IRQ driver and add two new configuration options when the shared
IRQ line is used.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-01-23 02:04:52 -08:00
Marek Pieta
e2905c09cb Bluetooth: controller: Fix Kconfig dependency
Change adds missing Kconfig dependency.
The CONFIG_BT_CTLR_FILTER is used only for SW Link Layers.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2020-01-23 11:00:17 +01:00
Moonkwun Jung
a67ca8f202 dts: arm: st: h7: fix stm32h7 separate cores
Currently, only the stm32h747 soc is supported in the h7 foler.
The h7 series comes with both single core and dual core products.
This change moves C-M4 core out of stm32h7.dtsi so that it can be
included by single core STM32H7 soc description.

Signed-off-by: Moonkwun Jung <mkainyh@gmail.com>
2020-01-23 09:54:39 +01:00
Ulf Magnusson
77743741e6 soc: psoc6: kconfig: Do not select CPU_CORTEX_M_HAS_DWT on Cortex-M0
CPU_CORTEX_M_HAS_DWT depends on

    !CPU_CORTEX_M0 && !CPU_CORTEX_M0PLUS

, but SOC_SERIES_PSOC62 unconditionally selects it, even for
SOC_PSOC6_M0. This forces CPU_CORTEX_M_HAS_DWT on on Cortex-M0.

Fix it by moving the selects for CPU capabilities to the more specific
SOC_PSOC6_{M0,M4} symbols. This seems more readable than adding a
condition to the 'select CPU_CORTEX_M_HAS_DWT'.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-23 09:39:01 +01:00
Ulf Magnusson
97de99adca console: kconfig: Have CONSOLE_{GETCHAR,GETLINE} depend on UART_CONSOLE
CONSOLE_GETCHAR and CONSOLE_GETLINE select CONSOLE_HANDLER and
UART_CONSOLE_DEBUG_SERVER_HOOKS, which depend on UART_CONSOLE, but
UART_CONSOLE is n for some boards, giving a select with unsatisfied
dependencies and a warning. Triggers in CI.

Looking at the code, CONSOLE_{GETCHAR,GETLINE} also depend on
UART_CONSOLE there. Add a 'depends on UART_CONSOLE' to the 'choice' that
contains them.

Maybe the samples/subsys/console/{echo,getchar}/ samples shouldn't be
run on some boards that they're currently run on, but there's still the
issue that CONSOLE_{GETCHAR,GETLINE} shouldn't be shown in menuconfig
when they don't apply.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-22 22:47:02 -05:00
Robert Lubos
9b2fa8a5a7 net: sockets: Rework ioctl poll helpers error handling
Make ioctl handlers of `ZFD_IOCTL_POLL_PREPARE` and
`ZFD_IOCTL_POLL_UPDATE` return an error code instead of setting errno
variable.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-22 22:43:54 -05:00
Andrew Boie
8eecb3717a samples: shared_mem: fix exception printouts
Enable CONFIG_TEST so that we get the necessary defines for
console output when a fatal error happens, as well as assertion
checking.

Remove an unnecessary self-abort in main(), this causes an
assert to fail. Letting main() return does the same thing, more
gracefully.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-01-22 22:41:50 -05:00
Flavio Ceolin
2abfccb352 driver: uart: ns16550: Simplify drv_cmd function
There is only one possible command, so just use if instead of switch
to avoid several MISRA-C violations and also avoid set dev_data wrongly
unused when UART_NS16550_DLF_ENABLED is defined.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-22 21:21:49 -05:00
Flavio Ceolin
661035a6b8 west: runners: stm32: Remove unecessary assignment
msg_text is unconditionally assigned later and this inital value is
never used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-22 17:37:41 -05:00
Flavio Ceolin
9dbb50bac8 scripts: sanitycheck: Simplify if statement
Outer if is checking if the variable is in a list with two options
which means that we can just do an if / else and remove an assignment.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-22 17:37:41 -05:00
Anas Nashif
91920268e0 net: remove sample implementing NATS
A sample implementing NATS protocol that is not part of the Zephyr
networking subsystem. The implementation is not maintained and only
served as a proof of concept.

Related to #20017

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-22 13:55:52 -05:00
Ioannis Glaropoulos
937c9c215f tests: arch: arm: interrupt: add test-case for user mode IRQ locking
We add a simple test to cover the case of invoking
IRQ lock()/unlock() from ARM Cortex-M user mode.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-22 12:08:14 -06:00
Robert Lubos
e93ccd9973 boards: qemu_x86: Add ieee802154 capability
Extend `qemu_x86` board configuration with `ieee802154` capability, to
allow it to execute `ieee802154` tests.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-22 11:57:11 -06:00
Robert Lubos
8801fd015f tests: net: ieee802154: Set LL addresses on a packet
The reworked 6lowpan implementation asserts when no LL source or
destination address is set on a packet. This caused the fragmentation
tests to fail before they completed.

Fix the issue, by setting a dummy address on a packet during a setup.

Fixes #19761

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-22 11:57:11 -06:00
Robert Lubos
799a8401e7 net: 6lo: Fix memory corruption during uncompression
A memory corruption could happen in `uncompress_IPHC_header` function,
when data was moved to make place in the net buffer for the uncompressed
IPv6/UDP header.

The size of data being moved should only contain the original data size,
not incremented by the amount of space needed to expand the header,
which was already added to the net buffer size. In result, the `memmove`
operation could exceed the allocated net buffer and cause memory
corruption.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-22 11:57:11 -06:00
Ulf Magnusson
45050dda48 kconfig/cmake: Improve reconfiguration behavior
There are some issues with the behavior when rerunning CMake in an
already initialized build directory:

 1. The check for assignments to promptless symbols in configuration
    fragments isn't run when reconfiguring, because it only runs if
    zephyr/.config doesn't exist

 2. As outlined in
    https://github.com/zephyrproject-rtos/zephyr/issues/9573, you can
    get into situations where zephyr/.config is invalid (e.g. due to
    being outdated), but menuconfig/guiconfig can't be run to fix it

 3. If kconfig.py fails while merging fragments during reconfiguration,
    it will ignore the fragments during the next reconfiguration and use
    the existing zephyr/.config instead, because the fragment checksum
    is calculated and saved before running kconfig.py

(Footnote: The input configuration file(s) to kconfig.py can be either a
list of configuration fragments, when merging fragments, or just
zephyr/.config, if the merged configuration is up-to-date. The output
configuration file is always zephyr/.config.)

To fix the first two issues, explicitly tell kconfig.py when it's
dealing with handwritten configuration input (fragments), via a new
--handwritten-input-configs flag. This is more robust than checking
whether zephyr/.config exists, which was the old logic.

When dealing with handwritten input, there should be no assignments to
promptless symbols. Assignments to promptless symbols is expected in
zephyr/.config however, because it doubles as configuration output.

When running menuconfig/guiconfig, the input configuration is
zephyr/.config rather than configuration fragments, so this change also
makes sure that menuconfig can always be run as long as zephyr/.config
exists and is up-to-date.

To fix the last issue, only write the checksum for the configuration
fragments if kconfig.py succeeds (which means it wrote a
zephyr/.config).

Also improve naming a bit, add help texts for the command-line
parameters to kconfig.py, and simplify write_kconfig_filenames() by
moving logic into it.

Partial fix for
https://github.com/zephyrproject-rtos/zephyr/issues/9573, without the
part in #issuecomment-469701831. Can still run into issues when e.g.
when CMake files can't make sense of settings.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-22 18:28:07 +01:00
Jim Shu
e1052a0f8d tests/kernel/fatal: add volatile to prevent compiler optimization
Initialization of local variable 'illegal' can't be optimized, or the
program will jump to the memory contains random value which causes the
unexpected behavior. Add volatile to local variable 'illegal' to prevent
compiler optimization.

Signed-off-by: Jim Shu <cwshu@andestech.com>
2020-01-22 07:08:12 -08:00
Sebastian Bøe
011da8c1b0 samples: Add sample 'application_development/out_of_tree_driver'
Add a sample that demonstrates (and tests) that custom drivers can be
maintained outside of Zephyr.

The sample is fairly minimal with few dependencies and should
therefore be very portable. It also includes a sample.yaml that should
ensure that it does not regress.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2020-01-22 09:26:12 -05:00