Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applications: nrf_desktop: Add nRF54L10/nRF54L05 support #20000

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions applications/nrf_desktop/board_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,48 @@ Sample dongle (``nrf5340dk/nrf5340``)
Input data comes from Bluetooth and is retransmitted to USB.
* The configuration with the B0 bootloader is set as default.

Sample mouse or keyboard (``nrf54l15dk/nrf54l05/cpuapp``)
* The configuration emulates the nRF54L05 SoC on the nRF54L15 Development Kit.
* The build types allow to build the application as a mouse or a keyboard.
* Inputs are simulated based on the hardware button presses.
* On the nRF54L05 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output.
Because of that, on the DK PCA10156 revision v0.8.1, **LED 0** and **LED 2** cannot be used for PWM output.
You can still use these LEDs with the PWM LED driver, but you must set the LED color to ``LED_COLOR(255, 255, 255)`` or ``LED_COLOR(0, 0, 0)``.
This ensures the PWM peripheral is not used for the mentioned LEDs.
* Only Bluetooth LE transport is enabled.
Bluetooth LE is configured to use Nordic Semiconductor's SoftDevice Link Layer and Low Latency Packet Mode (LLPM).
* The preconfigured ``debug`` configuration does not use the bootloader due to memory size limits.
In the ``debug`` configuration, logs are provided through the UART.
For detailed information on working with the nRF54L15 DK, see the :ref:`ug_nrf54l15_gs` documentation.
* The preconfigured ``release`` configurations use the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``) and support firmware updates using the :ref:`nrf_desktop_dfu`.
All of the ``release`` configurations enable hardware cryptography for the MCUboot bootloader.
The application image is verified using a pure ED25519 signature.
The public key that MCUboot uses for validating the application image is securely stored in the hardware Key Management Unit (KMU).
For more details on nRF54L Series cryptography, see :ref:`ug_nrf54l_cryptography`.
* The board supports the ``release`` :ref:`nrf_desktop_bluetooth_guide_fast_pair` configuration that acts as a mouse (``release_fast_pair`` file suffix).

Sample mouse or keyboard (``nrf54l15dk/nrf54l10/cpuapp``)
* The configuration emulates the nRF54L10 SoC on the nRF54L15 Development Kit.
* The build types allow to build the application as a mouse or a keyboard.
* Inputs are simulated based on the hardware button presses.
* On the nRF54L10 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output.
Because of that, on the DK PCA10156 revision v0.8.1, **LED 0** and **LED 2** cannot be used for PWM output.
You can still use these LEDs with the PWM LED driver, but you must set the LED color to ``LED_COLOR(255, 255, 255)`` or ``LED_COLOR(0, 0, 0)``.
This ensures the PWM peripheral is not used for the mentioned LEDs.
* Only Bluetooth LE transport is enabled.
Bluetooth LE is configured to use Nordic Semiconductor's SoftDevice Link Layer and Low Latency Packet Mode (LLPM).
* In ``debug`` configurations, logs are provided through the UART.
For detailed information on working with the nRF54L15 DK, see the :ref:`ug_nrf54l15_gs` documentation.
* The configurations use the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``) and support firmware updates using the :ref:`nrf_desktop_dfu`.
All of the configurations enable hardware cryptography for the MCUboot bootloader.
The application image is verified using a pure ED25519 signature.
The public key that MCUboot uses for validating the application image is securely stored in the hardware Key Management Unit (KMU).
For more details on nRF54L Series cryptography, see :ref:`ug_nrf54l_cryptography`.
* The board supports the ``debug`` :ref:`nrf_desktop_bluetooth_guide_fast_pair` configuration that acts as a mouse (``fast_pair`` file suffix).
The configuration uses the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``), and supports firmware updates using the :ref:`nrf_desktop_dfu` and :ref:`nrf_desktop_dfu_mcumgr`.

