Commit graph

62528 commits

Author SHA1 Message Date
Piotr Golyzniak
c459b752f5 twister: add search ZTEST_SUITE, ZTEST and ZTEST_F
New ztest API is available in those places:
subsys/testsuite/ztest/src/ztest_new.c
subsys/testsuite/ztest/include/ztest_test_new.h

This requires also changes in Twister code during parsing c files to
find properly test suites and testcases.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2022-03-24 07:59:10 -04:00
Piotr Golyzniak
e2d903fe31 twister: extend searching src directory
Extend scope of searching src directory with defined test source code.
In some cases for optimization reason src direcotry is placed in parent
directory (in relation to testcase.yaml file placement). This changes
allow to detect such situations.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2022-03-24 07:59:10 -04:00
Piotr Golyzniak
340da2ecf3 twister: verify ztest suite name in output
Test wirtten in ztest framework should print in output information about
test suite name defined in test's source code (as a first argument of
ztest_test_suite() function). This changes make it possible to find such
test names in c files. Next they are used during test execution to
verify if performed test was performed properly (verification can base
not only on existance of "PROJECT EXECUTION SUCCESSFUL" info).

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2022-03-24 07:59:10 -04:00
Jordan Yates
ef4583a32c tests: drivers: pwm: test dummy PWM driver
Add a testcase for compiling the dummy `vnd,pwm` driver.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-03-24 12:56:28 +01:00
Jordan Yates
c064006ecc drivers: pwm: test driver
Add a dummy driver for the `vnd,pwm` compatible to allow compilation of
drivers utilising PWM when running "build_all" tests.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-03-24 12:56:28 +01:00
Piotr Golyzniak
cdfa230131 twister: change serial option existence verification
Modify serial and serial_pty option availability verification in DTU
object in device_is_available method to avoid situation when empty string
passed as serial in hardware_map.yaml cause hang up Twister in this
place.

Fixes: #41169

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2022-03-24 07:54:22 -04:00
Emil Gydesen
f474e5075e Bluetooth: Audio: Fix bad string format for ARRAY_SIZE
ARRAY_SIZE was recently changed to a size_t instead of
a long. Update the log statement to use correct
string format.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-24 12:50:05 +01:00
Gerard Marull-Paretas
7c15199e64 boards: arduino_nano_33_ble: add GPIO_ACTIVE_LOW to led0-2
The led0,1,2 LEDs are active low (MCU pins are electrically connected to
the LED cathodes).

Ref.
https://content.arduino.cc/assets/NANO33BLE_V4.0_sch.pdf

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
bd182a8666 boards: arduino_nano_33_ble: improve DT formatting
Remove C99 like comments, add some extra spaces for better readability.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
c0f12be3df boards: arduino_nano_33_ble: remove redundant defconfigs
The I2C/SPI settings are automatically selected depending on DT
selection.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
58b60bbb2d boards: arduino_nano_33_ble: remove redundant "gpio library"
The board had an internal "library" to configure pins in an Arduinoeish
fasion. This is no longer used, so can be removed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
1b479d6a8a boards: arduino_nano_33_ble: refactor init code
- Specify in DT the pin to enable I2C pull-up connection
- Always build board.c, so that the I2C bus is always pulled-up

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
f266b286b7 boards: arduino_nano_33_ble: use regulator for sensors
Most sensors are enabled by enabling the VDD_ENV output. Define a
regulator on DT for that and enable the regulators if sensors are
enabled.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
4e86985bec boards: arduino_nano_33_ble: define LED in DT
The board has a user LED attached to P1.09. This information was
hardcoded in board C files and enabled by default. This is something
applications need to do if needed (note that an always ON LED can incur
a considerable power consumption).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
7b033aa4df boards: arduino_nano_33_ble: remove undocumented debug code
It's not clear why the board configures debug/tracing functionality
using HAL low level code, remove it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
0b59d43d12 boards: arduino_nano_33_ble: remove redundant pwm entries
Enabling PWMs without selecting any channel is pointless, so remove
entries from DT. Also remove custom code in sensor_init, PWM API needs
to be used instead.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
7ceabd25ec boards: arduino_nano_33_ble: drop BLE_EN_USB_CONSOLE
Drop the BOARD_ARDUINO_NANO_33_BLE_EN_USB_CONSOLE Kconfig option. If
applications need a USB console, they need to adjust `prj.conf` (or
overlays) enabling relevant settings.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
5357f5a83c boards: arduino_nano_33_ble: remove redundant comments from DT
Remove some comments that are redundant and provide no relevant
information.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Gerard Marull-Paretas
65034dfbbf boards: arduino_nano_33_ble: remove redundant rtc1 entry
The peripheral is already disabled by default, so the entry was
pointless. Also removed commented code in init_sensors.c related to rtc.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 12:47:25 +01:00
Henrik Brix Andersen
7319a2fd38 drivers: can: render ASCII using the text pygment lexer
Render ASCII tables using the "text" pygment lexer. There is no
"unparsed" lexer.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-24 07:20:55 -04:00
Henrik Brix Andersen
94a4ad6f64 drivers: can: remove redundant @typedef doxygen commands
Remove redundant @typedef doxygen commands from the CAN API
documentation. These doxygen commands are only needed if documenting a
typedef separate from its declaration.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-24 07:20:55 -04:00
Piotr Pryga
09cd296962 Bluetooth: Controller: radio: Fix num of antennas returned by controller
The antenna number returned by controller if antenna switching is not
enabled was zero. That is not compliant with  BT 5.3. Core Spec Vol 4.
Part E section 7.8.87. In this situation returned value should be 1.

There is always single antenna available that is responsible for PDU
reception and transmission.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-03-24 11:59:31 +01:00
Jamie McCrae
2681c6dfb8 samples: subsys: mgmt: smp_svr: Fix dupicate fs mgmt registration
This fixes an issue with the filesystem mcumgr being registered twice
in the sample application which resolves an issue with an endless loop
if a mcumgr handler is used which is not registered.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-03-24 11:56:48 +01:00
Jamie McCrae
4ab7bdddfc CODEOWNERS: Add Laird Connectivity BT510 and BT610 codeowner
Assign @greg-leach as owner of BT510 and BT610 boards

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-03-24 11:47:11 +01:00
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