From 4b2d19f14731a31d730b2814f1324c6fabb03f11 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 4 Mar 2024 11:00:00 +0000 Subject: [PATCH] soc: nordic: Add run once and deferred reset configuration Adds configuration that allows nRF53 and nRF91-based boards to be flashed through west using sysbuild for multiple images with the recover or erase options and prevent running those commands for each image being flash, which would make the device unbootable. Also defers reset whilst all images for the cores of these SoCs are flashed. Signed-off-by: Jamie McCrae --- soc/nordic/soc.yml | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/soc/nordic/soc.yml b/soc/nordic/soc.yml index 9ff68b9b70..d3400f7846 100644 --- a/soc/nordic/soc.yml +++ b/soc/nordic/soc.yml @@ -38,3 +38,62 @@ family: - name: nrf9151 - name: nrf9160 - name: nrf9161 + +# Recovery/erase is only needed once per core. Prevent resetting the cores whilst flashing +# multiple images until all images for each core have been flashed, this allows security +# bits to be set during programming without them interfering with additional flashing +# operations. +runners: + run_once: + '--recover': + - runners: + - nrfjprog + run: first + groups: + - qualifiers: + - nrf51([0-9]{3})((.+)?) + - qualifiers: + - nrf52([0-9]{3})((.+)?) + - qualifiers: + - nrf5340/cpunet + - nrf5340/cpuapp + - nrf5340/cpuapp/ns + - qualifiers: + - nrf9160 + - nrf9160/ns + '--erase': + - runners: + - nrfjprog + - jlink + run: first + groups: + - qualifiers: + - nrf51([0-9]{3})((.+)?) + - qualifiers: + - nrf52([0-9]{3})((.+)?) + - qualifiers: + - nrf5340/cpunet + - qualifiers: + - nrf5340/cpuapp + - nrf5340/cpuapp/ns + - qualifiers: + - nrf9160 + - nrf9160/ns + '--reset': + - runners: + - nrfjprog + - jlink + run: last + groups: + - qualifiers: + - nrf51([0-9]{3})((.+)?) + - qualifiers: + - nrf52([0-9]{3})((.+)?) + - qualifiers: + - nrf5340/cpunet + - qualifiers: + - nrf5340/cpuapp + - nrf5340/cpuapp/ns + - qualifiers: + - nrf9160 + - nrf9160/ns