Sample mouse or keyboard (``nrf54l15dk/nrf54l15/cpuapp``)
* The configuration uses the nRF54L15 Development Kit (DK).
* The configuration uses the nRF54L15 Development Kit.
* The build types allow to build the application as a mouse or a keyboard.
* Inputs are simulated based on the hardware button presses.
* On the nRF54L15 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output.
Expand All @@ -113,7 +153,7 @@ Sample mouse or keyboard (``nrf54l15dk/nrf54l15/cpuapp``)
This ensures the PWM peripheral is not used for the mentioned LEDs.
* Only Bluetooth LE transport is enabled.
Bluetooth LE is configured to use Nordic Semiconductor's SoftDevice Link Layer and Low Latency Packet Mode (LLPM).
* In debug configurations, logs are provided through the UART.
* In ``debug`` configurations, logs are provided through the UART.
For detailed information on working with the nRF54L15 DK, see the :ref:`ug_nrf54l15_gs` documentation.
* The configurations use the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``) and support firmware updates using the :ref:`nrf_desktop_dfu`.
All of the configurations enable hardware cryptography for the MCUboot bootloader.
Expand All @@ -130,6 +170,6 @@ Sample mouse (``nrf54h20dk/nrf54h20/cpuapp``)
* Bluetooth LE and USB High-Speed transports are enabled.
Bluetooth LE is configured to use Nordic Semiconductor's SoftDevice Link Layer and Low Latency Packet Mode (LLPM).
USB High-Speed is configured to use the USB next stack (:kconfig:option:`CONFIG_USB_DEVICE_STACK_NEXT`).
* In debug configurations, logs are provided through the UART.
* In ``debug`` configurations, logs are provided through the UART.
For detailed information on working with the nRF54H20 DK, see the :ref:`ug_nrf54h20_gs` documentation.
* The configurations use the Software Updates for Internet of Things (SUIT) and supports firmware updates using the :ref:`nrf_desktop_dfu` and :ref:`nrf_desktop_smp`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include "app_common.dtsi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/* Application does not use cpuflpr core. Assign whole RRAM to cpuapp. */
&cpuapp_rram {
reg = < 0x0 DT_SIZE_K(500) >;
};

/ {
/* Disable pwmleds and redefine them to align configuration with CAF LEDs requirements.
* The configuration needs to match the used board revision.
*/
/delete-node/ pwmleds;

pwmleds0 {
compatible = "pwm-leds";
status = "okay";

pwm_led0: led_pwm_0 {
status = "okay";
pwms = <&pwm20 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "LED System State";
};
};

pwmleds1 {
compatible = "pwm-leds";
status = "okay";

pwm_led1: led_pwm_1 {
status = "okay";
pwms = <&pwm21 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "LED Conn State";
};
};

pwmleds2 {
compatible = "pwm-leds";
status = "okay";

pwm_led2: led_pwm_2 {
status = "okay";
pwms = <&pwm22 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "LED Num Lock";
};
};
};

&pwm20 {
status = "okay";
pinctrl-0 = <&pwm20_default_alt>;
pinctrl-1 = <&pwm20_sleep_alt>;
pinctrl-names = "default", "sleep";
};

&pwm21 {
status = "okay";
pinctrl-0 = <&pwm21_default_alt>;
pinctrl-1 = <&pwm21_sleep_alt>;
pinctrl-names = "default", "sleep";
};

&pwm22 {
status = "okay";
pinctrl-0 = <&pwm22_default_alt>;
pinctrl-1 = <&pwm22_sleep_alt>;
pinctrl-names = "default", "sleep";
};

&pinctrl {
pwm20_default_alt: pwm20_default_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 2, 9)>;
};
};

pwm20_sleep_alt: pwm20_sleep_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 2, 9)>;
low-power-enable;
};
};

pwm21_default_alt: pwm21_default_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
};
};

pwm21_sleep_alt: pwm21_sleep_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
low-power-enable;
};
};

pwm22_default_alt: pwm22_default_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 2, 7)>;
};
};

pwm22_sleep_alt: pwm22_sleep_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 2, 7)>;
low-power-enable;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include "app_common.dtsi"

/* For nRF54L, watchdog status is disabled by default. Needs to be enabled in DTS overlay. */
&wdt31 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include "app_common.dtsi"

/* For nRF54L, watchdog status is disabled by default. Needs to be enabled in DTS overlay. */
&wdt31 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include "app_common.dtsi"

/* For nRF54L, watchdog status is disabled by default. Needs to be enabled in DTS overlay. */
&wdt31 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <caf/gpio_pins.h>

/* This configuration file is included only once from button module and holds
* information about pins forming keyboard matrix.
*/

/* This structure enforces the header file is included only once in the build.
* Violating this requirement triggers a multiple definition error at link time.
*/
const struct {} buttons_def_include_once;

