Skip to content

Commit

Permalink
samples: subsys: usb: hid-keyboard: Add sysbuild
Browse files Browse the repository at this point in the history
Hack in sysbuild to load an empty network core image to properly
iniatialize power domains and clocks.

Signed-off-by: Karsten Koenig <[email protected]>
  • Loading branch information
karstenkoenig committed Dec 17, 2024
1 parent 1f8f3dc commit ca13ceb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions samples/subsys/usb/hid-keyboard/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"

config REMOTE_BOARD
string "The board used for remote target"
3 changes: 3 additions & 0 deletions samples/subsys/usb/hid-keyboard/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sample:
name: USB HID keyboard sample
common:
sysbuild: true
harness: button
filter: dt_alias_exists("sw0") and dt_alias_exists("led0")
depends_on:
Expand All @@ -17,6 +18,8 @@ common:
tests:
sample.usbd.hid-keyboard:
tags: usb
extra_args:
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf
sample.usbd.hid-keyboard.out-report:
tags: usb
extra_args:
Expand Down
22 changes: 22 additions & 0 deletions samples/subsys/usb/hid-keyboard/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "")
message(FATAL_ERROR "REMOTE_BOARD must be set to a valid board name")
endif()

# Add remote project
ExternalZephyrProject_Add(
APPLICATION remote
SOURCE_DIR ${SYSBUILD_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever
BOARD ${SB_CONFIG_REMOTE_BOARD}
BOARD_REVISION ${BOARD_REVISION}
)

# Add a dependency so that the remote image will be built and flashed first
add_dependencies(hid-keyboard remote)
# Add dependency so that the remote image is flashed first.
sysbuild_add_dependencies(FLASH hid-keyboard remote)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad"

0 comments on commit ca13ceb

Please sign in to comment.