Commit graph

62204 commits

Author SHA1 Message Date
Jamie McCrae 97e04aefb8 CODEOWNERS: Add Laird Connectivity Pinnacle 100 codeowner
Assign @rerikson1 as codeowner of Pinnacle 100 board

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-03-24 11:47:11 +01:00
Jamie McCrae 5ba3efb0e2 CODEOWNERS: Add codeowner for Laird Connectivity BL* modules
Add myself as codeowner for BL* modules

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-03-24 11:47:11 +01:00
Stephanos Ioannidis 07e4d08554 cmake: Use Zephyr SDK by default on all host operating systems
This commit updates the Zephyr build system to use the Zephyr SDK by
default for all host operating systems, when `ZEPHYR_TOOLCHAIN_VARIANT`
environment variable is not explicitly set.

Note that the Zephyr SDK is now available on all three major host
operating systems (i.e. Linux, macOS, Windows), and there is no reason
to exclude this behaviour for non-Linux hosts anymore.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-03-24 11:45:05 +01:00
Gerhard Jörges 4fd24a4341 libc: minimal: Add strtoll() and strtoull()
- strtoll() and strtoull() are copies of strtol() and strtoul() with
  types changed to long long instead of long.
- added tests
- added documentation
- removed stubs from civetweb sample

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2022-03-24 11:03:06 +01:00
Martí Bolívar 869ae2b5ac devicetree.h: add DT_NODE_CHILD_IDX
It can be useful to know what a node's index is in its parent's list
of children. This information is now available to C via
gen_defines.py, but no user-facing macros are available to access it.

Add a macro which exposes this information to users via devicetree.h.

Some APIs want to build on devicetree.h by creating some derived
structure for each of a node's children. It can therefore be
convenient to use each child's index in the list of children as an
identifier for the child.

Some concrete and common examples are "gpio-keys" and "gpio-leds",
which allow you to define arbitrary numbers of keys and LEDs as child
nodes of nodes with those compatibles. Derived APIs can use a key or
LED node's index in its list of parents as a way to identify which of
several structures is relevant to a particular controlled key or LED.

These are just examples, though -- the feature added here makes no
assumptions about where it's being used.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-03-24 10:48:40 +01:00
Martí Bolívar 50f9b3c2ca gen_defines: add _CHILD_IDX macros for nodes with parents
These expose every node's index in its parent's list of children to C.
The root node has no parent, so no _CHILD_IDX macro is generated for
it.

Keep macros.bnf up to date with the new generated macros.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-03-24 10:48:40 +01:00
Martí Bolívar 355cc01a36 scripts: gen_defines: rearrange some internals
Consolidate child helper macros into a single function. No functional
changes expected.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-03-24 10:48:40 +01:00
Martí Bolívar 7c3b445323 edtlib: add Node.child_index()
It can be useful to know what the index of a particular child is in
the list of nodes. Add a a helper for computing that and some test
cases.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-03-24 10:48:40 +01:00
Emil Gydesen b0a01ac82f Bluetooth: Audio: Fix broadcast sink PA sync callbacks register
The broadcast sink would continously register the PA sync callbacks,
effectively creating an infinite loop. Fixed by correctly
setting the boolean to prevent this.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen 868806c211 Bluetooth: Audio: Fix broadcast sink null pointer in cleanup
Fix potential null pointer acceess in
broadcast_sink_cleanup_streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen 9e765a2004 Bluetooth: Audio: add BIS index check for broadcast sink
When the broadcast sink receives a BASE it will now
properly check if the BIS indexes are valid.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen ec3793b154 Bluetooth: Audio: Fix broadcast audio endpoint disconnect state
Once a broadcast source is stopped, the endpoints
should go into the same state before it was
started (BT_AUDIO_EP_STATE_QOS_CONFIGURED), instead
of idle.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen 2df9077307 Bluetooth: Audio: Add missing break for broadcast source ep state
There was a missing break statement for the
BT_AUDIO_EP_STATE_QOS_CONFIGURED state, so the
broadcast source could never go into the streaming state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen 9efa22940c Bluetooth: Audio: Add broadcast source subgroup count Kconfig
Add a (initally hidden) Kconfig option for broadcast source
used to determine the size of the advertisable BASE.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen 23e45c937a Bluetooth: Audio: Add subgroup count check for broadcast sink
The broadcast sink will now not attempt to decode BASEs with
more subgroups than what the broadcast sink can
actually decode.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen a50e41b059 Bluetooth: Audio: Remove unicast guard for some stream functions
Remove the unicast guard for bt_audio_codec_qos_to_iso_qos
and bt_audio_stream_attach as they are also used for
broadcast sink and broadcast source.

