Commit graph

21541 commits

Author SHA1 Message Date
Guennadi Liakhovetski
fe609dd8e8 llext: look for symbols in other LLEXT objects too
LLEXT objects can also export symbols for use by other such objects.
That means, that when linking an LLEXT object we have to look for
unresolved symbols in previously loaded objects too.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-02 12:31:52 -04:00
Guennadi Liakhovetski
92a7c772d9 llext: remove an unused variable
Remove a loop counter, that isn't actually used for anything.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-02 12:31:52 -04:00
Pavel Vasilyev
2f02474448 bluetooth: host: adv: Release buf if failed to set addr
The `bt_id_set_adv_own_addr` function itself tries to allocate a buffer
for the command and it failes due to lack of buffers, it returns error.
However, the `le_ext_adv_param_set` function doesn't handle the error
properly and keeps its own allocated buffer.

This commit releases the allocated buffer.
Partially fixes mesh in #77241.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-02 12:30:18 -04:00
Simen Eilevstjønn
2c64fe7f37 Bluetooth: Implemented new DIS characteristics
Implemented new DIS characteristics:
    - UDI for medical devices
    - IEEE 11073-20601 Regulatory Certification Data List
    - System ID

Also fixed buffer overflow bug when assigning too long DIS string literals

Signed-off-by: Simen Eilevstjønn <simen.eilevstjonn@laerdal.com>
2024-09-02 12:00:52 +02:00
Aleksander Wasaznik
2f86faffba Bluetooth: Host: Minor doc and rename for LE remote feature exchange
Rename `BT_CONN_AUTO_FEATURE_EXCH` to `BT_CONN_LE_FEATURES_EXCHANGED`,
and add some comments for readability.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-09-02 11:50:25 +02:00
Daniel Leung
060538ee28 logging: fix color being shown even if disabled
If CONFIG_LOG_BACKEND_SHOW_COLOR is disabled, error and warning
lines are still being outputted with color, which is contrary to
what the Kconfig says. So change the color settings for error
and warning lines to no color if this Kconfig is disabled.

The log_output test is also amended to account for this.
Though the test is not skipped as no color is still some colors
(... well... maybe).

Fixes #77150

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-09-02 09:07:19 +02:00
Vinayak Kariappa Chettimada
b505942897 Bluetooth: Controller: nrf54L15bsim: Use NRF_GRTC
Use NRF_GRTC in nrf54l15bsim board builds.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
125f39758d Bluetooth: Controller: nRF54Lx: Use SW_SWITCH_SINGLE_TIMER
Use SW_SWITCH_SINGLE_TIMER for nRF54Lx so that fast ramp
can be used, and hence support assymmetric PHYs in ACL
connections.

nRF54Lx radio domain does not have second timer instance
to efficiently implement software switch unless a second
time is used from a different power domain needed use of
PPIB for the double buffered switch timer compares.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
e642aa3513 Bluetooth: Controller: nRF54Lx: Use nrfx interface for bsim use (4/4)
Use nrfx interface for register access with sideeffects to
facilitate bsim use.

Remove CMSIS interface use, was replaced with nrf_grtc,
nrf_dppic and nrf_ppib interface in previous commit.

4 part commits:
1. Add nrf_grtc interface.
2. Remove CMSIS interface use.
3. Add nrf_grtc interface, once missing bsim port available.
4. Remove CMSIS interface use, replaced by bsim port.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
da6bd08df0 Bluetooth: Controller: nRF54Lx: Use nrfx interface for bsim use (3/4)
Use nrfx interface for register access with sideeffects to
facilitate bsim use.

4 part commits:
1. Add nrf_grtc interface.
2. Remove CMSIS interface use.
3. Add nrf_grtc interface, once missing bsim port available.
4. Remove CMSIS interface use, replaced by bsim port.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
d5e75ce755 Bluetooth: Controller: nRF54Lx: Use nrfx interface for bsim use (2/4)
Use nrfx interface for register access with sideeffects to
facilitate bsim use.

