Commit graph

66808 commits

Author SHA1 Message Date
Peter Mitsis 3b7818b2d2 lib/os: use generic mem stats structure for heap
Since the retrieved heap memory statistics are identical to those of
the retrieved mem_block statistics, it makes sense to use a single
generic-named structure for both instead of two identical structures
with different names.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-07-12 13:59:26 +00:00
Peter Mitsis d061366f54 lib/os: add statistics tracking to mem_blocks
Both the current and maximum number of allocations in a given memory
blocked are tracked (and can be queried) when the
CONFIG_SYS_MEM_BLOCKS_RUNTIME_STATS Kconfig option is selected.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-07-12 13:59:26 +00:00
Jonathan Rico ee190f49c2 Shell: bluetooth: don't refer to commit message text
One sometimes forgets files can be distributed outside of git..

Added a concise usage example of the command above the config.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 15:38:46 +02:00
Aleksander Wasaznik af0bd132f0 CODEOWNERS: Remove alwa-nordic from bsim_test_audio
Remove alwa-nordic from /tests/bluetooth/bsim_bt/bsim_test_audio.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-07-12 09:20:58 -04:00
Emil Gydesen c699ae5850 Bluetooth: Audio: Expose broadcast sink adv data to application
In the broadcast sink `scan_recv` which is called when we
scan for broadcast source, we now also provide the entire
AD struct to the application.

The reason for this is that the advertising data may
contain other information that is useful for the application
like the broadcaster device name or any other
vendor/application specific data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-12 14:17:02 +02:00
Emil Gydesen bd64be452c samples: Bluetooth: Update unicast audio client to disconnect
Update the sample to reset data and restart scanning for new
unicast audio servers if the connected one disconnected.

This does not handle if a disconnect happens in the middle of
setting up the audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-12 14:12:08 +02:00
Emil Gydesen 9b15426455 Bluetooth: Audio: Refactor ISO allocation endpoints
Modify how the ISO channels are allocated for the audio streams,
as well as how the CIG is allocated for the unicast group.

This fixes an issue where the unicast group could not be
fully allocated before _after_ the bt_audio_streams had been
configured by bt_audio_stream_config, thus making it impossible
to create a unicast group before the connections have been established.

This leaves us with 3 basic data types:
1) Streams allocated by the application
2) Endpoints that represent ASEs
3) Audio_iso which is used to couple streams and ISO channels.

The Unicast Group for the unicast client will now have the same
lifetime as the ISO CIG for the central.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-12 14:12:08 +02:00
Guillaume Lager f6f52d3842 drivers: adc: Add ADS1119 driver
The driver support both synchronous and asynchronous reading.

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2022-07-12 12:29:45 +02:00
Guillaume Lager ac1eab55ef drivers: adc: Add runtime adc context initialization function
In some case the structure enclosing the adc context
can be quite big, making static initialization quite
resource consuming

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2022-07-12 12:29:45 +02:00
Benjamin Björnsson 6c82570f62 drivers: sensor: ccs811: Add multi-instance support
Move driver to use DT_INST_FOREACH_STATUS_OKAY to add
multi-instance support.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-12 12:28:53 +02:00
Xiao Song 0b73446c5d tests: net: ieee802154: move l2 to new ztest API
Move tests/net/ieee802154/l2/ to use new ztest API.

Signed-off-by: Xiao Song <songx.xiao@intel.com>
2022-07-12 12:26:16 +02:00
Xiao Song ec3a208f87 tests: net: ieee802154: move fragment to new ztest API
Move tests/net/ieee802154/fragment/ to use new ztest API.

Signed-off-by: Xiao Song <songx.xiao@intel.com>
2022-07-12 12:26:16 +02:00
Xiao Song e19544a7c0 tests: net: ieee802154: move custom_l2 to new ztest API
Move tests/net/ieee802154/custom_l2/ to use new ztest API.

Signed-off-by: Xiao Song <songx.xiao@intel.com>
2022-07-12 12:26:16 +02:00
Jonathan Rico 76f74344a8 Shell: kernel: Add runtime log filtering command
Use `kernel log-level modulename severity`
Also enable it for the Bluetooth Shell.

Then one can compile-in a lot of BT modules like so:

CONFIG_BT_DEBUG_HCI_CORE=y
CONFIG_BT_DEBUG_L2CAP=y
CONFIG_BT_DEBUG_ATT=y
CONFIG_BT_DEBUG_GATT=y

