Skip to content

samples: bluetooth: central_uart: status LEDs for nRF54LM20 Dongle#27722

Merged
rlubos merged 1 commit into
nrfconnect:mainfrom
Damian-Nordic:nrf54dongle-leds
Mar 30, 2026
Merged

samples: bluetooth: central_uart: status LEDs for nRF54LM20 Dongle#27722
rlubos merged 1 commit into
nrfconnect:mainfrom
Damian-Nordic:nrf54dongle-leds

Conversation

@Damian-Nordic
Copy link
Copy Markdown
Contributor

On nRF54LM20 Dongle, let:

  • green LED indicates BLE connection state and traffic
  • blue LED indicate logging activity.

@Damian-Nordic Damian-Nordic requested review from a team as code owners March 26, 2026 11:54
@NordicBuilder NordicBuilder added the doc-required PR must not be merged without tech writer approval. label Mar 26, 2026
@NordicBuilder
Copy link
Copy Markdown
Contributor

NordicBuilder commented Mar 26, 2026

CI Information

To view the history of this post, click the 'edited' button above
Build number: 6

Inputs:

Sources:

sdk-nrf: PR head: 1213d70c67e8285a17f996c773f1a339039dd2f9

more details

sdk-nrf:

PR head: 1213d70c67e8285a17f996c773f1a339039dd2f9
merge base: 8167d2701fc3e29aeb0881f46cc2d2ff9874624f
target head (main): 6e129075406ae55fd9b825e949853ae1e60aaba8
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (7)
samples
│  ├── bluetooth
│  │  ├── central_uart
│  │  │  ├── CMakeLists.txt
│  │  │  ├── README.rst
│  │  │  ├── boards
│  │  │  │  ├── nrf54lm20dongle_nrf54lm20b_cpuapp.conf
│  │  │  │  │ nrf54lm20dongle_nrf54lm20b_cpuapp.overlay
│  │  │  ├── src
│  │  │  │  ├── leds.c
│  │  │  │  ├── leds.h
│  │  │  │  │ main.c

Outputs:

Toolchain

Version: 911f4c5c26
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:911f4c5c26_5ea73affbf

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister - Skipped: Skipping Build & Test as it succeeded in a previous run: 4
  • ✅ Integration tests
    • ⚠️ test-fw-nrfconnect-ble_samples
Disabled integration tests
    • test-fw-nrfconnect-nrf_lrcs_mosh
    • test-fw-nrfconnect-nrf_lrcs_positioning
    • desktop52_verification
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps-main
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread-main
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

Comment thread samples/bluetooth/central_uart/README.rst Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

@ktaborowski ktaborowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, minor comment below

*/
static const struct gpio_dt_spec log_led =
GPIO_DT_SPEC_GET(DT_CHOSEN(nordic_central_uart_log_led), gpios);
static int log_led_blink_remaining;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: Type inconsistency between this and ble_led_blink_remaining (is uint8_t)

Comment on lines +34 to +35
k_timer_stop(timer);
gpio_pin_set_dt(&ble_led, 1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potential race condition - if leds_set_ble_connected(false) happens between those two, the led stays on, despite the ble is disconnected. I don't know what is the probability of such event (probably very low).
Writing this way it will fix:

gpio_pin_set_dt(&ble_led, ble_connected ? 1 : 0);

Copy link
Copy Markdown
Contributor Author

@Damian-Nordic Damian-Nordic Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I stop the timer in leds_set_ble_connected so I think there's no such a risk, right? Timer handler is executed from ISR, so it cannot be preempted by a thread.

void leds_init(void)
{
if (!gpio_is_ready_dt(&ble_led)) {
return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no log in this module, also all functions in leds.h are void. Please consider some logging on fails.
Readme says nRF54LM20 Dongle The sample uses the CDC ACM interface with index 0 for debug logging

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like me to check all error codes, such as k_timer_stop, k_timer_start and such or are you interested in specific ones?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some logs and asserts here and there.

Copy link
Copy Markdown
Contributor

@LuDuda LuDuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

On nRF54LM20 Dongle, let:
- green LED indicates BLE connection state and traffic
- blue LED indicate logging activity.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
@Damian-Nordic
Copy link
Copy Markdown
Contributor Author

@nordicjm Please review

@Damian-Nordic Damian-Nordic added this to the 3.3.0 milestone Mar 27, 2026
@rlubos rlubos merged commit f5124cb into nrfconnect:main Mar 30, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-required PR must not be merged without tech writer approval. no-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants