From 2b3b870bfe63ab0b8e866df3ceef9e0c8a6e6c56 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 9 Mar 2024 11:41:45 +0000 Subject: [PATCH] mksnanov3: limit programming speed to 1800 kHz Both of my development boards exhibit stability problems when programming at the default 4000 kHz speed of the target/stmf32d4x OpenOCD configuration. Note that the speed limit must be set by an event handler, because it is hard-coded by a similar event handler in stmf32f4x.cfg: $_TARGETNAME configure -event reset-init { # Configure PLL to boost clock to HSI x 4 (64 MHz) ... # Boost JTAG frequency adapter speed 8000 <-- resolves to 4000 kHz by the SWD interface } While here, replace the reference to the deprecated "stlink-v2" configuration. --- targets/mksnanov3.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/targets/mksnanov3.json b/targets/mksnanov3.json index 9b202d3ab..fc57a71d9 100644 --- a/targets/mksnanov3.json +++ b/targets/mksnanov3.json @@ -7,6 +7,7 @@ "src/device/stm32/stm32f407.s" ], "flash-method": "openocd", - "openocd-interface": "stlink-v2", - "openocd-target": "stm32f4x" + "openocd-interface": "stlink", + "openocd-target": "stm32f4x", + "openocd-commands": ["stm32f4x.cpu configure -event reset-init { adapter speed 1800 }"] }