boards: st: Add script to perform power off/power

When flashing STM32N6 in USB-DFU mode, as required when running test
automation using twister, it is first required to power-off/power-on the
board to set board ready for USB-DFU (thanks to specific BootROM
configuration).
Provide a script that performs this operation using STM32CubeProgrammer.
This scipt could be provided in twister map.yaml file on 'pre_script'
property of board entry.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
This commit is contained in:
Erwan Gouriou 2025-01-16 11:55:21 +01:00 committed by Benjamin Cabé
commit 4ea07702b2

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
#
# Copyright (c) 2025 STMicroelectronics
#
# SPDX-License-Identifier: Apache-2.0
STM32_Programmer_CLI -c port=swd mode=UR --power off index=0 --power on index=0 > /dev/null
sleep 1