static const struct gpio_pin col[] = {};

static const struct gpio_pin row[] = {
{ .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button0), gpios) },
{ .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button1), gpios) },
{ .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button2), gpios) },
{ .port = 0, .pin = DT_GPIO_PIN(DT_NODELABEL(button3), gpios) },
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <caf/key_id.h>

/* This configuration file is included only once from buttons_sim module
* and holds information about generated button presses sequence.
*/

/* This structure enforces the header file is included only once in the build.
* Violating this requirement triggers a multiple definition error at link time.
*/
const struct {} buttons_sim_def_include_once;

const static uint16_t simulated_key_sequence[] = {
KEY_ID(0x00, 0x11), /* N */
KEY_ID(0x00, 0x12), /* O */
KEY_ID(0x00, 0x15), /* R */
KEY_ID(0x00, 0x07), /* D */
KEY_ID(0x00, 0x0C), /* I */
KEY_ID(0x00, 0x06), /* C */
KEY_ID(0x00, 0x2C), /* spacebar */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <caf/click_detector.h>

/* This configuration file is included only once from click_detector module
* and holds information about click detector configuration.
*/

/* This structure enforces the header file is included only once in the build.
* Violating this requirement triggers a multiple definition error at link time.
*/
const struct {} click_detector_def_include_once;

static const struct click_detector_config click_detector_config[] = {
#if CONFIG_DESKTOP_BLE_PEER_CONTROL
{
.key_id = CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON,
.consume_button_event = false,
},
#endif /* CONFIG_DESKTOP_BLE_PEER_CONTROL */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include "hid_keyboard_leds.h"

/* This configuration file is included only once from hid_state module and holds
* information about LEDs associated with HID keyboard LEDs report.
*/

/* This structure enforces the header file is included only once in the build.
* Violating this requirement triggers a multiple definition error at link time.
*/
const struct {} hid_keyboard_leds_def_include_once;

static const struct led_effect keyboard_led_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255));
static const struct led_effect keyboard_led_off = LED_EFFECT_LED_OFF();

/* Map HID keyboard LEDs to application LED IDs. */
static const uint8_t keyboard_led_map[] = {
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include "hid_keyboard_leds.h"

/* This configuration file is included only once from hid_state module and holds
* information about LEDs associated with HID keyboard LEDs report.
*/

/* This structure enforces the header file is included only once in the build.
* Violating this requirement triggers a multiple definition error at link time.
*/
const struct {} hid_keyboard_leds_def_include_once;

/* On the nRF54L05 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output.
* Because of that, on the DK PCA10156 revision v0.8.1, **LED 0** and **LED 2** cannot be used for
* PWM output.
*
* You can still use these LEDs with the PWM LED driver, but you must set the LED color to
* `LED_COLOR(255, 255, 255)` or `LED_COLOR(0, 0, 0)`. This ensures the PWM peripheral is not
* used for the mentioned LEDs.
*/
static const struct led_effect keyboard_led_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255));
static const struct led_effect keyboard_led_off = LED_EFFECT_LED_OFF();

/* Map HID keyboard LEDs to application LED IDs. */
static const uint8_t keyboard_led_map[] = {
[HID_KEYBOARD_LEDS_NUM_LOCK] = 2,
[HID_KEYBOARD_LEDS_CAPS_LOCK] = LED_UNAVAILABLE,
[HID_KEYBOARD_LEDS_SCROLL_LOCK] = LED_UNAVAILABLE,
[HID_KEYBOARD_LEDS_COMPOSE] = LED_UNAVAILABLE,
[HID_KEYBOARD_LEDS_KANA] = LED_UNAVAILABLE,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include "hid_keymap.h"
#include <caf/key_id.h>

/* This configuration file is included only once from hid_state module and holds
* information about mapping between buttons and generated reports.
*/

/* This structure enforces the header file is included only once in the build.
* Violating this requirement triggers a multiple definition error at link time.
*/
const struct {} hid_keymap_def_include_once;

/*
* HID keymap. The Consumer Control keys are defined in section 15 of
* the HID Usage Tables document under the following URL:
* https://www.usb.org/sites/default/files/hut1_12.pdf
*/
static const struct hid_keymap hid_keymap[] = {
/* Intentionally left empty. nRF54L DK by default uses all buttons only to control
* generating motion.
*/
};
Loading