Browse Source

flash: add openocd-verify

pull/2471/head
sago35 3 years ago
committed by Ron Evans
parent
commit
09a3c6a16b
  1. 1
      compileopts/target.go
  2. 6
      main.go
  3. 3
      targets/wioterminal.json

1
compileopts/target.go

@ -59,6 +59,7 @@ type TargetSpec struct {
OpenOCDTarget string `json:"openocd-target"`
OpenOCDTransport string `json:"openocd-transport"`
OpenOCDCommands []string `json:"openocd-commands"`
OpenOCDVerify *bool `json:"openocd-verify"` // enable verify when flashing with openocd
JLinkDevice string `json:"jlink-device"`
CodeModel string `json:"code-model"`
RelocationModel string `json:"relocation-model"`

6
main.go

@ -453,7 +453,11 @@ func Flash(pkgName, port string, options *compileopts.Options) error {
if err != nil {
return err
}
args = append(args, "-c", "program "+filepath.ToSlash(result.Binary)+" reset exit")
exit := " reset exit"
if config.Target.OpenOCDVerify != nil && *config.Target.OpenOCDVerify {
exit = " verify" + exit
}
args = append(args, "-c", "program "+filepath.ToSlash(result.Binary)+exit)
cmd := executeCommand(config.Options, "openocd", args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

3
targets/wioterminal.json

@ -6,5 +6,6 @@
"flash-1200-bps-reset": "true",
"flash-method": "msd",
"msd-volume-name": "Arduino",
"msd-firmware-name": "firmware.uf2"
"msd-firmware-name": "firmware.uf2",
"openocd-verify": true
}

Loading…
Cancel
Save