Remove CMSIS interface use, was replaced with nrf_grtc
interface in previous commit.

4 part commits:
1. Add nrf_grtc interface.
2. Remove CMSIS interface use.
3. Add nrf_grtc interface, once missing bsim port available.
4. Remove CMSIS interface use, replaced by bsim port.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
24465ec160 Bluetooth: Controller: nRF54Lx: Use nrfx interface for bsim use (1/4)
Use nrfx interface for register access with sideeffects to
facilitate bsim use.

4 part commits:
1. Add nrf_grtc interface.
2. Remove CMSIS interface use.
3. Add nrf_grtc interface, once missing bsim port available.
4. Remove CMSIS interface use, replaced by bsim port.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
f39c27bc95 Bluetooth: Controller: nRF54Lx: Review rework GRTC support
Review rework GRTC support for nRF54Lx SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
10a466f31f Bluetooth: Controller: nRF54Lx: Support Radio fast ramp up
Add support for Radio fast ramp up for nRF54Lx SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
55813ad95b Bluetooth: Controller: nRF54Lx: Use NRF_GRTC for radio scheduling
Use NRF_GRTC, Global real-time counter, instead of NRF_RTC.

NRF_GRTC is present in a different power domain in the SoC.
Also, NRF_GRTC provide microsecond resolution timing units,
in the future use of NRF_TIMER for packet timer can also be
replaced.

Use of NRF_RTC would keep Radio power domain ON in addition
to already ON NRF_GRTC's power domain, hence switch to using
NRF_GRTC on nRF54Lx SoC to have lower power consumptions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
e998593c2e Bluetooth: Controller: nRF54Lx: Port for data whitening register use
nRF54Lx have updated Data Whitening register settings, add
implementation to correctly set them up.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
01d7a5bf13 Bluetooth: Controller: Ticker support for free running counter
Add ticker implementation support for free running counter
use.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
a947d6f635 Bluetooth: Controller: Add HAL_TICKER_TICKS_TO_US_64BIT define
Add HAL_TICKER_TICKS_TO_US_64BIT define, to return
microsecond value in 64-bits.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
ded2c74a97 Bluetooth: Controller: Remove redundant HAL_TICKER_CNTR_CLK_FREQ_HZ
Remove redundant HAL_TICKER_CNTR_CLK_FREQ_HZ define.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
55b7dba8ec Bluetooth: Controller: Refactor sw_switch hal interface use
Refactor sw_switch hal interface use and document why some
PPI/DPPI channel group related subscriptions are not
disabled explicitly.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
a7fff7445c Bluetooth: Controller: Fix ext conn create when using single timer
Fix Extended Connection Creation when using single timer
feature in the Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
bcd28e0a86 Bluetooth: Controller: Fix sw switch single timer for spurious TXEN/RXEN
Fix software tIFS switching using single timer from
triggering spurious TXEN/RXEN if the first remainder is
shorter than the tIFS delay calculated in the sw_switch()
function.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Vinayak Kariappa Chettimada
7fbf337e6f Bluetooth: Controller: Fix BT_CTLR_EARLY_ABORT_PREVIOUS_PREPARE depends
Fix BT_CTLR_EARLY_ABORT_PREVIOUS_PREPARE Kconfig depends on.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-30 11:47:15 -04:00
Bjarki Arge Andreasen
ee1e517ccf ipc: icmsg: configure PBUF RX rx_buffer using kconfig
The size of the rx_buffer used by icmsg.c mbox_callback_process()
is not MISRA compliant, being "dynamically" allocated on the stack.

This commit adds a kconfig to set the size of the read buffer and
asserts that it is large enough to read all received data.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-08-30 11:45:38 -04:00
Pavel Vasilyev
1fa27888f4 bluetooth: mesh: Fix proxy client compilation
When building proxy client without proxy server, it fails to find
the `identity` field in the `struct bt_mesh_subnet_keys` because the
latter only compiles when Proxy server is enabled. It should be
possible to compile Proxy Client without Proxy server.

