aboutsummaryrefslogtreecommitdiffhomepage
path: root/compileopts
diff options
context:
space:
mode:
authorsago35 <[email protected]>2022-08-19 08:56:40 +0900
committerAyke <[email protected]>2022-09-14 14:58:31 +0200
commitf5fc2fc07289db1d5a4b0fe097eb9ab7c2de3962 (patch)
treebd252ab0838a9bec4cec4b2e7e27cd5849b0e949 /compileopts
parent4ba76a5df9f4cf7c12893f6303192902d56d3925 (diff)
downloadtinygo-f5fc2fc07289db1d5a4b0fe097eb9ab7c2de3962.tar.gz
tinygo-f5fc2fc07289db1d5a4b0fe097eb9ab7c2de3962.zip
main: add support for stlink-dap programmer
Diffstat (limited to 'compileopts')
-rw-r--r--compileopts/config.go9
1 files changed, 8 insertions, 1 deletions
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