Commit graph

44062 commits

Author SHA1 Message Date
Torsten Rasmussen 1c3fd85c94 CODEOWNERS: Add reviewers on Synopsys metaware toolchain
Adding Synopsys developers as reviewers on arcmwdt components.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-14 09:35:09 -04:00
Carles Cufi d20b6f90ea github: labeler: Fix dts/ folder matching
Use the syntax described in:
https://github.com/actions/labeler#common-examples

in order to rewrite the matching expression for the dts/ folder.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-14 09:33:06 -04:00
Eug Krashtan 36128bde19 samples: net: sockets: Fix for multicast filtering
After adding 'Multicast group filtering' (commit b7b73d0) server should
join CoAP IPv6 multicast group to accept multicast CoAP messages.

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2020-09-14 10:27:50 +03:00
Trond Einar Snekvik 61819f23f9 Bluetooth: Mesh: Virtual address memory leak
Fixes a memory leak when a virtual address subscription is added for a
model that either has this VA already, or the model has no more space
for subscription addresses.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-09-12 22:48:20 +03:00
Anas Nashif bc8832f6c8 actions: add backporting bot
With new event 'pull_request_target' it is now possible to run the
backporting action that we used to have in the past as a Github app.

Use labels for backporting as before.

See https://github.com/tibdex/backport for more details.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-12 07:28:16 -04:00
Carles Cufi bbcda199bf github: actions: Use on-PR labeler
Now that the standard GitHub action supports forks, switch to the on-PR
action instead of running a cronjob.

Reference:

https://github.com/actions/labeler/issues/12#issuecomment-670967607

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-12 07:27:41 -04:00
Erwin Rol 7219924ee0 boards: nucleo_l4r5zi: Correct SPI1 SCK pin setting
The original configuration mentioned, quote;

/* SPI1_SCK should output on PA5, but is used for LD2 */

But according the the schematic MB1312 from  7-11-2019
LD2 is on pin PB6 or PB7 (jumper selectable). And PA5
shares LD1 with PC7, but the default jumper settings
are that PC7 controls the LD1, and PA5 is not connected
to anything but the extension header.

Also the DTS file already has the green_led_0 (LD1) on
pin PC7, and blue_led_0 (LD2) on pin PB7.

So changed pinmux to set PA5 to SPI1 SCK to make
Arduino shields work that need SPI1.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-11 09:39:45 -05:00
Guillaume Lager cb91977c48 logging: rtt: Do not retry on error in non blocking mode
Retry in non blocking mode can lead to a quite long (busy) wait.
Refs #28211

Signed-off-by: Guillaume Lager <guillaume.lager@gmail.com>
2020-09-11 09:34:54 -05:00
Alexandre Bourdiol 41621ba0bf drivers: dma: dma_stm32_v2: typo in compilation switch
For example, LL_DMA_IFCR_CTEF6 doesn't exist,
it must be replaced by LL_DMA_IFCR_CTEIF6.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-11 09:31:27 -05:00
Alexandre Bourdiol 4dbd96900d drivers: dma: dma_stm32: can't use device_get_binding() during init
Not possible to use device_get_binding() because we are
currently initializing DMA_1 device, so it is not ready and
device_get_binding() will fail.
Directly use string compare is more efficient.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-11 09:31:27 -05:00
Krzysztof Chruscinski d58841a1bd drivers: clock_control: nrf: Fix nrf53 LFXO pin configuration
Pins used for external LF clock source must be configured as
used by peripheral to allow using LFXO on network side.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-11 15:55:54 +02:00
Andrew Boie 2bc21ea4de x86: print more detail on non-present pagefaults
The CPU sets the relevant bits on who tried to do what
if the page wasn't present, print them.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-11 09:03:01 -04:00
Marjan Erzen 022e05d81f doc: fix typos in variable names
There are no fl_sector nor fl_data_off fields in fe_entry.
Changed to fe_* instead of fl_*.

Signed-off-by: Marjan Erzen <github-cwa@pinkit.de>
2020-09-11 09:02:05 -04:00
Vincent Wan 23b54832f8 drivers: wifi: simplelink: reimplement getaddrinfo
Reimplement getaddrinfo to call SlNetUtil_getAddrInfo from the TI HAL
for a more robust implementation that supports both client and server
modes, and performs better error-checking.

Fixes #11890

Signed-off-by: Vincent Wan <vwan@ti.com>
2020-09-11 15:29:03 +03:00
Torsten Rasmussen eb2a705497 cmake: support absolute path in zephyr_code_relocate() function
Fixes: #27288

