Add support for additional openocd commands (#1492)
main: add ability to define specific OpenOCD commands to be executed for a target.
Этот коммит содержится в:
родитель
939b393325
коммит
2f4200a01b
3 изменённых файлов: 8 добавлений и 0 удалений
|
@ -303,6 +303,9 @@ 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 != "" {
|
||||
args = append(args, "-c", "transport select "+c.Target.OpenOCDTransport)
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ type TargetSpec struct {
|
|||
OpenOCDInterface string `json:"openocd-interface"`
|
||||
OpenOCDTarget string `json:"openocd-target"`
|
||||
OpenOCDTransport string `json:"openocd-transport"`
|
||||
OpenOCDCommands []string `json:"openocd-commands"`
|
||||
JLinkDevice string `json:"jlink-device"`
|
||||
CodeModel string `json:"code-model"`
|
||||
RelocationModel string `json:"relocation-model"`
|
||||
|
|
4
targets/bluepill-clone.json
Обычный файл
4
targets/bluepill-clone.json
Обычный файл
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"inherits": ["bluepill"],
|
||||
"openocd-commands": ["set CPUTAPID 0x2ba01477"]
|
||||
}
|
Загрузка…
Создание таблицы
Сослаться в новой задаче