Skip to content

Commit 4be6ae8

Browse files
MarekPietapdunaj
authored andcommitted
applications: nrf_desktop: Fix MCUboot KMU pytest
With the current MCUboot implementation the board must be programmed again, because MCUboot erases application image if running before KMU is provisioned. Jira: NCSDK-31976 Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
1 parent b48525e commit 4be6ae8

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

applications/nrf_desktop/pytest/test_mcuboot_kmu.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,15 @@ def mcuboot_provision(dut: DeviceAdapter):
4949
run_command(command)
5050

5151

52-
def board_reset(dut: DeviceAdapter):
53-
command = ["nrfutil", "device", "reset"]
54-
if dut.device_config.id:
55-
command.extend(["--serial-number", dut.device_config.id])
52+
def board_flash(dut: DeviceAdapter):
53+
build_dir = dut.device_config.build_dir
54+
dev_id = dut.device_config.id
55+
56+
command = ["west", "flash", "--skip-rebuild", "-d", build_dir]
57+
if dev_id:
58+
command.extend(["--dev-id", dev_id])
5659

57-
logger.info("Resetting board")
60+
logger.info("Programming the board")
5861
run_command(command)
5962

6063

@@ -96,8 +99,10 @@ def test_boot(dut: DeviceAdapter):
9699
# nRF Desktop and bootloader images are already programmed at this stage.
97100
mcuboot_provision(dut)
98101

99-
# Clear buffer to ensure proper state and then reset the board to start test.
102+
# Clear buffer to ensure proper state. Then flash and reset the board to start test. The board
103+
# must be programmed again at this point, because MCUboot erases application image if running
104+
# before KMU is provisioned.
100105
dut.clear_buffer()
101-
board_reset(dut)
106+
board_flash(dut)
102107

103108
logs_verify(dut)

0 commit comments

Comments
 (0)