esp32: support flashing directly from tinygo

Right now this requires setting the -port parameter, but other than that
it totally works (if esptool.py is installed). It works by converting
the ELF file to the custom ESP32 image format and flashing that using
esptool.py.
This commit is contained in:
Ayke van Laethem
2020-08-28 15:58:30 +02:00
committed by Ron Evans
parent 9a17698d6a
commit 0df4a7a35f
4 changed files with 139 additions and 2 deletions
+7
View File
@@ -279,6 +279,13 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(stri
if err != nil {
return err
}
case "esp32":
// Special format for the ESP32 chip (parsed by the ROM bootloader).
tmppath = filepath.Join(dir, "main"+outext)
err := makeESP32FirmareImage(executable, tmppath)
if err != nil {
return err
}
default:
return fmt.Errorf("unknown output binary format: %s", outputBinaryFormat)
}