mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 15:33:40 +00:00
main: change to ignore PortReset failures
This commit is contained in:
@@ -350,16 +350,14 @@ func Flash(pkgName, port string, options *compileopts.Options) error {
|
|||||||
// do we need port reset to put MCU into bootloader mode?
|
// do we need port reset to put MCU into bootloader mode?
|
||||||
if config.Target.PortReset == "true" && flashMethod != "openocd" {
|
if config.Target.PortReset == "true" && flashMethod != "openocd" {
|
||||||
port, err := getDefaultPort(port, config.Target.SerialPort)
|
port, err := getDefaultPort(port, config.Target.SerialPort)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
return err
|
err = touchSerialPortAt1200bps(port)
|
||||||
|
if err != nil {
|
||||||
|
return &commandError{"failed to reset port", result.Binary, err}
|
||||||
|
}
|
||||||
|
// give the target MCU a chance to restart into bootloader
|
||||||
|
time.Sleep(3 * time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = touchSerialPortAt1200bps(port)
|
|
||||||
if err != nil {
|
|
||||||
return &commandError{"failed to reset port", result.Binary, err}
|
|
||||||
}
|
|
||||||
// give the target MCU a chance to restart into bootloader
|
|
||||||
time.Sleep(3 * time.Second)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this flashing method copies the binary data to a Mass Storage Device (msd)
|
// this flashing method copies the binary data to a Mass Storage Device (msd)
|
||||||
|
|||||||
Reference in New Issue
Block a user