This commit compiles the field if any of GATT features is enabled.

Fixes #75914

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-08-30 11:43:51 -04:00
Alberto Escolar Piedras
5c17f51bda Bluetooth: Controller: Initialize BIG info RFU field
The BIG info new Framing Mode field was not initialiazed, so
random garbage was being sent to the air in this field.
For the controller this field is still RFU.
The spec specifies RFU fields must be initialiazed to
0. So let's do so to avoid sending invalid data,
and avoid having random data in the air which can cause
random differences in testcases.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-30 11:43:40 -04:00
Anuj Pathak
7e1dc5ae3e bluetooth: services: hrs: added control point write callback
- HRS control point was added to server but no write callback is
defined, this causes issues if control point characterstic is
written by the client

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2024-08-29 16:12:12 -04:00
Tom Burdick
9dffac0107 llext: flush logging before unloading extensions
Extensions could have used logging, when log processing is
deferred, the logging thread can run after the extension has
been unloaded and thereby access invalid memory addresses.
Make sure to flush all logs before unloading extensions.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-29 18:05:04 +02:00
Nithin Ramesh Myliattil
d8e4bc7ff0 bluetooth: BAS: add gatt notify for battery level status char
gatt notification for battery level status char is added
in battery service.

Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
2024-08-29 18:03:09 +02:00
Anuj Pathak
957d59814b bluetooth: services: added current time service
- added ctc implementation
- updated Kconfig & CMake files
- updated service doc

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2024-08-29 11:38:28 +02:00
Mark Wang
b4ddf3dec6 Bluetooth: Classic: SDP: fix that record len is SEQ32
find the headset which a2dp related record len is SEQ32,
fix sdp_client_get_total too because it doesn't handle
SEQ32 too.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-08-29 11:38:02 +02:00
Yong Cong Sin
f81d178b23 shell: modules: kernel: fix typo in cmd_kernel_uptime()
Caught by CI in another PR, should be 'Unsupported' instead.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-28 14:01:55 -04:00
Yong Cong Sin
aca3b3602a shell: modules: kernel: add CPU mask affinity/pinning commands
Added commands to access the APIs in the kernel/cpu_mask.c

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-28 14:01:55 -04:00
Yong Cong Sin
475fc91746 shell: modules: kernel: add additional check in unwind cmd
Use `shell_strtoull()` to parse the thread ID argument for
error checking.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-28 14:01:55 -04:00
Yong Cong Sin
e3c2e8484f shell: modules: kernel: group thread-related cmds
`stacks` `threads` & `unwind` are commands related to kernel
thread, group them one level inside a main `thread` command,
and rename `threads` to `list`:

- `kernel threads` -> `kernel thread list`
- `kernel stacks` -> `kernel thread stacks`
- `kernel unwind` -> `kernel thread unwind`