The Zephyr CMake function `zephyr_code_relocate()` would treat any file
argument as relative to `CMAKE_CURRENT_SOURCE_DIR` even if an absolute
path is provided.

A file with absolute path would thus become
`${CMAKE_CURRENT_SOURCE_DIR}/<absolute-path>/<file>` which leads to a
non existing file.

This is fixed by checking if path argument is a relative path, and only
use `CMAKE_CURRENT_SOURCE_DIR` in such case.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-10 16:24:45 -05:00
Henrik Brix Andersen 2ddb80da58 samples: canbus: canopen: fix argument to CO_delete()
The CANopenNode stack function CO_delete() takes a void
*CANdriverState argument. This maps to a pointer to a struct
canopen_context in Zephyr.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-09-10 16:14:06 -05:00
Grzegorz Kostka cccb1908ac lib: fdtable: fix z_free_fd multiple calls fd leak
Multiple calls of z_free_fd against fd with refcount equal 0 are causing
descriptor table entry leak by decrementing refcount below 0.
This patch prevents decrementing refcount below zero.

Signed-off-by: Grzegorz Kostka <grzegorz@mobility.cloud>
2020-09-10 16:04:36 -05:00
Jeremy LOCHE 1740dfc8c2 drivers: bluetooth: hci_spi: fix init priority
Fixes #28275 by adding bluetooth HCI spi driver priority lower
(75 instead of 50) than SPI (70) to avoid device_get_binding
to return NULL because the device was not initialized.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-09-10 15:57:54 -05:00
Anas Nashif 994374ec51 samples: shell: fs: require keyboard harness
The test for this sample requires special setup and keyboard
interactivity.

Fixes #28153

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-10 15:55:02 -05:00
Erwan Gouriou bd416e61d6 dts/arm/st: Keep systick disabled by default
Change #28199 introduced systick configuration from device tree.
For now this should not be used on platforms that support alternate
tick source, as this is the case on l4 and wb series with LPTIM.
Until dts allows to configure lptim from dts, keep systick disabled
by default on these platforms.

Fixes #28280

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-10 15:39:47 -05:00
Maureen Helm b72f534e9d boards: arm: Add troubleshooting section to mimxrt10{50,60}_evk doc
Adds a troubleshooting section to the mimxrt10{50,60}_evk board
documents that describes how to recover when the boot header in external
flash is corrupted or invalid.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-10 15:37:40 -05:00
Jan Van Winkel 5e21434692 cmake: Ignore LDFLAGS and AFLAGS from environment
Zephyr does not use CFLAGS, CXXFLAGS, CPPFLAGS if they are defined in
the environment but provides the option to pass them via extra cmake
flags.

The option is also for seen to pass AFLAGS and LDFLAGS as extra cmake
flags but both of them are not ignored if they are defined in the
environment which could lead to unexpected behaviour.

As such lineup the behaviour between all the flags and ignore them, and
generate a warning, if they are defined in the environment.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-09-10 15:35:50 -05:00
Andrew Boie aebb9d8a45 aarch64: work around QEMU 'wfi' issue
Work around an issue where the emulator ignores host OS
signals when inside a `wfi` instruction.

This should be reverted once this has been addressed in the
AARCH64 build of QEMU in the SDK.

See https://github.com/zephyrproject-rtos/sdk-ng/issues/255

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-10 21:31:15 +02:00
Krzysztof Chruscinski 96b6da9bea tests: drivers: clock_control: Add LF clock start test
Added test which verifies various modes of waiting for system clock
(no wait, available, stable) for different clock configurations (xtal,
rc, synth).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-10 21:31:01 +02:00
Krzysztof Chruscinski dcaead68c7 drivers: clock_control: nrf: Improve waiting for LF clock
Enabled going to idle when waiting for low frequency clock.
Added 2 stages of starting LF clock when XTAL is used. First
stage is starting RC and then when it is ready XTAL is started.
It is done to get event/interrupt when RC is ready which means
that LF clock is available (but not stable).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-10 21:31:01 +02:00
Krzysztof Chruscinski c69a27b789 drivers: timer: nrf: Add configurable clock startup mode
Added configuration for approach to starting system clock source.
There are 3 options: no wait, wait untill available, wait until
stable.

Added support for those modes in clock control driver which handles
low frequency source clock.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-10 21:31:01 +02:00
Torsten Rasmussen fb16a3deb0 cmake: ensure consistent behavior between x_ROOT settings
Fixes: #23825

Today, BOARD, SOC, ARCH, DTS, KCONFIG, and TOOLCHAIN_ROOT can be
specified by users or through other CMake files.

