Commit graph

67677 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada f6a3da9c21 Bluetooth: Controller: Review rework of jitter in aux offset
Review rework of the fix to remove the jitter in aux offset
and sync offset values.

Force select BT_TICKER_REMAINDER_GET and BT_TICKER_LAZY_GET
features when Extended Advertising and Periodic Advertising
is supported.

Rename ticks and microsecond offset value struct members
for primary PDU event offset (to auxiliary PDU event).

Converted HAL_TICKER_REMOVE_JITTER and HAL_TICKER_ADD_JITTER
macro to functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-02 12:54:31 +02:00
Vinayak Kariappa Chettimada b6cf8bb580 Bluetooth: Controller: Use remainder in Ext and Periodic PDU offset
Use remainder value in scheduling the periodic auxiliary
PDUs and use the ticker next slot get interface with
remainder value to fill the auxiliary offsets with
microsecond precision in the primary channel PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-02 12:54:31 +02:00
Vinayak Kariappa Chettimada aa73661b09 Bluetooth: Controller: Use macro to adjust ticks based on remainder
Use macro to adjust ticks for jitter stored in remainder
value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-02 12:54:31 +02:00
Vinayak Kariappa Chettimada be7173a490 Bluetooth: Controller: Ticker next slot get to return remainder value
Updated ticker implementation to return remainder value for
a ticker when enumerating active tickers with time
reservations.

This is required to find offsets and to use the remainder
value to correctly calculate auxiliary offsets to the
microsecond resolution.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-02 12:54:31 +02:00
Vinayak Kariappa Chettimada c14bde45b6 Bluetooth: Controller: Fix overlapping 1M and Coded PHY scannning
Fix overlapping 1M and Coded PHY scanning that caused idle
radio time when both PHY use same scan interval and sum of
their scan window duration equals the interval.
Implementation now will use continuous scanning and offset
the start of Coded PHY by the window duration of the 1M
scanning.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-02 12:54:23 +02:00
Andries Kruithof 6d7a04a0ba Bluetooth: controller: llcp: initialise DLE parameters
The initialisation of DLE parameters for the peripheral
was done before the intialisation of the PHY settings.
Since the DLE parameters depend on PHY settings this
can result in incorrect parameters for tx/rx time and
octets
One scenario is where a previous connection set the PHY to
2M or CODED, then when a new connection is established
it uses the same memory-locations for connection settings as the
previous connection, and the (uninitialised) PHY settings will be
set to 2M or CODED, and thus the DLE parameters will be wrong
This PR moves the initialisation of DLE parameters after
that of PHY settings

EBQ tests effected include LL/CON/PER/BV-77-C.

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2022-08-02 12:53:46 +02:00
TOKITA Hiroshi d5ab3ee0b0 tests: dma: loop_transfer: Add GD32 series to loop_transfer test
Add configuration file for GD32 boards.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-08-02 09:13:21 +02:00
TOKITA Hiroshi 49ef9f9e20 dts: arm: gigadevice: Add DMA configuration
Add DMA support for GD32 series.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-08-02 09:13:21 +02:00
TOKITA Hiroshi 3a1d188a9e drivers: dma: Add GD32 DMA driver
Add support for GD32 DMA

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-08-02 09:13:21 +02:00
Kamil Gawor e6da6e9133 drivers: bluetooth: hci: Add BT_HAS_HCI_VS selection for RPMSG.
Add explicit selection of the BT_HAS_HCI_VS for
the BT_RPMSG HCI driver. When the HCI over RPMSG
is used this dependency will not be solved automatically.
It is required to handle correctly Bluetooth identity
initialization.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2022-08-02 09:13:12 +02:00
Georgios Vasilakis a5b31f4d85 manifest: psa-arch-tests to commit: f4fc244
New watchdog timer configuration for Nordic
devices.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
2022-08-02 09:12:45 +02:00
Gerard Marull-Paretas 741bfedeab soc: riscv: mpfs: remove unused definition
RISCV_MTIMECMP_BY_HART (machine timer related) is not used, so remove
it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 418ad7d443 soc: riscv: remove unused RISCV_MTIME(CMP)_BASE and IRQ definitions
The RISC-V machine timer base addresses and IRQ are now obtained from
Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 3a19948510 drivers: intc: litex: remove machine timer IRQ usage
This platform does not use RISC-V machine timer, however, the interrupt
controller had references to its IRQ. Remove them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 1c41423210 drivers: timer: riscv_machine_timer: obtain registers/IRQ from DT
Obtain machine timer addresses and IRQ from Devicetree. Note that driver
supports multiple compatibles because mtime/mtimecmp registers are
implemented in different ways depending on the vendor. That means
Devicetree representations can be slightly different and so code to
collect the information needs to treat each compatible differently.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 00f51eff4e dts: riscv: andes: define machine timer
Define machine timer in Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 6d16c6ba0b dts: riscv: mpfs-icicle: define CLINT
Define Core Local Interrupt in Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas e5e8822658 dts: riscv: neorv32: define machine timer
Define machine timer in Devicetree.