Also allow broadcast source to use bt_audio_stream_send.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen 8e34701e19 Bluetooth: Audio: Move CONFIG_BT_CODEC out of unicast-only
Move the Kconfig options for BT_CODEC out of the
BT_AUDIO_UNICAST guard, as these are used for broadcast sink
and broadcast source as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Emil Gydesen 847c1ad643 Bluetooth: ISO: Add BIS min/max index
Add defines for BIS min/max index

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 10:48:00 +01:00
Filip Kokosinski 8388bb7c24 soc: riscv: sifive-freedom: fix SYS_CLOCK_HW_CYCLES_PER_SEC value
This commit fixes the default value of SYS_CLOCK_HW_CYCLES_PER_SEC
option. The previous value of 32768 is not consistent with the
documentation of FE310 SoC. Only FE310-based boards rely on the default
value of this option; other boards from the Freedom series define it
themselves.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski 0a9e8a5463 drivers: pinmux: remove SiFive pinmux driver
After transitioning to the new pinctrl driver, it is now obsolete.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski 38f38e0be8 boards: FE310-based boards: transition to pinctrl driver
This commit makes the transition from the pinmux driver to the pinctrl
driver. It also modifies UART, SPI and I2C drivers used in FE310-based
boards to use the new pinctrl API.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski a9543e0ff4 boards: qemu_riscv32: add pinctrl configuration for qemu_riscv32_xip
Add pinctrl configuration for future use with the new pinctrl driver.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski 99e787de21 boards: hifive1_revb: add pinctrl configuration for hifive1_revb board
Add pinctrl configuration for future use with the new pinctrl driver.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski 0d3ec151c8 boards: hifive1: add pinctrl configuration for hifive1 board
Add pinctrl configuration for future use with the new pinctrl driver.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski a5cc185b9b drivers: pinctrl: add SiFive pinctrl driver
Add a pinctrl driver used in FE310-based boards.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Lingao Meng b76d74cd64 Bluetooth: Mesh: Fix adv_send call before enabled.
Since the default syswork thread priority = `-1`.
`adv_send` will call when controller report advertising
sending completed, due to this process by BT RX task, will
maybe process this before `buf_send`, since, sysworkq will be
used by other place and defer by any place.

Note: secure beacon will be 40ms, and friend and lpn will be 20ms.

This problem is very easy to reproduce, especially in native posix.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-03-24 10:46:07 +01:00
Lingao Meng 58a501d6cd Bluetooth: Mesh: Fix unref null pointer
When pb-gatt advertising enabled, after extablish connect,
will call `cb->connected` and `cb->adv_send`.

In previous connected also clear `ADV_FLAG_PROXY` flag, but
in `adv_send` will attempt unref null point buffers.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-03-24 10:46:07 +01:00
Szymon Janc 573c0d59e0 tests/bluetooth/tester: Add support for auto connection establishment
autopts was updated to properly require support for Accept Filter List
in Auto Connection Establishment Procedure related tests. This patch
enabled support for it and adds required BTP support.

