Commit graph

54420 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
194a9674b8 tests: Bluetooth: bsim: Verify AD Data backup
Verify that AD Data when switching to Legacy Directed, and
restore it when switching back to Legacy Non-Directed
Advertising mode.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-26 15:29:55 +02:00
Vinayak Kariappa Chettimada
d19476c3c2 Bluetooth: Controller: Fix corrupt AD data after directed advertising
Fix corrupt AD data used after directed advertising by
storing a backup of the AD data before switching to directed
advertising. Restore back the AD data with switching to non-
directed advertising.

The fix also addresses AD data backup when switching between
Legacy and Extended Advertising.

Fixes #18850.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-26 15:29:55 +02:00
Vinayak Kariappa Chettimada
4e6357e549 Bluetooth: Controller: Resolve AdvA in AUX_CONNECT_RSP PDU
Add implementation to resolve AdvA in the received
AUX_CONNECT_RSP PDU before generating the connection
complete.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-26 15:29:41 +02:00
Affrin Pinhero
295808a052 board/arm stm32: SDMMC support for stm32l496g_disco
This commit adds support for SDMMC driver, Which
was missing. THi commit will solveserror SDMMC init
error on stm32l496g_disco boards.

Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
2021-07-26 15:29:34 +02:00
Affrin Pinhero
166a13b1bf board/arm STM32: SDMMC support for stm32f746g_disco
This commit adds support for SDMMC driver,
Which was missing. THi commit will solves
error SDMMC init error on STm32F746G_DISCO
boards.

Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
2021-07-26 15:29:34 +02:00
Piotr Mienkowski
e7c630861a samples: counter/alarm: add support for Atmel SAM boards
Add support for sam_e70_xplained, sam_v71_xult based on TC0 counter.

Note: TC module is a 16-bit counter. Even with slow, 32768 Hz input
clock the time span counted by the driver is short.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-07-26 05:13:40 -04:00
Piotr Mienkowski
1145986096 drivers: Add Atmel SAM counter (TC) Driver
Add basic counter driver based on Timer Counter (TC) module for Atmel
SAM family.

Remarks:
- The driver is not thread safe.
- The driver does not implement guard periods.
- The driver does not guarantee that short relative alarm will trigger
  the interrupt immediately and not after the full cycle / counter
  overflow.

Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-07-26 05:13:40 -04:00
Piotr Mienkowski
1d199ca5ac drivers: qdec_sam: align naming of TcChannel in TC
Change naming of TC_CHANNEL to TcChannel in Tc struct to align with
a new convention used by samv71, samv71b series.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-07-26 05:13:40 -04:00
Piotr Mienkowski
ca9938b32f manifest: update hal_atmel
Update to include the commits:
- patch: same70, samv71: Add TC waveform/capture mode registers
- patch: same70, same70b: Align naming of TcChannel in TC

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-07-26 05:13:40 -04:00
Thomas Stranger
95b7385bf1 drivers: entropy: stm32: don't use zero value
According to the Reference Manual of several series(G0,L5,WL,WB,...)
RNG_DR register value should only be used if it is different from 0:
"Because when it is the case a seed error occurred between RNG_SR
polling and RND_DR output reading (rare event)."

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-26 04:36:56 -04:00
Thomas Stranger
95c3916c60 drivers/entropy: stm32 add seed error recovery
This commit introduces an automatic recovery procedure in cases an
entropy source error was detected.
- On Series with soft reset support a soft rest is executed.
- On Series w/o soft reset support the pipeline is cleared by reading
  the RNG_DR 12 times.

With this changes the check for seed errors uses SEIS flag instead
of the SECS flag.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-26 04:36:56 -04:00
Flavio Ceolin
d45a0e1919 pm: Fix weak linkage symbols
Define SoC hooks as weak symbols so this way applications can
overwritten them defining strong symbols.

