Commit Graph

52613 Commits

Author SHA1 Message Date
Martin Jäger a46a36a4cf task_wdt: Pause hardware wdt during debugging
Enable the option to pause the fallback hardware watchdog if the MCU is
halted by a debugger.

This fixes issue #33509 where some boards with Nordic MCUs could not be
flashed anymore after using the task watchdog sample.

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-05-21 05:00:07 -05:00
Martin Jäger 784e6847df samples: drivers: watchdog: Pause during debugging
Enable the option to pause the watchdog if the MCU is halted by a
debugger.

This fixes an issue with some Nordic MCUs (see #33509) where the board
could not be flashed anymore if a short watchdog timeout (<100 ms) was
used.

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-05-21 05:00:07 -05:00
Watson Zeng 2cf355f92b boards: arc: explicitly set link lib for hs boards with mwdt
arcmwdt toolchain has various pre build libraries, we can find it in
path: {METAWARE_HOME}/lib, and it will use av2em lib by default.
it's OK for em boards, but not suitable for hs boards. I have tested
hs38_full library for hs boards, it's OK. let's use it.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-05-21 04:59:37 -05:00
Benjamin Lindqvist f0f1a4d724 net: lwm2m: no duplicate device error codes
The resource description on the OMA LwM2M registry states that only the
first instance of a particular error should trigger creation of a new
error code instance.

Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>
2021-05-21 04:55:26 -05:00
Francois Ramu aa2e915fbf drivers: dma: stm32 dmamux has request 0 for mem-to-mem
The request ID = 0 is allowed for mem-to-mem data
transfer through the DMAMUX.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-05-21 04:55:02 -05:00
Krzysztof Chruscinski eb949d01d3 tests: drivers: uart: Add test for uart power management
Added test which validates that uart device correctly handles
going to and from low power state.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-21 04:53:19 -05:00
Krzysztof Chruscinski 7d61be9e79 drivers: serial: nrf_uarte: Fix uart_callback_set unsupported handling
Function should return -ENOTSUP when asynchronous api is not
supported by the device.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-21 04:53:19 -05:00
Krzysztof Chruscinski 8af5dbc977 drivers: serial: nrf_uarte: Fix power management transitions
Deadlock may occur when uart device was put to low power state
while uart_poll_out was in progress. Poll out pends until uarte
is ready to send new byte and it is detected by endtx and txstopped
events being set. When uarte was disabled while poll_out was pending
events were never set and that lead to deadlock. Added a step
in going to low power state in which CPU waits for txstopped event
and only after that uarte peripheral is disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-21 04:53:19 -05:00
Nicolas Pitre b8d24ffb45 arm64: mitigate FPU-in-exception usage side effects
Every va_start() currently triggers a FPU access trap if FPU is not
already used. This is due to the fact that va_start() must copy FPU
registers that are used for float argument passing into the va_list
object. Flushing the FPU context to its owner and granting access to
the current thread is wasteful if this is only for va_start(),
especially since in most cases there are simply no FP arguments
being passed by the caller.

This is made even worse with exception code (syscalls, IRQ handlers,
etc.) where the exception code has to be resumed with interrupts
disabled upon FPU access as there is no provision for preserving an
interrupted exception mode's FPU context.

Fix those issues by simply simulating the sequence of STR instructions
that the va_start() generates without actually granting FPU access.
We limit ourselves only to exception context to keep changes to a
minimum for now.

This also allows for reverting the ARM64 exception in the nested IRQ
test as it now works properly even if FPU_SHARING is enabled.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-05-21 04:52:44 -05:00
Kumar Gala 58d3760533 boards: arm: lpcxpresso55s28: Remove NS board config
There is no known TFM/secure side solution for the lpcxpresso55s28.
The '_ns' board config variant was added as a copy/pasted based on
how some other boards did things.  If/when TFM supports the board
we can revert this to support it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-20 23:44:13 -05:00
Asger Munk Nielsen 38850b4820 Bluetooth: Controller: fix uninitialized variable
Fixes issue #35157
[Coverity CID: 221380]

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2021-05-20 21:27:40 -04:00
Lauren Murphy f77d5c5c53 samples: tensorflow: change from file list to glob in cmakelists.txt
Changes CMakeLists.txt in TensorFlow samples from explicit file
list to a GLOB capturing src/* to make TensorFlow samples consistent
with other samples in tree.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Lauren Murphy e4b985b929 samples: tensorflow: fix documentation
Fixes documentation for samples that incorrectly state that TensorFlow
library requires the -fno-threadsafe-statics flag to compile.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Lauren Murphy e6b8c50599 samples: tensorflow: add no-threadsafe-statics to compiler flags
Adds no-threadsafe-statics to compiler flags for gcc and arcmwdt.

The flag is required to compile the samples - the module can compile
without it.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Armando Visconti 468c553190 drivers/sensor: iis2iclx: (FIX) enable interrupt selectively
(same considerations as commit 2f01479b)
In a multi-instance driver it may happen that on some h/w
one device should use interrupts and a second device should use
polling mode. So, CONFIG_IIS2ICLX_TRIGGER is not enough to discriminmate
if interrupt inizialization routine should be called or not; the choice
is now based whether the "irq-gpios" property is present in the DT
for that particular instance or not.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-05-20 17:55:08 -04:00
Armando Visconti 1f851bc268 drivers/sensor: lsm6dso: use gpio_dt_spec oriented macros
Use gpio_pin_configure_dt() and gpio_pin_interrupt_configure_dt()
for drdy_gpio: they result in a more readable code.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-05-20 17:55:08 -04:00
Andy Ross 3953e07822 tests/kernel/mem_heap: Add minimum-size heap test
Add test to statically allocate a minimum-size heap, verify that it
works to allocate a single byte and that it doesn't overrun its memory
bounds.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-05-20 17:52:21 -04:00
Andy Ross d37370301c k_heap: Clamp to a minimum heap size
The K_HEAP_DEFINE macro would allow users to specify heaps that are
too small, leading to potential corruption events (though at least
there were __ASSERTs that would catch this at runtime if enabled).

It would be nice to put the logic to compute this value into the heap
code, but that isn't available in kernel.h (and we don't want to pull
it in as this header is already WAY to thick).  So instead we just
hand-compute and document the choice.  We can address bitrot problems
with a test.

(Tweaks to heap size asserts and correct size bounds from Nicolas Pitre)

Fixes #33009

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-05-20 17:52:21 -04:00
Enjia Mai 04c736d98d tests: interrupt: refine the offload case not rely on delay timing
The interrupt offload testcases fail on some boards because the timing
of the delay is too short. Refine the testcases and make it not rely
on the delay timing.

Fixes #35097
Fixes #35241

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-05-20 17:34:09 -04:00
Hou Zhiqiang 5f61d89233 boards: ls1046ardb: Correct the reference clock of system counter
It is 25 MHz on LS1046ARDB, so correct it.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2021-05-20 13:54:54 -05:00
Simon Guinot 54d3f136ec tests: drivers: dma: enable tests on nucleo_f070rb
This patch enables the DMA chan_blen_transfer and loop_transfer tests on
the nucleo_f070rb board.

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2021-05-20 13:24:18 -05:00
Simon Guinot 1945f70eee drivers: dma: stm32: fix build for STM32F0 MCUs
The STM32F0 MCUs (except STM32F030XC) don't have a DMA channel selection
register (DMA_CSELR). This patch fixes the build of the dma_stm32 driver
for them.

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2021-05-20 13:24:18 -05:00
Martin Jäger 79531c86a2 task_wdt: use correct hardware watchdog channel number
The hardware watchdog was always fed with channel ID 0. This is correct
in most cases, but we should still use the actual ID returned from
wdt_install_timeout.

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-05-20 13:18:45 -05:00
Gerard Marull-Paretas 381180c46f doc: scripts: gen_kconfig_rest: fix rendering issues
As of today we assume that the help text contained in the Kconfig help
field will be properly formatted RST. However, there is no guarantee
that this will happen. This patch tries to address this problem by:

- Escaping inline RST characters for text that needs to be rendered as
  "normal text" (i.e. prompt)
- Use code-blocks to render help content. This way help is rendered as
  literal text and so it does not get processed by the RST parser.

A secondary change: the index table now contains the prompt information
only. The page was taking a long time to render because of the large
amount of content. Using a table doesn't help either. Note that adding
code-block to include help as a literal increases build time even more,
so it is not an option.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-20 13:18:05 -05:00
Kevin Townsend 7f89f9dbd8 doc: release-notes-2.6: Add issue with mbedtls PSA API and TF-M
Adds a note on a known config conflict with mbedtls 2.26.0 and TF-M
where the mbedtls PSA APIs can no be enabled at the same time as TF-M.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-05-20 13:17:02 -05:00
Gerard Marull-Paretas 8c4b757fd4 doc: remove redundant breathe project
The default breathe project is `Zephyr`, so there is no need to specify
it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-20 20:04:51 +02:00
Gerard Marull-Paretas 830de4c905 doc: conf: remove unused breathe project
the `doc-examples` project is not used and, in fact, is a duplicate of
the Zephyr project.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-20 20:04:51 +02:00
Gerard Marull-Paretas 2d06ad7ee4 doc: make some Sphinx config path absolute
Make all paths absolute.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-20 20:04:51 +02:00
Gerard Marull-Paretas 07a5cd5322 doc: extensions: doxyrunner: make html output optional
Make HTML output optional. The extension checks the `GENERATE_HTML`
option to check if active.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-20 19:57:20 +02:00
Andrzej Puzdrowski da9e947f7a tests/subsys/setting/functional: ignore settings_delete() retval
Explicitly ignore return value of the settings_delete() call.

fixes #32921

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-20 19:44:35 +02:00
Simon Guinot aa8e34302a drivers: systick: fix cycle count in sys_clock_set_timeout()
With this patch the sys_clock_set_timeout function counts the cycles
elapsed while computing the systick timer's new load (tickless mode).
This cycles are then added to the total cycle count instead of being
lost.

This patch mitigates uptime drifting in tickless mode (especially when
high frequency timers are registered).

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2021-05-20 08:44:55 -05:00
Vinayak Kariappa Chettimada 858dc7fab4 Bluetooth: controller: Fix EVENT_OVERHEAD_START_US jitter
As EVENT_OVERHEAD_START_US offset is used in ticks unit in
LLL, ULL scheduling using ticker should also use ticks unit
for EVENT_OVERHEAD_START_US when reducing the first
connection event preparation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-20 15:33:55 +02:00
Vinayak Kariappa Chettimada 8cfbaf5d55 Bluetooth: controller: Revert strict preempt ticker start failure check
Revert the strict preempt ticker start failure check.
Preempt ticker start can fail when enqueuing prepares into
already filled pipeline which has preempt ticker already
started for the first prepare that was added in the
pipeline.

Regression introduced in commit 5b75bdf589 ("Bluetooth:
controller: nRF5: Check preempt event on timeout").

Fixes #35476.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-20 15:33:32 +02:00
Krzysztof Chruscinski 281a9407c5 lib: os: cbprintf: Add ARG_UNUSED to unused arguments
Picky C++ compilation reported warnings that input arguments
are not used. Adding missing ARG_UNUSED().

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-20 08:23:31 -05:00
Krzysztof Chruscinski 81f0f4efd0 lib: os: cbprintf: Add missing initialization of structure fields
C++ compiliation may generate warning if all fields are not
explicitly initialized. Added explicit initialization to 0.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-20 08:23:31 -05:00
Krzysztof Chruscinski 8ffc8ff267 logging: Add missing initialization of structure fields
C++ compiliation may generate warning if some fields are not
explicitly initialized. Added explicit initialization to 0.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-20 08:23:31 -05:00
Thomas Stranger 0388ebb6f6 samples: can: fix parenthesis for can_recover call
This commit fixes a single wrongly placed parenthesis in the can bus
sample.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-20 07:51:06 -05:00
Watson Zeng 214d91c19d toolchain: arcmwdt: linker: fix placeholders for arcmwdt toolchain
syntax ". += length;" not work with arcmwdt toolchain, let's using
". = . + length;", which both work with gnu and arcmwdt toolchain.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-05-20 07:50:38 -05:00
Emil Gydesen 01c4d597b3 Bluetooth: Host: Avoid memcpy'ing bt_addr_t to same pointer
From le_ext_adv_param_set we will occasionally attempt
to call bt_addr_copy where the `addr` and &adv->random_addr.a
are the same pointer. Doing a memcpy where source and destination
is the same pointer is undefined behavior and should not be
done.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-20 13:22:21 +02:00
Emil Gydesen 7d3def3275 Bluetooth: Audio: Fix VCS client shell missing compile
The VCS client shell was never compiled before, and thus
the implementation had a few undetected errors.

This commit adds the VCS client to the shell CMakelists
as well as fixing the issues.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-20 13:19:17 +02:00
Emil Gydesen 71c7566b96 Bluetooth: Audio: Move NULL check for conn in bt_vcs_discover
Move the check for the connection pointer before we get the
index.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-20 13:02:56 +02:00
Emil Gydesen 03a2c291c0 Bluetooth: Audio: Fix dead code issue in VCS
The common API functions in VCS had dead code in specific
configurations, causing coverity issues. Fixed by this
commit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-20 12:00:57 +02:00
Gerard Marull-Paretas 5738114df2 doc: scripts: gen_devicetree_rest: use utf-8 encoding
Use utf-8 encoding when opening vendor prefix files.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-20 03:07:44 -05:00
Martí Bolívar bd122e5ea2 edtlib: validate compatible properties
Error out on compatible properties with invalid values. The regular
expression used to validate them matches what's used in dt-schema.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-19 22:18:25 -05:00
Martí Bolívar 350084a5b4 boards: xtensa: fix invalid compatibles
These should not have whitespace, and underscores are discouraged.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-19 22:18:25 -05:00
Martí Bolívar c15d5eb01c boards: u-blox: fix invalid compatibles
These should not have whitespace, and underscores are discouraged.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-19 22:18:25 -05:00
Martí Bolívar aae8e195e0 boards: it8xxx2_evb: fix invalid compatible
This should not have whitespace in it, and underscores are
discouraged.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-19 22:18:25 -05:00
Martí Bolívar b6fbc20de4 dts: add 'linaro,' prefix to 96b-lscon-1v8, 96b-lscon-3v3
These compatibles don't match the dt-schema regular expression for
compatible properties that we'd like to support in Zephyr because they
do not begin with a letter.

Use linaro, as a vendor prefix to make them compliant. Update the
release notes since out of tree users will need to keep up.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-19 22:18:25 -05:00
Henrik Brix Andersen aa78a6473b tests: kernel: gen_isr_table: do not use IRQ 57 on NXP LPC55S16
IRQ 57 is reserved in the NXP LPC55S16 SoC. Thus, limit the number of
interrupts reported to the test, so that it does not try to use it.

Fixes #34915

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-05-19 16:16:32 -05:00
Vinayak Kariappa Chettimada c0a8f38ec6 Bluetooth: controller: Avoid deferencing null return value
Add assert check to avoid deferencing null return value by
ull_adv_set_get() function.

Fixes #35347.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-19 17:10:08 -04:00