This was affecting following qualification test cases:
GAP/CONN/ACEP/BV-03-C
GAP/CONN/ACEP/BV-04-C

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-03-24 10:45:49 +01:00
Tom Burdick f8250c9813 dma: Better suspend/resume testing
Make the test data larger to help slow down the transfer long enough
to get suspend to work. Then attempt to spin on suspend. Suspending any
of the test transfers is a success.

Previous suspend resume test would always fail on DesignWare DMA
as it was seemingly already done by the time dma_suspend would be
called in the ISR.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-03-24 10:44:50 +01:00
Yuval Peress 2374544bcc posix: Select CPU_HAS_FPU for POSIX arch
Add the ability to run native-posix tests using the FPU.

Signed-off-by: Yuval Peress <peress@google.com>
2022-03-24 10:44:38 +01:00
Yuval Peress 2a80d67843 cbprintf: Fix incorrect alignment
In addition to x86-32, POSIX boards are also affected by the issue
where a `long double` has the size of 12.

Simplify the process by setting the alignment to 16 for xtensa (as
before). Then defaulting to using `long double` if the config is set.
The case of 12 byte `long double` is then handled by Z_POW2_CEIL when
available. Otherwise, a BUILD_ASSERT is used to verify that alignment
is valid.

Signed-off-by: Yuval Peress <peress@google.com>
2022-03-24 10:44:38 +01:00
Yuval Peress e1d676622c toolchain: generalize the Z_IS_POW2 macro
Move the definition of the Z_IS_POW2 macro to the toolchain header
for common use.

Signed-off-by: Yuval Peress <peress@google.com>
2022-03-24 10:44:38 +01:00
Yuval Peress 62472224c0 toolchain: fix 32 bit mode Z_POW2_CEIL
When not using 64 bit mode, the implementation of Z_POW2_CEIL should
be using __builtin_clz instead of __builtin_clzl.

Signed-off-by: Yuval Peress <peress@google.com>
2022-03-24 10:44:38 +01:00
Navin Sankar Velliangiri b69dadb6e5 drivers: clock_control: lpc: syscon: Add BUSCLK support
Add support for the LPC BUS clock to the LPC SYSCON clock controller
driver.

Signed-off-by: Navin Sankar Velliangiri <navin@linumiz.com>
2022-03-24 10:44:27 +01:00
Alexandre Bourdiol 2c4d55042c drivers: bluetooth: hci: BlueNRG-MS: Hold on CS
In case of BlueNRG-MS, it is necessary to prevent SPI driver to release CS,
and instead, let current driver manage CS release.
So, add SPI_HOLD_ON_CS to operation field

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-03-24 10:44:15 +01:00
Alexandre Bourdiol 8538b835f3 drivers: bluetooth: hci: use logic (and not pin value) kick/release CS
Use logic (and not pin value) for kick_cs() and release_cs()
because potential pin value invertion (Active LOW)
is handled in gpio_pin_set()

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-03-24 10:44:15 +01:00
Alexandre Bourdiol f1ad7ede9c boards: arm: disco_l475_iot1 BLE SPI CS is active low
On board disco_l475_iot1, BLE SPI CS is active low

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-03-24 10:44:15 +01:00
Mulin Chao 8a4013b2e1 drivers: adc: Set correct interrupt type and remove spurious interrupts
In npcx adc driver, we select 'Scan' (Multiple Channels Operation Mode)
mode by default. It means that selected channels in ADCCS will be
converted automatically. Then, read the measured data from CHNDAT
registers if EOCCEV (Event is set after all selected channels are
converted.) flag in ADCSTS is set.

But we enable the wrong interrupt type, INTECEN, during adc
initialization. Ec will send the interrupt after each channel in ADCCS
is converted. It has no harm to the current driver since the driver
reads all selected channels and turns off ADC converter only after
EOCCEV is set in ISR. But it does generate spurious interrupts.