And at runtime select only, e.g. GATT

kernel log-level bt_hci_core 0
kernel log-level bt_l2cap 0
kernel log-level bt_att 0

And then re-enable L2CAP if needed later

kernel log-level bt_l2cap 4

And so on..

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Herman Berget a0ce235d9b Bluetooth: Shell: Add bt security command to list current security level
The command could previously only set the security level.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico e797c69554 Bluetooth: shell: add l2cap ECRED commands
Add commands to connect to an l2cap channel using Enhanced Credit-based
Flow Control, and to reconfigure it.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico 71bcab6335 Bluetooth: shell: add hexdump on GATT read
In order to actually see the data instead of just getting the length.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico 7f88638e11 Bluetooth: shell: stop l2cap TX when channel is disconnected
Without this, the shell locks up when disconnected in the middle of a send
routine.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico 57fec48109 Bluetooth: shell: add nrf52840dk and nrf53dk overlays
Run the shell at 1Meg with flow control on nRF52840 and nRF5340 DKs.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico 92bd415750 Bluetooth: shell: add param-less connect command
When invoked without parameters, `bt connect` will now attempt to connect
to the last scanned device. Used in conjunction with the RSSI filter, this
makes the connection process somewhat scriptable.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico 55179da0fc Bluetooth: shell: add RSSI filtering
This adds an RSSI cutoff, so any scanned devices that are below the given
value (in dB) will not get printed out. Very useful in noisy environments.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico ad4cf99eb3 Shell: add kernel sleep command
Basic sleep command for scripting purposes.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Alexandr Kolosov 403b69085d boards: riscv: tlsr9518adk80d: Move IMG_BLOCK_BUF_SIZE in Kconfig.defconfig
While build of samples or applications which does not contain
MCUBOOT_IMG_MANAGER option enabled, following warning occures:

warning: IMG_BLOCK_BUF_SIZE was assigned the value 256 but got
the value ``.

Because of that it decided to move IMG_BLOCK_BUF_SIZE config to
Kconfig.defconfig with additional condition if MCUBOOT_IMG_MANAGER

Signed-off-by: Alexandr Kolosov <rikorsev@gmail.com>
2022-07-12 09:43:50 +00:00
li biao 6ef33396b8 tests: lib: move notify to new ztest API
Move test lib/notify to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-07-12 11:19:22 +02:00
li biao e00bc8ece7 tests: lib: move onoff to new ztest API
Move test lib/onoff to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
2022-07-12 11:19:22 +02:00
Jonathan Rico e0f0f4ab45 Bluetooth: Host: add missing bt_conn_unref
conn is being referenced in `bt_conn_lookup_addr_le()`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 11:14:29 +02:00
Jonathan Rico 38cd73d47d Bluetooth: gatt: check subscription before notifying
Check that the client has subscribed before sending a notification.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 11:14:29 +02:00
Benjamin Björnsson bf4b30e848 drivers: sensor: iis3dhhc: Add multi-instance support
Move driver to use DT_INST_FOREACH_STATUS_OKAY to add
multi-instance support.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-12 10:56:15 +02:00
Kumar Gala 4fab930c6d samples: video: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-12 10:20:00 +02:00
Andriy Gelman 33edc4a065 dts: arm: infineon: Append package name to dtsi file
Be more verbose in the naming to match convention on other boards.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-07-12 10:18:59 +02:00
Andriy Gelman 027930e2b6 boards: arm: xmc45_relax_kit: Remove uart &usic1ch0 from dts
The uart driver is hard-coded to use usic1ch1 only.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-07-12 10:18:59 +02:00
Benjamin Björnsson 0364f3ae4d drivers: sensor: ti_hdc: Add multi-instance support
Move driver to use DT_INST_FOREACH_STATUS_OKAY to add
multi-instance support.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-12 10:18:29 +02:00
Jeppe Odgaard af6f975391 soc: select HAS_MCUX_SRC for MIMXRT1052
Select missing HAS_MCUX_SRC Kconfig symbol for MIMXRT1052,
that allows using NXP i.MX mcux SRC hwinfo driver.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/47025

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2022-07-12 10:17:38 +02:00
NingX Zhao 553a4de3c9 tests: subsys: sd cases move to new ztest API
Move test to use new ztest API.

Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
2022-07-12 10:16:22 +02:00
Christopher Friedt d37350bc19 tests: posix: pthread: test for pthread descriptor leaks
Add a simple test to ensure that we can create and join a
single thread `CONFIG_MAX_PTHREAD_COUNT` * 2 times. If
there are leaks, then `pthread_create()` should
eventually return `EAGAIN`. If there are no leaks, then
the test should pass.