Ref. https://stnolting.github.io/neorv32/#_machine_system_timer_mtime

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas c17ee81af4 dts: riscv: microsemi-miv: define CLINT
The SoC seems to embed a CLINT instance, defined at 0x44000000.

Ref. https://github.com/Mi-V-Soft-RISC-V/platform/blob/main/
miv_rv32_hal/miv_rv32_hal.h

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 0da2ebc7e2 dts: riscv: telink: add DT entry for machine timer
Define machine timer in Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas dd3d201c94 dts: bindings: remove unused riscv,clint0
All platforms have been migrated to sifive,clint0 (or derivates).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 24853c4303 dts: riscv: virt: use sifive,clint0
Use the sifive,clint0 compatible instead of "riscv,clint0" and remove
interrupt controller fields (clint compatible is used for its timer
registers). Refer to the Linux or previous commits for more context.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 37c485f208 dts: riscv: sifive: use sifive,clint0
Use the sifive,clint0 compatible instead of "riscv,clint0" and remove
interrupt controller fields (clint compatible is used for its timer
registers). Refer to the Linux or previous commits for more context.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas af2f5753d8 dts: riscv: starfive: align clint description with Linux
The CLINT (Core Local Interruptor) description was not aligned with
Linux. For example, there's no "riscv,clint0", but "sifive,clint0". The
peripheral is not described as an interrupt-controller either.

Ref. https://elixir.bootlin.com/linux/v5.18.14/source/arch/riscv/boot/
dts/starfive/jh7100.dtsi#L106

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Gerard Marull-Paretas 6de9fcf315 soc: riscv: gd32vf103: use nuclei,systimer compatible
After some analysis I found out that there's no machine timer provided
by the "riscv" vendor. There are some specs for the mtime/mtimecmp
registers (this is why we can have a single driver), but the actual
register layout or implementations differ amongst vendors. GD32 uses the
Nuclei implementation, named "system timer" in their documentation. This
patch aligns with vendor specs.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00
Kumar Gala f80b2519fc boards: shields: Remove label property from devicetrees
Label properties are not required.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-02 09:12:21 +02:00
Tom Burdick da041942c2 boards: Add TDK RoboKit1 for testing Sensors
Has a lot of great sensors on it including a very fast 6 axis IMU,
atmospheric, and time of flight sensors.

This is a fantastic board to test sensors and algorithms on.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-08-01 15:45:23 -05:00
Fabio Baltieri 21900c4c33 drivers: sensor: max17055: fix TTE and TTF time units
The unit for SENSOR_CHAN_GAUGE_TIME_TO_EMPTY and
SENSOR_CHAN_GAUGE_TIME_TO_FULL are defined in
zephyr/drivers/sensor.h as being in minutes.

Change the max17055 implementation to match the API spec, fix the
annotation for time register units.

Link: https://datasheets.maximintegrated.com/en/ds/MAX17055.pdf
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-01 14:49:59 -05:00
Jonathan Rico b0231e040d Bluetooth: host: invalidate tx context after destroying it
Now that we properly destroy the tx context in `bt_conn_process_tx`, we
need to make sure the context is really valid.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-08-01 18:13:35 +01:00
Jonathan Rico 00709e5fbb Bluetooth: host: add missing meta data destroy callback
Symptoms were that a disconnect happening when a buffer was enqueued but
not sent resulted in a meta-data memory leak.

This is problematic because it seemed (as per the OP) that it resulted in
the whole host getting locked up when a device sending long L2CAP packets
was prone to disconnect-reconnect cycles (e.g. in a bad RF environment).

Fixes #47649

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-08-01 18:13:35 +01:00
Seppo Takalo c3302d5f41 net: lwm2m: Allow observing of object instances and objects
Code was limiting observations to resources and
resource instances without any reason.
Also if resource is written, and the whole object is observer
it should trigger. Path does not have to be matching on the
same level, if parent is observed.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-08-01 18:12:33 +01:00
Aleksander Wasaznik 5a09325ba9 Bluetooth: Simplify predicate for host-based RPA resolution
The expression for the condition for using host-based RPA resolution now
simplifies to "Use host-based when we need to resolve more identities
than the controller can handle.".

Proof:
X=((bt_dev.le.rl_entries > 0) && (!bt_dev.le.rl_size ||
        bt_dev.le.rl_entries > bt_dev.le.rl_size))
X=(a > 0) && (!b || a > b)
a>=0, b>=0, because they are cardinal / size_t.
If a=0:
	// X evaluates to false. (0 > b)=(a > b) also always evaluates to false.
	X=false=(0 > b)=(a > b)