It is not clear if relative paths are permitted and/or from where a
relative path is constructed.

Inside CMake, it is very easy to specify `${ZEPHYR_BASE}`,
`${CMAKE_CURRENT_SOURCE_DIR}`, or similar, thus there is no reason to
use relative path inside CMake, as it easy can lead to discussion on
relative to what.

For users manually invoking CMake using, `cmake ... <app-dir>` it is
nice to have to possibility to specify a relative path.
For this purpose, relative path are considered relative to the
`APPLICATION_SOURCE_DIR`.

This commit updates:
- BOARD_ROOT
- SOC_ROOT
- ARCH_ROOT
- DTS_ROOT
- KCONFIG_ROOT
- TOOLCHAIN_ROOT

to allow paths relative to `APPLICATION_SOURCE_DIR` when specified with
`-D<type>_ROOT=<relative-path>`

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-10 21:30:24 +02:00
Torsten Rasmussen 3083205f4d cmake: introduce zephyr_file() extension command
Fixes: #23825

This commit introduces a `zephyr_file()` extension command that allows
for examine a path list for relative paths, and convert relative paths
provided with `-D<path>` into absolute paths, starting from
`APPLICATION_SOURCE_DIR`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-10 21:30:24 +02:00
Robert Lubos ad6901f011 net: mqtt: Fix clean_session flag docstring
The default value of clean_session flag was made configurable in
commit 0fd16f8b78 but the docstring was
not updated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-10 20:20:03 +03:00
Andrzej Puzdrowski 285d8786ee drivers/flash/nrf_qspi_nor: corrects write-block-size to 4B
The driver is able to write with 32-bits word alignment of size
and offset, apart form sub-word writes for which it can write
part of word to aligned offset (which is a hack).

fixes #26729

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-09-10 12:10:26 -05:00
Vinayak Kariappa Chettimada c8e23139c1 Bluetooth: controller: Fix addr type in auxiliary PDU
Fix uninitialized transmitter address type being set in the
auxiliary PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-10 12:07:57 -05:00
Jukka Rissanen e15aa4866e net: context: Fix sendmsg() handling in AF_CAN socket
Because the previous commit fixed the destination address check,
we need to handle msghdr (used by sendmsg()) in CAN socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-10 12:05:48 -05:00
Jukka Rissanen 0c7d2bcd4f net: context: Simplify the param check when sending data
No need to specifically check CAN sockets here. This also means
that SocketCAN will need to support sendmsg() call too. This will
come in following commit.

Fixes #28229

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-10 12:05:48 -05:00
Peter Bigot 6c910c021e lib: os: printk: fix printing unsigned 32-bit integers
The vararg extraction for unmodified integers always used int, which
sign extends when assigned to the printk_val_t.  Avoid the sign
extension for unsigned values.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-10 11:46:56 -05:00
Kumar Gala 089f0d8202 west.yml: Update libmetal for fixes
Update to a newer libmetal snapshot to pickup some upstream fixes

Fixes #26848

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-10 10:24:18 -05:00
Andrzej Puzdrowski 6fe1fde9dc include/drivers/flash: correction on the unrestricted alignment of writes
Telling that all the driver supports unaligned writes was and
is not true. Drivers only have to support any source buffer.

This fix message introduced by #23628

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-09-10 13:23:30 +02:00
Lingao Meng 0023d3f364 Bluetooth: Mesh: Store Krp phase after krp value changed
Store krp phase persistently when this value has been changed.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-09-10 14:12:49 +03:00
Vinayak Kariappa Chettimada 48e791a625 Bluetooth: host: Fix Suggested Default Data Len for QUIRK_NO_AUTO_DLE
Add back call to LE Write Suggested Default Data Length
command so that new connections, receiving Data Length
Update procedure before local device can auto initiate, can
respond with the suggested default data length Tx octets
and Tx time.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-10 12:51:27 +02:00
Andrzej Kaczmarek 7a113ea657 Bluetooth: controller: Fix TxAdd setting in auxiliary PDU
When controller is built with extended advertising support but without
LL Privacy build fails due to issue with code that sets TxAdd in aux
PDU:

.../ll_sw/ull_adv_aux.c: In function 'ull_adv_aux_hdr_set_clear':
.../ll_sw/ull_adv_aux.c:502:25: error: 'struct ll_adv_set' has no
                                member named 'own_addr_type'
  502 |   sec_pdu->tx_addr = adv->own_addr_type & 0x1;
      |

