Commit graph

64667 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
ad1aae29e5 tests: Bluetooth: EDTT: Fix incorrectly disabled legacy LLCP tests
Fix incorrectly disabled tests that had been passing on
legacy LLCP implementation in the Controller.

Regression introduced in commit f023b5f611 ("Bluetooth:
controller: push topic branch to main").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-27 15:19:06 -07:00
Kevin Townsend
5d72b5b1a4 samples: tfm: Add fixed PID to custom partition
As per 'Adding Secure Partition' in the TF-M documentation,
every secure partition must have a unique 32-bit partition ID.

If no value is provided, one will be auto-allocated by the
TF-M build system, but this can lead to unpredictable behaviour
in some cases. One example is key derivation where the partition
ID is used as part of the key derivation inputs. Different builds
can results in different PID values being assigned, resulting
in inconsistent key derivation output.

To avoid these problems, this commit sets a fixed PID as a
best pratice.

A value of 1000 has been set to place it within the
'PSA and user Partitions' range (256 - 2999) described in the
documentation.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-05-27 15:18:01 -07:00
Fabio Baltieri
33cc6827ba modules: rpi_pico: fix boot_stage2 generation when using Makefiles
RPi Pico second stage bootloader generation seems to fail when using
Makefiles with:

gmake[2]: *** No rule to make target 'bootloader/boot_stage2.S'...

Changing the ExternalProject_Add byproduct to the actual generated file
and not the .S seems to fix the problem.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 11:58:37 -07:00
Mateusz Sierszulski
9906db8e64 boards: doc: Update information about generating litex_vexriscv SoC
This commit updates information about running ZephyrOS on litex_vexriscv
SoC. It also add information about generating bitstream with
Zephyr on LiteX VexRiscv and LiteX SoC Builder.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
Co-authored-by: Jagoda Szwedyk <jszwedyk@antmicro.com>
2022-05-27 11:56:55 -07:00
Carlo Caione
accc73b56b riscv: Remove unused defines.
Silly cleanup. Remove unused defines.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-05-27 11:56:21 -07:00
Dino Li
5a1c084447 driver/serial: ns16550: set NS16550 as default variant
This add UART_NS16550_VARIANT_16550 configuration inside the choice
of UART_NS16550_VARIANT_NS16750 and UART_NS16550_VARIANT_NS16950.
The configuration is enabled by default to make NS16550 device to get
correct FIFO size configuration (16 bytes).

fixes #45783

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2022-05-27 11:55:31 -07:00
Maureen Helm
4049ccf621 doc: release: Add sensor release notes for v3.1.0
Added comments about new drivers, bug fixes, and enhancements made to
sensor drivers since the last release.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-05-27 11:54:22 -07:00
Daniel Leung
b5509cb234 tests: log_api: workaround QEMU crashing on qemu_leon3
When running twister during logging.log2_api_immediate_printk_cpp
on qemu_leon3, it reports unexpected eof even though the tests
reported successful. This results in twister reporting the test
being failed due to "unexpected eof".

When running it using west build, QEMU quits immediately after
printing PROJECT EXECUTION SUCCESSFUL instead of simply waiting
there for Ctrl-A X.

So workaround this by changing the main stack size to 4096.

Related to #46056

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-05-27 11:45:58 -07:00
Jonathan Rico
d3138c937f Bluetooth: host: don't timeout when reconfiguring an l2cap channel
The request timer started on the first l2cap channel when doing an MTU
reconfiguration has to be stopped when the response is received. Else the
channel will get into a bad state.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-05-27 16:03:33 +02:00
Stephanos Ioannidis
735ddeb4a8 tests: newlib: thread_safety: Add min. RAM constraint for stress tests
This commit adds a separate minimum RAM constraint for the thread-
safety stress tests because they have a significantly higher RAM
usage compared to the basic functional tests.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-26 15:11:43 -07:00
NingX Zhao
1bc003ad6a tests: net: Adjusting the memory buffer for ETH
The net cases failed to run on sam_e70b_xplained
platform because failed to reserve data net buffers,so
adjusting the memory buffer to fix this.

Fixes #42857

Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
2022-05-26 13:39:11 -07:00
Evgeniy Paltsev
48fd41a599 doc: coverage: fix coverage report generation instruction
Fix build step to enable CONFIG_COVERAGE_DUMP, otherwise
we won't get coverage data dump required for next step.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2022-05-26 13:14:27 -07:00
Dominik Ermel
19259ab7db mgmt/mcumgr/lib: Fix image list command crashing when no device
It is possible, in case of two application images, to have no access
to one of devices of the secondary image.
When asserts are enabled, such situation causes crash even though the
image list command can handle it with no problem.
The commit removes the assert and adds additional swap type:
IMG_MGMT_SWAP_TYPE_UNKNOWN to indicate situations where it was
not possible to obtain swap type from boot_util.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-05-26 13:08:35 -07:00
Kevin Townsend
54b2fc0774 doc: release-notes: Added note on TF-M 1.6.0
Add a note on the update to TF-M 1.6.0 and MbedTLS 3.1.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-05-26 13:06:43 -07:00
Stephanos Ioannidis
6448546553 timing: Fix symbol extern for C++
This commit adds `extern "C"` to `timing.h` so that C function names do
not get mangled when including this header file from a C++ source file.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-26 13:02:53 -07:00
Gerson Fernando Budke
f4e0cc76b9 doc: release: 3.1: Add notes about Atmel
Add 3.1.0 release notes for Atmel.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-05-26 13:02:40 -07:00
Gerson Fernando Budke
5b606cde65 doc: release: 3.1: Add notes about Gigadevice
Add 3.1.0 release notes for Gigadevice.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-05-26 13:02:40 -07:00
Andrei-Edward Popa
ca6aa62309 doc: releases: added reset controller in release notes 3.1
added reset controller in release notes 3.1

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
2022-05-26 13:02:19 -07:00
Andrei-Edward Popa
d82c10f197 include: drivers: changed API function names for reset controller
assert API function needed to be changed because of newlib assert
macro name conflict

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
2022-05-26 13:02:19 -07:00
Stephanos Ioannidis
4b111c1ee8 Revert "modules: zcbor: kconfig: Disallow ZCBOR_VERBOSE with MINIMAL_LIBC"
This reverts commit 619fce9e0f now that
the missing PRIuFAST32 and PRIxFAST32 macros are defined by the minimal
libc.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-26 17:38:50 +02:00
Stephanos Ioannidis
d755050a14 libc: minimal: Add PRIxMAX macros for [u]intmax_t
This commit adds the missing `PRIxMAX` macros for the C99 `intmax_t`
and `uintmax_t` types:

  PRIdMAX, PRIiMAX, PRIoMAX, PRIuMAX, PRIxMAX, PRIXMAX

Note that the `PRIxMAX` macros specify the `ll` size modifier because
the type of the `intmax_t` for the minimal libc is defined as that of
the `int64_t`, which is always overridden to `long long int` by
`zephyr_stdint.h`; for more details, refer to the GitHub PR #29876,
which deliberately introduced this scheme.

In the future, this scheme will need to be reworked such that the
minimal libc `stdint.h` defines `intmax_t` as `__INTMAX_TYPE__`, and
the `inttypes.h` resolves the corresponding format specifier.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-26 17:38:50 +02:00
Stephanos Ioannidis
c3f80aa844 libc: minimal: Add PRIx{FAST,LEAST}N macros
This commit adds the missing `PRIx{FAST,LEAST}N` C99 integer type
format macros that correspond to the C99 integer types overridden in
the `zephyr_stdint.h` header:

  PRIdFAST8, PRIdFAST16, PRIdFAST32, PRIdFAST64
  PRIdLEAST8, PRIdLEAST16, PRIdLEAST32, PRIdLEAST64

  PRIiFAST8, PRIiFAST16, PRIiFAST32, PRIiFAST64
  PRIiLEAST8, PRIiLEAST16, PRIiLEAST32, PRIiLEAST64

  PRIoFAST8, PRIoFAST16, PRIoFAST32, PRIoFAST64
  PRIoLEAST8, PRIoLEAST16, PRIoLEAST32, PRIoLEAST64

  PRIuFAST8, PRIuFAST16, PRIuFAST32, PRIuFAST64
  PRIuLEAST8, PRIuLEAST16, PRIuLEAST32, PRIuLEAST64

  PRIxFAST8, PRIxFAST16, PRIxFAST32, PRIxFAST64
  PRIxLEAST8, PRIxLEAST16, PRIxLEAST32, PRIxLEAST64

  PRIXFAST8, PRIXFAST16, PRIXFAST32, PRIXFAST64
  PRIXLEAST8, PRIXLEAST16, PRIXLEAST32, PRIXLEAST64

Note that these macros will eventually need to be defined according to
the toolchain-specified types when the `zephyr_stdint.h` hack is
removed in the future; refer to the the GitHub issue #46032 for more
details.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-26 17:38:50 +02:00
Stephanos Ioannidis
51b30a5694 toolchain: Override __[U]INT{FAST,LEAST}N__ macros
This commit overrides the following toolchain type macros to match the
respective base types overridden by the `zephyr_stdint.h`:

* __INT_FAST32_TYPE__
* __INT_FAST64_TYPE__
* __UINT_FAST32_TYPE__
* __UINT_FAST64_TYPE__

* __INT_LEAST32_TYPE__
* __INT_LEAST64_TYPE__
* __UINT_LEAST32_TYPE__
* __UINT_LEAST64_TYPE__

This is in preparation for adding the `PRIx{FAST,LEAST}N` macros in the
Zephyr minimal libc `inttypes.h`, which assumes the types defined by
the `zephyr_stdint.h`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-26 17:38:50 +02:00
Carles Cufi
56512dae8b arch: riscv: switch: Add a comment on the return of z_riscv_switch
When returning from z_riscv_switch, depending on whether the thread that
has just been swapped in was earlier swapped out synchronously (i.e. via
regular function call) or asynchronously (i.e. via exception/irq) we
will return to arch_switch() or __irq_wrapper respectively. Comment this
fact for clarity.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-05-26 17:15:21 +02:00
Carles Cufi
11da0b6f28 arch: riscv: Remove outdated comment
After the introduction of arch_switch() in #43085, ECALL is no longer
used for context switching by default, so remove the comment stating so.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-05-26 17:15:21 +02:00
Piotr Pryga
131c089aaf Bluetooth: Controller: llcp: Fix wrong eff time calc if PHY changed
If there is a PHY change on a connection it may happen that effective
RX and TX time changes also. That change is applied after an instant.

Implemented handling of effective time calculation is based on the
maximum PDU length, new PHY and local (default) maximum TX or RX time.

The maximum TX value is set to default one that corresponds to PHY 1M
during the Controller initialization. It can be updated by host to other
value. By default Zephyr Host updates it to max possible TX time for all
supported PHYs. If PHY CODED is enabled, it is the longest possible TX
duration 17040 us.

The maximum RX value is set to default during connection creation.
In case of use of legacy advertising, the value is also related with
PHY 1M. It can be updated by data length extension procedure.

If the maximum RX value is set to some value and there is a change
of a PHY to one that requires more time to send a PDU with the same
length, then the maximum RX value is wrongly calculated.

Function pu_calc_eff_time returns a value that is the default_time
argument. The problem is that the default_time should be adjusted
to new maximum RX time required for a new PHY.

To solve that there should be an evaluation of a new maximum RX and
TX time based on new PHY.

The commit adds missing evaluation.

The problem occurred in DF tests that check collision mitigation
between PHY update control procedure and CTE request control procedure.

There was missing CONFIG_BT_CTLR_PHY_CODED option in CTE request
unit tests. The code was working because the ULL implementation of
PHY change control procedure does not verify if PHY CODED is supported.

When missing support was enabled, tests showed wrong evaluation of
maximum RX time. It also unveiled error in CTE request unit tests
implementation. The default_tx_time was set to wrong value 2120 us
as if PHY CODED was not supported. To fix it, the value was changed
to PDU_DC_PAYLOAD_TIME_MAX_CODED.

There was also added a mock for a feature exchange procedure done
during unit tests setup step. That allows to correctly calculate
maximum TX time by ull_dle_max_time_get function.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-26 16:29:10 +02:00
Vinayak Kariappa Chettimada
e79c48f7c6 Bluetooth: Controller: Fix missing DUP_FILTER_ADV_SET_MAX dependency
Fix missing BT_CTLR_DUP_FILTER_ADV_SET_MAX dependency on
BT_CTLR_ADV_EXT.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-26 12:26:43 +02:00
Vinayak Kariappa Chettimada
59eef60665 Bluetooth: Controller: Fix filter accept list and privacy default
Fix filter accept list and privacy feature Kconfig default
based on whether host has them enabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-26 12:26:43 +02:00
Vinayak Kariappa Chettimada
1791a154dc Bluetooth: Controller: nRF5: Fix missing BT_CTLR_PRIVACY cond compile
Fix missing BT_CTLR_PRIVACY conditional compilations that
included redundant HAL code when Controller privacy is
disabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-26 12:26:43 +02:00
Vinayak Kariappa Chettimada
5f670fa9c3 Bluetooth: Controller: openisa/RV32M1: Fix BT_CTLR_PRIVACY cond compile
Fix missing BT_CTLR_PRIVACY conditional compilations that
causes compile errors when Controller Privacy is disabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-26 12:26:43 +02:00
Nicolas Pitre
6ac751e7ef ring_buffer: fix designated initializer order in RING_BUF_ITEM_DECLARE
Commit a36995e2a3 ("ring_buffer: fix designated initializer order
in RING_BUF_DECLARE") missed the RING_BUF_ITEM_DECLARE case.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-05-26 12:26:06 +02:00
Vinayak Kariappa Chettimada
620a5524a5 Bluetooth: Controller: Fix PHY update for unsupported PHY
Fix PHY update procedure to handle unsupported PHY requested
by peer central device. PHY update complete will not be
generated to Host, connection is maintained on the old
PHY and the Controller will not respond to PDUs received on
the unsupported PHY.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-26 12:24:54 +02:00
Hake Huang
75845f5f4e test: twister: fix false negative in device test
in device test when harness is Test, if there is no console output,
the self.state is None, as at this time self.instance.state
is "pass", as the last step cmake is "pass". So it will report "pass",
but actually there is no console output issue

you can easily reproduce this issue by set
line='' at the begining of the Test.handle function

fixing: #45942

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-05-26 11:39:14 +02:00
Fabio Baltieri
449516c135 doc: add pwm_interface tag to dt-bindings/pwm/pwm.h
Add Doxygen tags to dt-bindings/pwm/pwm.h so that the binding macros
show up on the documentation page.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-25 17:16:55 -07:00
Fabio Baltieri
838dbaae7f doc: fix building documentation when PYTHONPATH is set
Re-add the SEP setting in the documentation CMakeLists. This was dropped
in:

fc942ef7d3 doc: use new kconfig extension

And currently prevents building the documentation locally if a
PYTHONPATH is set.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-25 17:16:55 -07:00
Dominik Ermel
1bd5665b89 mgmt/mcumgr/lib: Fix usage of MGMT_ERR_ENOMEM
The commit replaces MGMT_ERR_ENOMEM with MGMT_ERR_EMSGSIZE where it
was used to indicate that SMP response does not fit in response
buffer.

Fixes #44535

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-05-25 13:56:03 -07:00
Dominik Ermel
1d6b275c2a samples/mgmt/mcumgr: Fix CDC ACM sample build information
The commit adds missing info on required usb.overlay.

Fixes: #45834

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-05-25 13:51:32 -07:00
Gerson Fernando Budke
5b7734c926 drivers: adc: sam0: Fix adc_reference implementation
The current sam0 adc driver not implement correctly the adc_reference
enum values. This try homonize adc input referece by tracking VDDANA
at ADC_REF_VDD_1. The ADC_REF_VDD_1_2 were fixed with correct INTVCCx
channel selection.

Fixes #45443

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-05-25 13:36:10 -07:00
Flavio Ceolin
9d5bd09980 doc: releases: 3.1: Add security related release notes
Add information about vulnerabilities fixed for Zephyr v3.1.0

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-05-25 13:34:52 -07:00
Flavio Ceolin
5b8cc4f6f3 vulnerabilities: Add vulnerabilities under embargo
Add entries for vulnerabilities under embargo.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-05-25 13:34:52 -07:00
Trent Piepho
094345629b drivers/sensor: lsm6dso: Add support for lsm6dso32
This sensor is virtually identical to the lsm6dso.  The only difference
is the accelerometer ranges are double those of the lsm6dso.

Use the same driver.  The difference is detected by using "st,lsm6dso32"
as the first compatible entry, followed by "st,lsm6dso".

An bit flag in the existing accel_range config field is used to check if
the chip is the doubled range or not.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2022-05-25 13:16:04 -07:00
Trent Piepho
5edd4221ad drivers/sensor: lsm6dso: Refactor common config out of I2C/SPI macros
Move common settings out of the SPI and I2C instantiation macros and
into a common macro, which the aforementioned two macros can then use.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2022-05-25 13:16:04 -07:00
Trent Piepho
c269692b1d drivers/sensor: lsm6dso: Remove LE to CPU conversions
In ST HAL v2.00, the functions to get the raw sensors values, e.g.
lsm6dso_acceleration_raw_get(), convert from little-endian to CPU.

Previous versions of ST HAL didn't do this.

The conversion here in the driver is converting a second time.  It's not
an issue on a LE system, the conversion is a no-op, but on a BE system
it would be broken.

Signed-off-by: Trent Piepho <trent.piepho@igorinstitute.com>
2022-05-25 13:16:04 -07:00
Janco Kock
d611284271 drivers: ethernet: w5500: Check W5500 int pin after processing interrupt
Check if W5500 int pin is still active after processing the interrupt.
If not doing correctly, the W5500 driver can deadlock because it is not
receiving any more interrupts.

Signed-off-by: Janco Kock <jancokock@gmail.com>
2022-05-25 21:46:17 +02:00
Francois Ramu
9488727292 tests: drivers: uart stm32 run uart_async api on f746 nucleo
This sets the dts of dma for using the uart 6 asynch api.
The stm32f746 has a dma V1 with request 5 for Tx/Rx usart6
The Tx&Rx pins (PG14, PG9) of the usart6 are connected
on the nucleo_f746zg board to pass the test
The CONFIG_DCACHE=n must also be set to disable Dcache.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-25 11:38:05 -07:00
Francois Ramu
169bf0f612 tests: drivers: uart stm32 run uart_async api on f767 nucleo
This sets the dts of dma for using the uart 6 asynch api.
The stm32f767 has a dma V1 with request 5 for Tx/Rx usart6
The Tx&Rx pins (PG14, PG9) of the usart6 are connected
on the nucleo_f767zi board to pass the test
The CONFIG_DCACHE=n must also be set to disable Dcache.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-25 11:38:05 -07:00
Francois Ramu
39c8ba32ff soc: arm: stm32f7 soc without Dcache
The stm32f7 (like stm32H7) should be able to disable
the Dcache when using the DMA. This is to avoid any
pb of cache coherency on the DMA buffers.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-25 11:38:05 -07:00
Erwan Gouriou
97d989910e doc: release-notes 3.1: Update with stm32f1 pin node names changes
This information is worthy to provide in release notes

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-25 11:20:21 -07:00
Erwan Gouriou
352969bfa3 boards: stm32f1: Use new pin nodes names which include remap information
Pin nodes names for stm32f1 devices now hold the remap information.
Convert existing users.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-25 11:20:21 -07:00
Erwan Gouriou
ce0b918b50 west.yml: hal_stm32: Use remap info in stm32f1 pinctrl nodes names
Fixes #45916

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-25 11:20:21 -07:00