If a>0:
        X=(!b || a > b)
        If b=0: X=true=(a > 0)=(a > b)
        If b>0: X=(false || (a > b))=(a > b)
The expression is equivalent with (a > b) for all values of (a,b).
QED.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-08-01 18:11:57 +01:00
Emil Gydesen 404d0c7a6e samples: Bluetooth: Unicast audio server set location
The unicast audio server sample did not set a location value,
and would report an invalid value of 0 when read.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-08-01 18:11:26 +01:00
Mariusz Skamra acb9da2ba0 Bluetooth: samples: Add HAP Hearing Aid sample application
This adds sample application that can be used as reference
implementation and for HAP qualification purposes.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-01 18:10:34 +01:00
Hake Huang cedc99b8ed samples: application_development: remove the code_relocation sample
covert this sample to a test cases

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-08-01 18:09:28 +01:00
Hake Huang 45daf3b448 tests: application_development: add code_relocation test
add code relocation test case
1. customer relocation code and data test
2. memcpy relocation

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-08-01 18:09:28 +01:00
Hake Huang 2acbf01ff7 arch: arm: call z_early_memset instead memset directly
change to call z_early_memset instead of memset so that we can
relocate memset

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-08-01 18:09:28 +01:00
Michal Narajowski fab8e29ee2 Bluetooth: Mesh: Add model publish support to Health Client
Mesh Profile Specification errata 11310
Section 4.4.4.1
"This model shall support model publication, as defined in Section
4.2.2 of the Mesh Profile specification and model subscription,
as defined in section 4.2.3 of the Mesh Profile specification."

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2022-08-01 18:04:42 +01:00
Michal Narajowski e98df9f160 tests: bluetooth: tester: Fix Health Fault Test command
The buffer for response was too small.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2022-08-01 18:04:42 +01:00
Nikolai Kondrashov 6cee447a15 doc: Fix a couple typos
Fix a couple small typos in docs.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
2022-08-01 18:04:02 +01:00
Nikolai Kondrashov 26eb116835 Bluetooth: GATT: Spell out BT_ATT_ERR_*
Spell out BT_ATT_ERR_* instead of using less specific "ATT error code".

Co-authored-by: Emil Gydesen <Thalley@users.noreply.github.com>
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
2022-08-01 18:04:02 +01:00
Nikolai Kondrashov fe6c6d4e1a Bluetooth: GATT: Document some macro arguments
Name some types in bluetooth/gatt.h and use those names to document the
expected values of some of the BT_GATT_* macro arguments, in an attempt
to make understanding the API a little easier.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
2022-08-01 18:04:02 +01:00
Nikolai Kondrashov c194752daa Bluetooth: GATT: Refer to BT_GATT_WRITE_FLAG_*
Refer to BT_GATT_WRITE_FLAG_* specifically, instead of the more general
BT_GATT_WRITE_* namespace to avoid future clashes with new symbols
there.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
2022-08-01 18:04:02 +01:00
Benjamin Björnsson e172b1dbda debug: gdbstub: Move to DTS for uart device
Move from using Kconfig GDBSTUB_SERIAL_BACKEND_NAME to a devicetree
chosen property ("zephyr,gdbstub-uart"). This is similar to a number
of other functions like "zephyr,shell-uart" or "zephyr,bt-uart".

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-08-01 09:09:45 -07:00
Krzysztof Chruscinski 6812441099 boards: arm: nrf: Enable uart workaround for nrf9160dk and nrf5340dk
Enable a workaround for boards on which an issue has been reported.
Issue occurs only when serial works with virtual environment.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-08-01 18:06:46 +02:00
Krzysztof Chruscinski 0f9f18843f drivers: serial: nrfx_uarte: Add workaround for bytes dropping
Add workaround for development kits on which interface chip (segger chip)
is dropping bytes when they are sent in bursts. Issue has been seen on
DK which have multiple virtual com ports on the USB.

A workaround is adding periodic busy waits to introduce gaps in the
transmission.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-08-01 18:06:46 +02:00
Zhao Shuai 1c70522734 tests: subsys: dfu: move mcuboot_multi to new ztest API
Move test mcuboot_multi to use new ztest API.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-08-01 18:05:51 +02:00
Zhao Shuai f13ef35d75 tests: subsys: dfu: move mcuboot to new ztest API
Move test mcuboot to use new ztest API.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-08-01 18:05:51 +02:00
Zhao Shuai 014628a7e0 tests: subsys: dfu: move img_util to new ztest API
Move test img_util to use new ztest API.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-08-01 18:05:51 +02:00
Aleksander Wasaznik 419c540a5c Bluetooth: Test: Split up test "uuid"
Create a separate file and test suite for each tested function.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-08-01 18:05:12 +02:00