From f5fc2fc07289db1d5a4b0fe097eb9ab7c2de3962 Mon Sep 17 00:00:00 2001 From: sago35 Date: Fri, 19 Aug 2022 08:56:40 +0900 Subject: main: add support for stlink-dap programmer --- compileopts/config.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'compileopts/config.go') diff --git a/compileopts/config.go b/compileopts/config.go index 7cf2f766a..9ee6d0aa3 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -457,7 +457,14 @@ func (c *Config) OpenOCDConfiguration() (args []string, err error) { args = append(args, "-c", cmd) } if c.Target.OpenOCDTransport != "" { - args = append(args, "-c", "transport select "+c.Target.OpenOCDTransport) + transport := c.Target.OpenOCDTransport + if transport == "swd" { + switch openocdInterface { + case "stlink-dap": + transport = "dapdirect_swd" + } + } + args = append(args, "-c", "transport select "+transport) } args = append(args, "-f", "target/"+c.Target.OpenOCDTarget+".cfg") return args, nil -- cgit v1.2.3