From 9ac66f55f2b5ee966567cafa15b85ba35a999985 Mon Sep 17 00:00:00 2001
From: Hristo Mitrev
Date: Sun, 3 Nov 2024 02:33:43 +0200
Subject: [PATCH] stlink: add config for the ISOL variant
---
cross-file/stlink.ini | 1 +
meson_options.txt | 6 ++++++
src/platforms/stlink/meson.build | 5 +++++
3 files changed, 12 insertions(+)
diff --git a/cross-file/stlink.ini b/cross-file/stlink.ini
index 6c46f8a9e79..04a1f5cf079 100644
--- a/cross-file/stlink.ini
+++ b/cross-file/stlink.ini
@@ -23,3 +23,4 @@ targets = 'cortexm,lpc,nrf,nxp,renesas,sam,stm,ti'
rtt_support = false
stlink_swim_nrst_as_uart = false
bmd_bootloader = false
+stlink_v2_isol = false
diff --git a/meson_options.txt b/meson_options.txt
index 337f1c3db10..612c2f53ec9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -86,6 +86,12 @@ option(
value: true,
description: 'Use the BMD bootloader (not always applicable)'
)
+option(
+ 'stlink_v2_isol',
+ type: 'boolean',
+ value: false,
+ description: 'Build for the ISOL variant of ST-Link v2'
+)
option(
'stlink_swim_nrst_as_uart',
type: 'boolean',
diff --git a/src/platforms/stlink/meson.build b/src/platforms/stlink/meson.build
index ab8b3529796..c503cdae290 100644
--- a/src/platforms/stlink/meson.build
+++ b/src/platforms/stlink/meson.build
@@ -40,6 +40,8 @@ probe_stlink_dfu_sources = files(
'usbdfu.c',
)
+stlink_v2_isol = get_option('stlink_v2_isol')
+
bmd_bootloader = get_option('bmd_bootloader')
probe_stlink_dfu_serial_length = bmd_bootloader ? '9' : '25'
@@ -48,6 +50,9 @@ probe_stlink_load_address = bmd_bootloader ? '0x8002000' : '0x8004000'
probe_stlink_args = [
f'-DDFU_SERIAL_LENGTH=@probe_stlink_dfu_serial_length@',
]
+if stlink_v2_isol
+ probe_stlink_args += ['-DSTLINK_V2_ISOL']
+endif
if not bmd_bootloader
probe_stlink_args += ['-DST_BOOTLOADER']
endif