From 712275572554d0ba8ee85e722fef8d6c91d6531a Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 9 Mar 2024 11:36:57 +0000 Subject: compileopts: apply OpenOCD commands after target configuration The openocd-commands option cannot refer to commands defined by the target configuration. Lift this restriction by moving the commands to after target loading. --- compileopts/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compileopts') diff --git a/compileopts/config.go b/compileopts/config.go index e3f67b11a..98dd30738 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -479,9 +479,6 @@ func (c *Config) OpenOCDConfiguration() (args []string, err error) { return nil, fmt.Errorf("unknown OpenOCD transport: %#v", c.Target.OpenOCDTransport) } args = []string{"-f", "interface/" + openocdInterface + ".cfg"} - for _, cmd := range c.Target.OpenOCDCommands { - args = append(args, "-c", cmd) - } if c.Target.OpenOCDTransport != "" { transport := c.Target.OpenOCDTransport if transport == "swd" { @@ -493,6 +490,9 @@ func (c *Config) OpenOCDConfiguration() (args []string, err error) { args = append(args, "-c", "transport select "+transport) } args = append(args, "-f", "target/"+c.Target.OpenOCDTarget+".cfg") + for _, cmd := range c.Target.OpenOCDCommands { + args = append(args, "-c", cmd) + } return args, nil } -- cgit v1.2.3