The problem is that currently SoCs are defining these interfaces as
strong symbol inhibiting the possibility of applications bring their
own implementation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-26 04:31:54 -04:00
Flavio Ceolin
96d5a58a46 tests: profiling: Remove unnecessary stubs
It is not necessary to implement stubs for system pm functions.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-26 04:31:54 -04:00
Flavio Ceolin
dd54a8daed pm: Avoid weak function clash
SoC hooks are defined as weak functions for the case where they are
not implemented by a SoC. The problem that may happen is when an
application define it as weak as well. In this case, no compilation
error is issued but the version that will be used depends on the build
order. Just remove the weak placeholder implementation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-26 04:31:54 -04:00
Emil Gydesen
7d07a941fa Bluetooth: samples: Add ISO broadcast benchmark sample
Adds a sample that measures packet loss and BIG sync
statistics.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-25 08:56:00 -04:00
Leonard Pollak
9bea9d2ef2 doc: boards: arm: Seeeduino XIAO added i2c to docs
This adds documentation for the i2c interface on the
Seeeduino XIAO.

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2021-07-25 06:24:21 -04:00
Leonard Pollak
732990a180 boards: arm: Seeeduino XIAO enable i2c
This board has the capability to use SERCOM2 as an i2c
interface on pins 8 and 9.
This adds the neccessary pinmux settings and devicetree
node.

Tested with the i2c shell module.

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2021-07-25 06:24:21 -04:00
Ruibin Chang
21f0f958fe ITE drivers/ite_it8xxx2_timer: re-write ite timer driver
Re-write ite timer driver.

Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw>
2021-07-24 21:26:49 -04:00
Ruibin Chang
78ef5ace6a ITE drivers/intc_ite_it8xxx2: correct logic operation
Interrupt polarity register don't support rising and
falling edge triggered at the same time, so I correct
logic operation to match this.

Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw>
2021-07-24 21:26:49 -04:00
Ruibin Chang
aba4e68e91 ITE boards/it8xxx2_evb/defconfig: use default clock setting
Use default system clock setting 32768 in
soc/riscv/risc-ite/it8xxx2/Kconfig.

Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw>
2021-07-24 21:26:49 -04:00
Ruibin Chang
97d2d7317c ITE soc/riscv/ite/it8xxx2/Kconfig: correct hw clock freq
Correct SYS_CLOCK_HW_CYCLES_PER_SEC and
SYS_CLOCK_TICKS_PER_SEC to match our real setting value
for precise timing.

Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw>
2021-07-24 21:26:49 -04:00
Aurelien Jarno
0cd3daacba usb: truncate the most significant part of the serial number
When the Hardware Information Driver (HWINFO) provides a device ID
longer than the configured USB serial number, truncate the most
significant part instead of the least significant part. The lower part
is usually having more entropy, e.g. on STM32.

Fixes #34550

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-07-24 21:26:06 -04:00
Yuval Peress
eadca02251 espi: npcx: Add missing includes to header
Add the missing includes to make the header more portable. It currently
requires other headers to be included before it.

Signed-off-by: Yuval Peress <peress@chromium.org>
2021-07-23 16:26:44 -04:00
Erwan Gouriou
732adf3789 west.yml: hal_stm32: Update STM32 HCI lib to v1.9.0
Update STM32WB HCI lib based on STM32Cube package V1.9.0

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-07-23 16:26:17 -04:00
Emil Obalski
36cf484640 mcumgr: smp: Fix NULL pointer reference
SMP implementation across bt/udp does not check
if allocation of the buffer was successful.
If the buffer is not granted an error shall be
returned.

This patch fixes BUS FAULT issue when NULL
pointer is referenced.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2021-07-23 16:25:47 -04:00
Thomas Stranger
a498ede0d7 doc: stm32wl and stm32l5 boards: update supported features
This commit updates the supported features of stm32l5 and stm32wl boards
to match the devicetree configuration.
- add link to board defconfig and board.dts
- sort supported features table alphabethically by interface.

Additionally CRYP peripheral is added as supported feature to the
mikroe_mini_m4_for_stm32 board documentation.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
bedfb00d02 samples: crypto: change config to run test sample.drivers.crypto.stm32
The test sample.drivers.crypto.stm32 was built only for the stm32 crypto
driver (build_only: true).
This commit changes the configuration to run the test and adds regex for
the supported modes.
Additionally integration_platform native_posix is removed from the
crypto.stm32 test configuration, such that stm32 targets built in CI.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
091df2b598 samples: drivers.crypto.stm32 test: use filter instead of allow list
This commit uses filter instead of allow list for the
sample.drivers.crypto.stm32 test case.
As a result the ci test is not only built on mikroe_mini_m4_for_stm32,
but also on lora_e5_dev_board, nucleo_wl55jc and stm32l562e_dk.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
035fefcd64 samples: drivers: crypto: add support for stm32 with aes peripheral
This commit adds support for stm32 socs with aes peripheral in the
crypto sample.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
809b7c76d3 boards: nucleo_wl55jc and lora_e5_dev_board enable aes
This commit enables aes support for nucleo_wl55jc and
lora_e5_dev_board.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
5f7c696e97 dts: stm32wl: add definitions for the aes peripheral
This commit adds a dt node for the hw aes accelerator of the wl series.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
768b75ab71 dts: stm32g0: add definitions for the aes peripheral
This commit adds dt definitions for the hw aes accelerator
on stm32g0 Series.
The accelertor is available on the following socs:
stm32g041, stm32g061, stm32g081, and stm32g0c1.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
010d020aef boards: stm32l562e_dk enable aes peripheral
This commit enables the hw aes accelerator on the stm32l562_dk.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
18d99fb523 dts: stm32l5: introduce aes peripheral
This commit adds a dt node for the hw aes accelerator of the
stm32l5 series.