Fixes #47609

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-07-12 10:16:02 +02:00
Christopher Friedt da0398d198 posix: pthread: consider PTHREAD_EXITED state in pthread_create
If a thread is joined using `pthread_join()`, then the
internal state would be set to `PTHREAD_EXITED`.

Previously, `pthread_create()` would only consider pthreads
with internal state `PTHREAD_TERMINATED` as candidates for new
threads. However, that causes a descriptor leak.

We should be able to reuse a single thread an infinite number
of times.

Here, we also consider threads with internal state
`PTHREAD_EXITED` as candiates in `pthread_create()`.

Fixes #47609

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-07-12 10:16:02 +02:00
Asbjørn Sæbø dbe8a3ff96 Bluetooth: Audio: Additional MEDIA_PROXY defines
Add two MEDIA_PROXY group type defines corresponding to the MCS ones.
Update the mpl.c to use the newly added names.

The purpose of the exercise is to get a complete set of MEDIA_PROXY
defines, so that the media player can be made fully independent
(define-wise) of the MCS.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-07-12 10:15:32 +02:00
Asbjørn Sæbø 704d5ee0bf Bluetooth: Auidio: Use MEDIA_PROXY_* defines in media player
Update the media player to use the MEDIA_PROXY_* defines rather than the
BT_MCS defines.  The media player should not know about the MCS (media
control service).

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-07-12 10:15:32 +02:00
Asbjørn Sæbø 2cd812c427 Bluetooth: Audio: Use correct defines in media_proxy.
Update the media_proxy header file (documentation) to use the defines it
provides itself, rather than the corresponding ones from the mcs.h.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-07-12 10:15:32 +02:00
Kumar Gala 5c50591070 emul: emul_bmi160: Remove unused struct element
The bus_label field of the struct was not used, so remove it.  This
lets us remove one of the last users of DT_INST_BUS_LABEL.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-12 10:14:23 +02:00
Jordan Yates 962eca65af pm: device_runtime: detect power up failures
Check that the device we are trying to use has successfully powered up
when it is on a power domain. If it has not, release the request for the
power domain to be powered to ensure we do not have dangling requests.

As a result of this, `PM_DEVICE_ACTION_RESUME` will not be run on a
device if `PM_DEVICE_ACTION_TURN_ON` has already failed.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-12 10:07:18 +02:00
Jordan Yates 317679031d pm: device: store power up failures
Store errors powering up devices in a flag in the PM struct. This is
required as the `pm->state` variable always transitions to
`PM_DEVICE_STATE_SUSPENDED`, even when `PM_DEVICE_ACTION_TURN_ON`
returns an error. Marking the transition as failed will allow the
transition logic in `pm_device_runtime_get` to detect the problem.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-12 10:07:18 +02:00
Anas Nashif c59d03bcc5 doc: scripts: fix headers
Fix header underline length.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 10:03:45 +02:00
Anas Nashif 01582f80b7 scripts: move gen_cfb_font_header.py to scripts/build
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 10:03:45 +02:00
Anas Nashif 61f672607a scripts: move file2hex.py to scripts/build/file2hex.py
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 10:03:45 +02:00
Anas Nashif 92575fdac8 scripts: move parse_syscalls.py to scripts/build/
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 10:03:45 +02:00
Anas Nashif 98ab67d7dc scripts: move user_wordsize.py to scripts/build/user_wordsize.py
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 10:03:45 +02:00
Anas Nashif a8a976647e scripts: move uf2conv.py to scripts/build/uf2conv.py
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 10:03:45 +02:00
Anas Nashif 9ee1e32b57 scripts: move subfolder_list.py to scripts/build/subfolder_list.py
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 10:03:45 +02:00
Anas Nashif d859997994 scripts: move process_gperf.py to scripts/build
Move scripts needed by the build system and not designed to be run
individually or standalone into the build subfolder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-12 10:03:45 +02:00