diff options
author | Elias Naur <[email protected]> | 2024-03-09 11:36:57 +0000 |
---|---|---|
committer | Ron Evans <[email protected]> | 2024-04-17 21:54:38 +0200 |
commit | 712275572554d0ba8ee85e722fef8d6c91d6531a (patch) | |
tree | 112917c20f4c4fec09a551d83f95e54d0e941355 /compileopts | |
parent | dcee228c4e29af5c06112f0ccc093c8f6483d64f (diff) | |
download | tinygo-712275572554d0ba8ee85e722fef8d6c91d6531a.tar.gz tinygo-712275572554d0ba8ee85e722fef8d6c91d6531a.zip |
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.
Diffstat (limited to 'compileopts')
-rw-r--r-- | compileopts/config.go | 6 |
1 files changed, 3 insertions, 3 deletions
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 } |