The stm32l562Xe.dtsi file now includes the newly created
stm32l562Xe.dtsi with the additional aes definitions instead of the
stm32l552Xe.dtsi file.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
bb9fd7377b drivers/crypto: stm32: add support for socs with AES IP
This commit adds crypto support for several series which have
the same/very similar or same AES IP.
This includes G0, G4, L5, WL.
WB is also very similar but, expects the app to load the key via CKS.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
04f208e48e dts: bindings: add ST STM32 AES accelerator
This commit adds bindings for the STM32 AES accelerator.
Common properties of st,stm32-cryp are moved into
st,stm32-crypto-common.yaml.

The accelerator supports ECB, CBC, CTR, GCM, GMAC, and CCM
chaining modes.
128 bit bit data blocks with cipher key lengths of 128 and 256 bit are
supported.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Dong Wang
a6800cefb1 x86/cache: fix issues in arch dcache flush function
Correct the wrong operand of clflush instruction. The old operand
points to a location inside stack and doesn't work. The new one
works well by taking linux kernel code as reference.

End address instead of size should get round up

Add Kconfig option to disable the usage of mfence intruction for
SoC that has clfulsh but no mfence supported.

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2021-07-23 16:22:07 -04:00
Emil Gydesen
3a6952e3e6 Bluetooth: iso: Compile conn.c for BT_ISO even without BT_CONN
If BT_ISO is enabled we now compile conn.c which contains a
lot of functionality used by BT_ISO, even for broadcast-iso
builds, i.e. builds that do not require BT_CONN.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
a02abea0a2 Bluetooth: conn: Move ACL only data fields to ACL group
Move the data that is only relevant for ACL to
a guarded ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
72319abc7e Bluetooth: conn: Add BT_CONN guards in bt_conn_set_state
Add BT_CONN guards for ACL only functionality in
bt_conn_set_state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
32da3287ac Bluetooth: conn: Add BT_CONN guard to bt_conn_get_pkts
Add a guard for BT_CONN and return NULL if no
packets can be returned.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
90a9ea92e2 Bluetooth: hci_core: Remove BT_CONN guard for ISO fields in bt_dev_le
Change the guard such that the iso_mtu and iso_pkts are
not guarded by BT_CONN as they should be available for
iso broadcast-only builds.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
4ac8a9e6c0 Bluetooth: conn: Add guard for ACL in conn_mtu
Add guard for accessing the bt_dev.le.acl_mtu if
CONFIG_BT_CONN is not enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
5612f60185 Bluetooth: conn: Add bt_acl_recv for ACL only data
Add the bt_acl_recv function that works similar to
bt_iso_recv but for ACL data only, simplying the
generic bt_conn_recv function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
c877045133 Bluetooth: conn: Guard acl_send with CONFIG_BT_CONN
Guard the ACL send to only be called if CONFIG_BT_CONN
is enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
c56fd68a13 Bluetooth: conn: Move bt_conn_connected to ACL group
Move the bt_conn_connected function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
6952dcd7a8 Bluetooth: conn: Move acl_conns to ACL group
Move the acl_conns array to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
2249091176 Bluetooth: conn: Move bt_conn_disconnect to ACL group
Move the bt_conn_disconnect and conn_disconnect functions
to the ACL group.

Also adds a guard in the iso.c file for connected ISO.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
d203422082 Bluetooth: conn: Fix type of recieved to received
Fixed a typo that caused a CI issue.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
cbec9ffbc0 Bluetooth: conn: Move ACL callback handlers to ACL group
Move the notify_le_phy_updated, notify_le_data_len_updated,
notify_le_param_updated, notify_remote_info,
notify_disconnected and notify_connected functions
to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00