Additionally, rename and mark the `thread_valid()` function
as `__maybe_unused` as it might be unused for architectures
without stackwalk implementation, and use the locked version
of the thread iterator (`k_thread_foreach()`)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-28 14:01:55 -04:00
Hui Bai
c2472e8bae net: l2: wifi: Fix issue command wifi connect fail.
Increase wifi connect input parameters max count to 13. Previous count
7 is not enough if other security type is supported.
When enabling softAP, the parameter cnx_params in cmd_wifi_ap_enable()
is with static key word. Then the parameter will always save
configurations of last time. Remove static keyword to eliminate effects
of configs from last tim and do memset before setting up softAP.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-08-28 06:51:41 -04:00
Hui Bai
86feca37f1 net: l2: wifi: Increase max count of connected STA
Increase max count of CONFIG_WIFI_SHELL_MAX_AP_STA from 5 to 8. The
SoftAP of NXP wifi chip can support up to 8 stations.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-08-28 06:51:41 -04:00
Hui Bai
2cc55bf85e modules: hostap: Add support of setting up softAP with hostapd
Added new flag CONFIG_WIFI_NM_HOSTAPD_AP for hostapd support. Once this
flag is enabled, softAP will be setup by hostapd. Both wpa_supplicant
and hostapd uses same task and eloop.
Included necessary hostapd files when compiling wifi samples if
CONFIG_WIFI_NM_HOSTAPD_AP is enabled. Added hostapd support for all
softAP command of L2 wifi shell commands.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-08-28 06:51:41 -04:00
Daniel Leung
d26b7d4ed1 debug: thread_analyzer: display privileged stack usage
This adds the bits to display privileged stack usage for
architectures that support obtaining this information.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-08-28 06:50:30 -04:00
Daniel Leung
aa65842e95 debug: thread_analyzer: align output
The per-thread output after the first stack usage line is not
aligned which makes it harder to decipher the content.
So align them for easier reading.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-08-28 06:50:30 -04:00
Théo Battrel
9aba9ddd0c Shell: Remove unnecessary new lines at startup
When the shell start, it will print two lines. The reason for that
behavior is not documented. Remove that to make the code simpler and
shorter one line at a time.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-08-27 18:37:28 -04:00
Théo Battrel
e34542a3de Shell: Make full_line_cmd return false on empty lines
The fact that the function was returning `true` for empty line was an
unexpected behavior according to the name of the function itself and how
it was used elsewhere.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-08-27 18:37:28 -04:00
Jordan Yates
6bfd7a4302 sd: resend CMD0 before each CMD8
Resend CMD0 before each CMD8 query while initialising the card, as the
first CMD0 is not always sufficient to recover the card.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-27 15:14:23 -04:00
Emil Gydesen
3e9197a58a Bluetooth: Mesh: Rename mesh test primitives
Since testing.c/h was moved to mesh, all functions and
structs in those files now follow a bt_mesh_test_*
naming scheme to be consistent with the naming in Zephyr.

Due to missing includes in many files, this commit also
added some that were missing in order to build since
the order of includes have changed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-27 15:14:08 -04:00
Emil Gydesen
f1b182b585 Bluetooth: Mesh: Move testing.h to mesh subsys instead of include
The file is only ever used by mesh and it is even stated in the
header of the file that it is internal APIs.

The include file has been merged with the host testing.h file
as that was mesh specific as well. Similarly the testing.c
file was also moved

This is part of a process to clean up the file structure of
Bluetooth as it's a bit messy, which is evident from the
MAINTAINERS.yml file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-27 15:14:08 -04:00
Szymon Janc
77cbd27a80 bluetooth: gatt: Fix ATT Read By Type by DB change unaware client
When change unaware client send ATT request it shall get Database
Out of Sync error. Reading GATT database hash is an exception here.

This was affecting GATT/SR/GAS/BV-05-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-08-27 07:14:59 -04:00
Kapil Bhatt
b9ef207ee1 net: wifi: Display rts threshold in wifi shell
Add a new offload API to get rts threshold and
display to the user in wifi shell.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-08-27 12:45:02 +02:00
Yong Cong Sin
fd1be9849c shell: shell_help: fix width for subcommands help text
The terminal offset for subcommands' help text isn't
computed correctly, fix it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-27 12:44:46 +02:00
Yong Cong Sin
276ccd04e7 shell: devmem: minor optimizations
- Use `SHELL_CMD_ARG_REGISTER` for the main cmd to state the
  required number of arguments, this helps to remove the
  runtime check from the command, and also print the help
  message to the terminal when the argument count is
  unexpected.
- Some changes to the help text that hopefully makes the
  mandatory and optional arguments more obvious to the user

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-27 12:44:46 +02:00
Emil Gydesen
eaf92a1494 tests: Bluetooth: CAP: Initiator unicast start unittests
Adds unittests for the CAP Initiator start procedure, simply
verifying that the procedure works as well as
testing invalid parameters.
This also allows us to remove the invalid behavior checks
from the babblesim test implementation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-26 17:27:36 -04:00