SDK: Better support for cmsis-dap --nobuild

This commit is contained in:
Willy-JL
2025-04-23 06:40:45 +01:00
parent bc4bf99f77
commit 4d247f276c
3 changed files with 16 additions and 9 deletions

View File

@@ -222,7 +222,7 @@ distenv.Depends(firmware_flash, enable_debug_target)
firmware_jflash = distenv.AddJFlashTarget(firmware_env)
distenv.Alias("jflash", firmware_jflash)
distenv.PhonyTarget(
gdb_trace_all_target = distenv.PhonyTarget(
"gdb_trace_all",
[["${GDB}", "${GDBOPTS}", "${SOURCES}", "${GDBFLASH}"]],
source=firmware_env["FW_ELF"],
@@ -235,6 +235,7 @@ distenv.PhonyTarget(
"quit",
],
)
distenv.Depends(gdb_trace_all_target, enable_debug_target)
# Debugging firmware
firmware_debug = distenv.PhonyTarget(
@@ -245,7 +246,7 @@ firmware_debug = distenv.PhonyTarget(
GDBREMOTE="${OPENOCD_GDB_PIPE}",
FBT_FAP_DEBUG_ELF_ROOT=firmware_env["FBT_FAP_DEBUG_ELF_ROOT"],
)
distenv.Depends(firmware_debug, firmware_flash)
distenv.Depends(firmware_debug, enable_debug_target)
firmware_blackmagic = distenv.PhonyTarget(
"blackmagic",
@@ -269,21 +270,23 @@ debug_other_opts = [
"fw-version",
]
distenv.PhonyTarget(
debug_other_target = distenv.PhonyTarget(
"debug_other",
"${GDBPYCOM}",
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
GDBPYOPTS=debug_other_opts,
)
distenv.Depends(debug_other_target, enable_debug_target)
distenv.PhonyTarget(
debug_other_blackmagic_target = distenv.PhonyTarget(
"debug_other_blackmagic",
"${GDBPYCOM}",
GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
GDBREMOTE="${BLACKMAGIC_ADDR}",
GDBPYOPTS=debug_other_opts,
)
distenv.Depends(debug_other_blackmagic_target, enable_debug_target)
# Just start OpenOCD
@@ -467,13 +470,14 @@ distenv.Depends(get_blackmagic_target, enable_debug_target)
# Find STLink probe ids
distenv.PhonyTarget(
get_stlink_target = distenv.PhonyTarget(
"get_stlink",
distenv.Action(
lambda **_: distenv.GetDevices(),
None,
),
)
distenv.Depends(get_stlink_target, enable_debug_target)
# Prepare vscode environment
vscode_dist = distenv.Install(

View File

@@ -73,9 +73,9 @@ FBT_TOOLCHAIN_VERSIONS = (" 12.3.", " 13.2.")
OPENOCD_OPTS = [
"-f",
"interface/stlink.cfg",
"interface/cmsis-dap.cfg",
"-c",
"transport select hla_swd",
"transport select swd",
"-f",
"${FBT_DEBUG_DIR}/stm32wbx.cfg",
"-c",

View File

@@ -177,6 +177,7 @@ firmware_debug = dist_env.PhonyTarget(
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
)
dist_env.Depends(firmware_debug, enable_debug_target)
blackmagic_target = dist_env.PhonyTarget(
"blackmagic",
@@ -197,21 +198,23 @@ debug_other_opts = [
"fw-version",
]
dist_env.PhonyTarget(
debug_other_target = dist_env.PhonyTarget(
"debug_other",
"${GDBPYCOM}",
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
GDBPYOPTS=debug_other_opts,
)
dist_env.Depends(debug_other_target, enable_debug_target)
dist_env.PhonyTarget(
debug_other_blackmagic_target = dist_env.PhonyTarget(
"debug_other_blackmagic",
"${GDBPYCOM}",
GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
GDBREMOTE="${BLACKMAGIC_ADDR}",
GDBPYOPTS=debug_other_opts,
)
dist_env.Depends(debug_other_blackmagic_target, enable_debug_target)
flash_usb_full = dist_env.UsbInstall(
dist_env["UFBT_STATE_DIR"].File("usbinstall"),