This CL enables the correct interrupt type, INTECCEN, during adc
initialization. Ec only sends the interrupt after all of channels in
ADCCS are converted.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-03-24 10:43:54 +01:00
Casper Bonde 0874ff5cfd Bluetooth: Audio: ASCS: do not fail on preferred value check
bt_audio_valid_stream_qos() is used to validate the QoS parameters
set by a client. It did a check of a preferred setting which is
ok to exceed (mandatory in some cases).
This change removes the statement that causes the check to fail,
but keeps the check for debug purposes.

Fixes #43359

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
2022-03-24 10:43:38 +01:00
Matthias Fend a3f7a01ac8 soc: mimx8ml8_m7: add .resource_table section to linker script
This is required to include the resource table in the build output. The
Linux remoteproc framework explicitly looks for this section while loading
the elf and may complain if the resource table is missing.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
2022-03-24 10:41:39 +01:00
Matthias Fend fc4055852e lib: open-amp: add support for an empty resource table
This allows a resource table to be included even if neither virtIO nor the
RAM console are used.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
2022-03-24 10:41:39 +01:00
Matthias Fend b83b72beec samples: ipc: openamp_rsc_table: do not enable CONFIG_IPM_MCUX
This is a device-specific option and should therefore not be activated in
a generic project. Since the only boards that use this Kconfig symbol
(lpcxpresso54xx, lpcxpresso55sxx) don't build anyway, this option could
be removed. The device/board specific configuration should be placed in
the boards folder along with an appropriate device tree describing the
IPC nodes.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
2022-03-24 10:41:39 +01:00
Andrzej Puzdrowski 37644f83e3 tests/drivers/flash: fix TEST_AREA_MAX
There was mistake in parentheses application in
the expression which calculates the value.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-03-24 10:14:26 +01:00
Carles Cufi 1a7666b278 manifest: Update Tf-M revision to HEAD of fork
PR #43575 was merged mistakenly with a reference to a PR. Fix this by
pointing to the HEAD SHA of the TF-M fork.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-03-24 10:13:59 +01:00
Flavio Ceolin 890f619936 tests: mbedtls: Fix GCC warning about test_snprintf
Fix errors like:

inlined from ‘test_mbedtls’ at
zephyrproject/zephyr/tests/crypto/mbedtls/src/mbedtls.c:172:6:
zephyrproject/zephyr/tests/crypto/mbedtls/src/mbedtls.c:96:17: error:
‘test_snprintf’ reading 10 bytes from a region of size 1
[-Werror=stringop-overread]
   96 |                 test_snprintf(1, "", -1) != 0 ||
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~

In GCC >= 11 because `ret_buf` in some calls are shorter literals

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-03-23 18:14:07 -04:00
Lauren Murphy 5e8b7b5b37 samples: tflite-micro: fix hello_world README
Corrects number of loops mentioned in README of sample
to match NUM_LOOPS in main.c. NUM_LOOPS was lowered in
PR #41123 to reduce the noise the sample produced in CI,
but the PR missed changing the README.

Cleans up one line.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-03-23 16:51:22 -04:00
Andrzej Puzdrowski 6d57cbaef1 tests/drivers/flash: fix TEST_AREA_MAX calculation
The `size` property is expressed in `bits` unit.
The value should be calculated as bits to bytes conversion.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-03-23 15:05:24 -04:00
Matthias Hauser e565e67114 boards: Add Proteus-III board file
Add a new board file of the Proteus-III radio module

Signed-off-by: Matthias Hauser <Matthias.Hauser@we-online.de>
2022-03-23 18:50:09 +01:00
Dominik Ermel e1d57d19f2 mgmt/mcumgr/lib: Add missing mcumgr_img_mgmt log Kconfig options
Due to lack of proper Kconfig options for the logging module,
default were always applied.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-23 18:40:53 +01:00
Dominik Ermel 7de1061f5c mgmt/mcumgr/lib: Fix LOG_MODULE_NAME for image group
Was mcumgr_flash_mgmt, replaced with mcumgr_img_mgmt.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-23 18:40:53 +01:00