We need own_addr_type value if an advertising set with aux but without
AD is created since we cannot get TxAdd value from other PDU.

ull_adv_aux_hdr_set_clear() can now be called with a flag to explicitly
set AdvA field and pass own_addr_type in 'value' parameter. This allows
to set proper TxAdd when creating new advertising set.

On aux updates, we use TxAdd from other PDU:
- if primary PDU has AdvA, we use TxAdd from that PDU
- if previous secundary PDU has AdvA, we use TxAdd from that PDU
In other case we just return an unpsecified error since this should not
happen in any valid scenario.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-09-10 12:40:29 +02:00
Torsten Rasmussen a5917f0af4 cmake: export build flags to external build systems excluding SHELL tag
Fixes: #28230

The introduction of CMake SHELL prefix in compile options to avoid
symbol de-duplication caused the build flag export feature to fail.

The export itself works, but unfortunately CMake only strips `SHELL`
prefix for its own compiler invocation, and not when exporting the build
flags.

This causes `SHELL` to be present in the Makefile.exports.<language>
files, leading to problems in external build systems.

This is fixed by using `zephyr_get_compile_options_for_lang()` that
strips `SHELL` and use the returned value for the export handling.

To ensure all compile options has been defined, then the inclusion of
`cmake/makefile_exports` has been moved to the end of
`zephyr/CMakeLists.txt` file.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-10 11:31:53 +02:00
Kumar Gala 184a25769c arm: systick: default CORTEX_M_SYSTICK based on dts
Use setting from devicetree to drive the default setting for
CORTEX_M_SYSTICK.  We update the dts files to default systick to be
enabled since the major of cortex-m platforms utilize it by default
(except on Nordic SoCs, TI CC13x2/CC26x2 and MEC1501 in which we
default to disabled).

Fixes #25299

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-10 09:49:00 +02:00
Alexandre Bourdiol 29f4c5e1cf tests: lib: cmsis:transform: cf64 min_ram reorder test to fit 96k
tests/lib/cmsis_dsp/transform/ with config:
   * libraries.cmsis_dsp.transform.cf64
96k is sufficient if tests steps are reordered
(decreasing malloc size)
Tested on nucleo_l476rg

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-10 09:37:35 +02:00
Alexandre Bourdiol 4e5a158253 tests: lib: cmsis:transform: cf64 min_ram 96k
tests/lib/cmsis_dsp/transform/ with config:
   * libraries.cmsis_dsp.transform.cf64
Needs more than 64k RAM.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-10 09:37:35 +02:00
Meng xianglin 79df2b032d power: allow external definition of core devices
When try to enable CONFIG_DEVICE_POWER_MANAGEMENT for a board,
the #error directive in subsys/power/device.c requires that
"MAX_PM_DEVICE" and "core_devices[]" must be defined exactly in that
file, or a compile error will come up.
For flexibility, this patch move "PM_MAX_DEVICE" to Kconfig and define
a weak version of "z_mp_core_devices[]", so any board or SOC can define
these varibles in their own module.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2020-09-09 21:21:45 -04:00
Ioannis Glaropoulos 840db3ab6a tests: kernel: fatal: minor #ifdef guard fix
HW Stack protection is required to successfully run the
stack overflow-related tests, so guard all these tests
inside #ifdef CONFIG_HW_STACK_PROTECTION. Otherwise this
test-suite fails for platforms that implement USERSPACE
but do not have HW_STACK_PROTECTION capability.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-09-09 15:40:06 -04:00
Carlo Caione d6f608219c arm64: tracing: Fix double tracing
When _arch_switch() API is used, the tracing of the thread swapped out
is done in the C kernel code (in do_swap() for cooperative scheduling
and in set_current() during preemption). In the assembly code we only
have to trace the thread when swapped in.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-09-09 15:36:43 -04:00
Maureen Helm e839458217 tests: benchmark: Fix footprint testcase.yaml to use arch_allow
Fixes the footprint testcase.yaml to use arch_allow instead of
arch_whitelist.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-09 15:09:54 -04:00
Anas Nashif 88611de9bd tests: footprint: remove deperecated API call
k_mem_domain_remove_thread is deprecated now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-09 15:09:54 -04:00
Daniel Leung 98fb6e5f22 benchmarks: add an app for commonly used kernel funcs footprint
This adds an app which utilizes common kernel functions as a
starting point to gauge kernel footprint.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-09 12:53:10 -04:00
Peter Bigot 87fdee2920 doc: release: 2.4: summarize I2C changes
One new driver, one new capability.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-09 11:48:00 -05:00