Commit ec44ad12 authored by Cristian Maglie's avatar Cristian Maglie Committed by umbynos

Added external programmer support (#720)

* Added scaffolding for external programmer support

* Added programmers extraction in arduino/cores module

* Implemented programmers list command

* Print upload command line in verbose mode

* Added programmer option to compile command

* External programmer implementation

* Factored function runTool in upload

This will turn out useful for burn-bootloader that requires to run
two actions in a row ("erase" and "bootloader").

* Implemented burn-bootloader

* Increased tracing log

* Test fix

* Added BurnBootloder action

* Make the upload port parameter mandatory only when really needed

* Fixed nil pointer exception when burning-bootloader

* Added sanity check on upload parameters
parent 4a5330ae
......@@ -40,14 +40,14 @@ type PlatformRelease struct {
Resource *resources.DownloadResource
Version *semver.Version
BoardsManifest []*BoardManifest
Dependencies ToolDependencies // The Dependency entries to load tools.
Platform *Platform `json:"-"`
Properties *properties.Map `json:"-"`
Boards map[string]*Board `json:"-"`
Programmers map[string]*properties.Map `json:"-"`
Menus *properties.Map `json:"-"`
InstallDir *paths.Path `json:"-"`
IsIDEBundled bool `json:"-"`
Dependencies ToolDependencies // The Dependency entries to load tools.
Platform *Platform `json:"-"`
Properties *properties.Map `json:"-"`
Boards map[string]*Board `json:"-"`
Programmers map[string]*Programmer `json:"-"`
Menus *properties.Map `json:"-"`
InstallDir *paths.Path `json:"-"`
IsIDEBundled bool `json:"-"`
}
// BoardManifest contains information about a board. These metadata are usually
......@@ -117,7 +117,7 @@ func (platform *Platform) GetOrCreateRelease(version *semver.Version) (*Platform
Version: version,
Boards: map[string]*Board{},
Properties: properties.NewMap(),
Programmers: map[string]*properties.Map{},
Programmers: map[string]*Programmer{},
Platform: platform,
}
platform.Releases[tag] = release
......
......@@ -284,10 +284,10 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p
// Create programmers properties
if programmersProperties, err := properties.SafeLoad(programmersTxtPath.String()); err == nil {
platform.Programmers = properties.MergeMapsOfProperties(
map[string]*properties.Map{},
platform.Programmers, // TODO: Very weird, why not an empty one?
programmersProperties.FirstLevelOf())
for programmerID, programmerProperties := range programmersProperties.FirstLevelOf() {
platform.Programmers[programmerID] = pm.loadProgrammer(programmerProperties)
platform.Programmers[programmerID].PlatformRelease = platform
}
} else {
return err
}
......@@ -299,6 +299,13 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p
return nil
}
func (pm *PackageManager) loadProgrammer(programmerProperties *properties.Map) *cores.Programmer {
return &cores.Programmer{
Name: programmerProperties.Get("name"),
Properties: programmerProperties,
}
}
func (pm *PackageManager) loadBoards(platform *cores.PlatformRelease) error {
if platform.InstallDir == nil {
return fmt.Errorf("platform not installed")
......
// This file is part of arduino-cli.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.
package cores
import "github.com/arduino/go-properties-orderedmap"
// Programmer represents an external programmer
type Programmer struct {
Name string
Properties *properties.Map
PlatformRelease *PlatformRelease
}
// This file is part of arduino-cli.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.
package burnbootloader
import (
"context"
"os"
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/cli/instance"
"github.com/arduino/arduino-cli/commands/upload"
rpc "github.com/arduino/arduino-cli/rpc/commands"
"github.com/arduino/arduino-cli/table"
"github.com/arduino/go-paths-helper"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
var (
fqbn string
port string
verbose bool
verify bool
importDir string
programmer string
burnBootloader bool
)
// NewCommand created a new `burn-bootloader` command
func NewCommand() *cobra.Command {
burnBootloaderCommand := &cobra.Command{
Use: "burn-bootloader",
Short: "Upload the bootloader.",
Long: "Upload the bootloader on the board using an external programmer.",
Example: " " + os.Args[0] + " burn-bootloader -b arduino:avr:uno -P atmel-ice",
Args: cobra.MaximumNArgs(1),
Run: run,
}
burnBootloaderCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno")
burnBootloaderCommand.Flags().StringVarP(&port, "port", "p", "", "Upload port, e.g.: COM10 or /dev/ttyACM0")
burnBootloaderCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.")
burnBootloaderCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Turns on verbose mode.")
burnBootloaderCommand.Flags().StringVarP(&programmer, "programmer", "P", "", "Use the specified programmer to upload or 'list' to list supported programmers.")
return burnBootloaderCommand
}
func run(command *cobra.Command, args []string) {
instance, err := instance.CreateInstance()
if err != nil {
feedback.Errorf("Error during Upload: %v", err)
os.Exit(errorcodes.ErrGeneric)
}
if programmer == "list" {
resp, err := upload.ListProgrammersAvailableForUpload(context.Background(), &rpc.ListProgrammersAvailableForUploadReq{
Instance: instance,
Fqbn: fqbn,
})
if err != nil {
feedback.Errorf("Error listing programmers: %v", err)
os.Exit(errorcodes.ErrGeneric)
}
feedback.PrintResult(&programmersList{
Programmers: resp.GetProgrammers(),
})
os.Exit(0)
}
if _, err := upload.BurnBootloader(context.Background(), &rpc.BurnBootloaderReq{
Instance: instance,
Fqbn: fqbn,
Port: port,
Verbose: verbose,
Verify: verify,
Programmer: programmer,
}, os.Stdout, os.Stderr); err != nil {
feedback.Errorf("Error during Upload: %v", err)
os.Exit(errorcodes.ErrGeneric)
}
os.Exit(0)
}
// initSketchPath returns the current working directory
func initSketchPath(sketchPath *paths.Path) *paths.Path {
if sketchPath != nil {
return sketchPath
}
wd, err := paths.Getwd()
if err != nil {
feedback.Errorf("Couldn't get current working directory: %v", err)
os.Exit(errorcodes.ErrGeneric)
}
logrus.Infof("Reading sketch from dir: %s", wd)
return wd
}
type programmersList struct {
Programmers []*rpc.Programmer
}
func (p *programmersList) Data() interface{} {
return p.Programmers
}
func (p *programmersList) String() string {
t := table.New()
t.SetHeader("ID", "Programmer Name", "Platform")
for _, prog := range p.Programmers {
t.AddRow(prog.GetId(), prog.GetName(), prog.GetPlatform())
}
return t.Render()
}
......@@ -22,6 +22,7 @@ import (
"strings"
"github.com/arduino/arduino-cli/cli/board"
"github.com/arduino/arduino-cli/cli/burnbootloader"
"github.com/arduino/arduino-cli/cli/cache"
"github.com/arduino/arduino-cli/cli/compile"
"github.com/arduino/arduino-cli/cli/completion"
......@@ -87,6 +88,7 @@ func createCliCommandTree(cmd *cobra.Command) {
cmd.AddCommand(sketch.NewCommand())
cmd.AddCommand(upload.NewCommand())
cmd.AddCommand(debug.NewCommand())
cmd.AddCommand(burnbootloader.NewCommand())
cmd.AddCommand(version.NewCommand())
cmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Print the logs on the standard output.")
......
......@@ -50,6 +50,7 @@ var (
dryRun bool // Use this flag to now write the output file
libraries []string // List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.
optimizeForDebug bool // Optimize compile output for debug, not for release
programmer string // Use the specified programmer to upload
)
// NewCommand created a new `compile` command
......@@ -84,6 +85,7 @@ func NewCommand() *cobra.Command {
command.Flags().StringSliceVar(&libraries, "libraries", []string{},
"List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.")
command.Flags().BoolVar(&optimizeForDebug, "optimize-for-debug", false, "Optional, optimize compile output for debug, not for release.")
command.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload.")
return command
}
......@@ -135,6 +137,7 @@ func run(cmd *cobra.Command, args []string) {
Verbose: verbose,
Verify: verify,
ImportDir: exportDir,
Programmer: programmer,
}, os.Stdout, os.Stderr)
if err != nil {
......
......@@ -24,17 +24,20 @@ import (
"github.com/arduino/arduino-cli/cli/instance"
"github.com/arduino/arduino-cli/commands/upload"
rpc "github.com/arduino/arduino-cli/rpc/commands"
"github.com/arduino/arduino-cli/table"
"github.com/arduino/go-paths-helper"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
var (
fqbn string
port string
verbose bool
verify bool
importDir string
fqbn string
port string
verbose bool
verify bool
importDir string
programmer string
burnBootloader bool
)
// NewCommand created a new `upload` command
......@@ -53,6 +56,7 @@ func NewCommand() *cobra.Command {
uploadCommand.Flags().StringVarP(&importDir, "input-dir", "", "", "Direcory containing binaries to upload.")
uploadCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.")
uploadCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Optional, turns on verbose mode.")
uploadCommand.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload or 'list' to list supported programmers.")
return uploadCommand
}
......@@ -64,12 +68,44 @@ func run(command *cobra.Command, args []string) {
os.Exit(errorcodes.ErrGeneric)
}
if programmer == "list" {
resp, err := upload.ListProgrammersAvailableForUpload(context.Background(), &rpc.ListProgrammersAvailableForUploadReq{
Instance: instance,
Fqbn: fqbn,
})
if err != nil {
feedback.Errorf("Error listing programmers: %v", err)
os.Exit(errorcodes.ErrGeneric)
}
feedback.PrintResult(&programmersList{
Programmers: resp.GetProgrammers(),
})
os.Exit(0)
}
var path *paths.Path
if len(args) > 0 {
path = paths.New(args[0])
}
sketchPath := initSketchPath(path)
if burnBootloader {
if _, err := upload.Upload(context.Background(), &rpc.UploadReq{
Instance: instance,
Fqbn: fqbn,
SketchPath: sketchPath.String(),
Port: port,
Verbose: verbose,
Verify: verify,
ImportDir: importDir,
Programmer: programmer,
}, os.Stdout, os.Stderr); err != nil {
feedback.Errorf("Error during Upload: %v", err)
os.Exit(errorcodes.ErrGeneric)
}
os.Exit(0)
}
if _, err := upload.Upload(context.Background(), &rpc.UploadReq{
Instance: instance,
Fqbn: fqbn,
......@@ -78,6 +114,7 @@ func run(command *cobra.Command, args []string) {
Verbose: verbose,
Verify: verify,
ImportDir: importDir,
Programmer: programmer,
}, os.Stdout, os.Stderr); err != nil {
feedback.Errorf("Error during Upload: %v", err)
os.Exit(errorcodes.ErrGeneric)
......@@ -98,3 +135,20 @@ func initSketchPath(sketchPath *paths.Path) *paths.Path {
logrus.Infof("Reading sketch from dir: %s", wd)
return wd
}
type programmersList struct {
Programmers []*rpc.Programmer
}
func (p *programmersList) Data() interface{} {
return p.Programmers
}
func (p *programmersList) String() string {
t := table.New()
t.SetHeader("ID", "Programmer Name", "Platform")
for _, prog := range p.Programmers {
t.AddRow(prog.GetId(), prog.GetName(), prog.GetPlatform())
}
return t.Render()
}
......@@ -216,6 +216,24 @@ func (s *ArduinoCoreServerImpl) Upload(req *rpc.UploadReq, stream rpc.ArduinoCor
return stream.Send(resp)
}
// BurnBootloader FIXMEDOC
func (s *ArduinoCoreServerImpl) BurnBootloader(req *rpc.BurnBootloaderReq, stream rpc.ArduinoCore_BurnBootloaderServer) error {
resp, err := upload.BurnBootloader(
stream.Context(), req,
utils.FeedStreamTo(func(data []byte) { stream.Send(&rpc.BurnBootloaderResp{OutStream: data}) }),
utils.FeedStreamTo(func(data []byte) { stream.Send(&rpc.BurnBootloaderResp{ErrStream: data}) }),
)
if err != nil {
return err
}
return stream.Send(resp)
}
// ListProgrammersAvailableForUpload FIXMEDOC
func (s *ArduinoCoreServerImpl) ListProgrammersAvailableForUpload(ctx context.Context, req *rpc.ListProgrammersAvailableForUploadReq) (*rpc.ListProgrammersAvailableForUploadResp, error) {
return upload.ListProgrammersAvailableForUpload(ctx, req)
}
// LibraryDownload FIXMEDOC
func (s *ArduinoCoreServerImpl) LibraryDownload(req *rpc.LibraryDownloadReq, stream rpc.ArduinoCore_LibraryDownloadServer) error {
resp, err := lib.LibraryDownload(
......
// This file is part of arduino-cli.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.
package upload
import (
"context"
"io"
"github.com/arduino/arduino-cli/commands"
rpc "github.com/arduino/arduino-cli/rpc/commands"
"github.com/sirupsen/logrus"
)
// BurnBootloader FIXMEDOC
func BurnBootloader(ctx context.Context, req *rpc.BurnBootloaderReq, outStream io.Writer, errStream io.Writer) (*rpc.BurnBootloaderResp, error) {
logrus.
WithField("fqbn", req.GetFqbn()).
WithField("port", req.GetPort()).
WithField("programmer", req.GetProgrammer()).
Trace("BurnBootloader started", req.GetFqbn())
pm := commands.GetPackageManager(req.GetInstance().GetId())
err := runProgramAction(
pm,
nil, // sketch
"", // importDir
req.GetFqbn(),
req.GetPort(),
req.GetProgrammer(),
req.GetVerbose(),
req.GetVerify(),
true, // burnBootloader
outStream,
errStream,
)
if err != nil {
return nil, err
}
return &rpc.BurnBootloaderResp{}, nil
}
// This file is part of arduino-cli.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
// You can be released from the requirements of the above licenses by purchasing
// a commercial license. Buying such a license is mandatory if you want to
// modify or otherwise use the software for commercial activities involving the
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.
package upload
import (
"context"
"fmt"
"github.com/arduino/arduino-cli/arduino/cores"
"github.com/arduino/arduino-cli/commands"
rpc "github.com/arduino/arduino-cli/rpc/commands"
)
// ListProgrammersAvailableForUpload FIXMEDOC
func ListProgrammersAvailableForUpload(ctx context.Context, req *rpc.ListProgrammersAvailableForUploadReq) (*rpc.ListProgrammersAvailableForUploadResp, error) {
pm := commands.GetPackageManager(req.GetInstance().GetId())
fqbnIn := req.GetFqbn()
if fqbnIn == "" {
return nil, fmt.Errorf("no Fully Qualified Board Name provided")
}
fqbn, err := cores.ParseFQBN(fqbnIn)
if err != nil {
return nil, fmt.Errorf("incorrect FQBN: %s", err)
}
// Find target platforms
_, platform, _, _, refPlatform, err := pm.ResolveFQBN(fqbn)
if err != nil {
return nil, fmt.Errorf("incorrect FQBN: %s", err)
}
result := []*rpc.Programmer{}
createRPCProgrammer := func(id string, programmer *cores.Programmer) *rpc.Programmer {
return &rpc.Programmer{
Id: id,
Platform: programmer.PlatformRelease.String(),
Name: programmer.Name,
}
}
if refPlatform != platform {
for id, programmer := range refPlatform.Programmers {
result = append(result, createRPCProgrammer(id, programmer))
}
}
for id, programmer := range platform.Programmers {
result = append(result, createRPCProgrammer(id, programmer))
}
return &rpc.ListProgrammersAvailableForUploadResp{
Programmers: result,
}, nil
}
This diff is collapsed.
This diff is collapsed.
......@@ -62,7 +62,7 @@ func TestLoadHardware(t *testing.T) {
require.Equal(t, "-v", avrPlatform.Releases[""].Properties.Get("tools.avrdude.bootloader.params.verbose"))
require.Equal(t, "/my/personal/avrdude", avrPlatform.Releases[""].Properties.Get("tools.avrdude.cmd.path"))
require.Equal(t, "AVRISP mkII", avrPlatform.Releases[""].Programmers["avrispmkii"].Get("name"))
require.Equal(t, "AVRISP mkII", avrPlatform.Releases[""].Programmers["avrispmkii"].Name)
//require.Equal(t, "{runtime.tools.ctags.path}", packages.Properties.Get("tools.ctags.path"])
//require.Equal(t, "\"{cmd.path}\" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives \"{source_file}\"", packages.Properties.Get("tools.ctags.pattern"])
......@@ -114,7 +114,7 @@ func TestLoadHardwareMixingUserHardwareFolder(t *testing.T) {
require.Equal(t, "-v", avrPlatform.Properties.Get("tools.avrdude.bootloader.params.verbose"))
require.Equal(t, "/my/personal/avrdude", avrPlatform.Properties.Get("tools.avrdude.cmd.path"))
require.Equal(t, "AVRISP mkII", avrPlatform.Programmers["avrispmkii"].Get("name"))
require.Equal(t, "AVRISP mkII", avrPlatform.Programmers["avrispmkii"].Name)
require.Equal(t, "-w -x c++ -M -MG -MP", avrPlatform.Properties.Get("preproc.includes.flags"))
require.Equal(t, "-w -x c++ -E -CC", avrPlatform.Properties.Get("preproc.macros.flags"))
......@@ -177,8 +177,8 @@ func TestLoadHardwareWithBoardManagerFolderStructure(t *testing.T) {
require.Equal(t, 3, len(samdPlatform.Programmers))
require.Equal(t, "Atmel EDBG", samdPlatform.Programmers["edbg"].Get("name"))
require.Equal(t, "openocd", samdPlatform.Programmers["edbg"].Get("program.tool"))
require.Equal(t, "Atmel EDBG", samdPlatform.Programmers["edbg"].Name)
require.Equal(t, "openocd", samdPlatform.Programmers["edbg"].Properties.Get("program.tool"))
avrRedBearPlatform := packages["RedBearLab"].Platforms["avr"].Releases["1.0.0"]
require.Equal(t, 3, len(avrRedBearPlatform.Boards))
......
This diff is collapsed.
......@@ -85,6 +85,11 @@ service ArduinoCore {
// Upload a compiled sketch to an Arduino board.
rpc Upload(UploadReq) returns (stream UploadResp);
rpc ListProgrammersAvailableForUpload(ListProgrammersAvailableForUploadReq) returns (ListProgrammersAvailableForUploadResp);
// Burn bootloader to a board.
rpc BurnBootloader(BurnBootloaderReq) returns (stream BurnBootloaderResp);
// Search for a platform in the platforms indexes.
rpc PlatformSearch(PlatformSearchReq) returns (PlatformSearchResp);
......
......@@ -39,6 +39,7 @@ type CompileReq struct {
OptimizeForDebug bool `protobuf:"varint,16,opt,name=optimizeForDebug,proto3" json:"optimizeForDebug,omitempty"`
DryRun bool `protobuf:"varint,17,opt,name=dryRun,proto3" json:"dryRun,omitempty"`
ExportDir string `protobuf:"bytes,18,opt,name=export_dir,json=exportDir,proto3" json:"export_dir,omitempty"`
Programmer string `protobuf:"bytes,19,opt,name=programmer,proto3" json:"programmer,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
......@@ -196,6 +197,13 @@ func (m *CompileReq) GetExportDir() string {
return ""
}
func (m *CompileReq) GetProgrammer() string {
if m != nil {
return m.Programmer
}
return ""
}
type CompileResp struct {
OutStream []byte `protobuf:"bytes,1,opt,name=out_stream,json=outStream,proto3" json:"out_stream,omitempty"`
ErrStream []byte `protobuf:"bytes,2,opt,name=err_stream,json=errStream,proto3" json:"err_stream,omitempty"`
......@@ -251,34 +259,35 @@ func init() {
func init() { proto.RegisterFile("commands/compile.proto", fileDescriptor_86bc582849c76c3d) }
var fileDescriptor_86bc582849c76c3d = []byte{
// 453 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x6f, 0xd3, 0x40,
0x10, 0x85, 0xe5, 0x34, 0x49, 0xe3, 0x49, 0x69, 0xcb, 0x0a, 0xca, 0xaa, 0x02, 0x64, 0x72, 0x40,
0x16, 0xa8, 0x8e, 0x04, 0x67, 0x2e, 0x6d, 0x55, 0x09, 0x71, 0x89, 0xcc, 0x8d, 0x4b, 0x65, 0xaf,
0x97, 0x78, 0xc0, 0xf6, 0x3a, 0xb3, 0xeb, 0x06, 0xf8, 0x9d, 0xfc, 0x20, 0xe4, 0x71, 0x9c, 0x44,
0x41, 0x3d, 0xc5, 0xf3, 0xcd, 0xdb, 0xb7, 0x2f, 0xab, 0x07, 0x17, 0xca, 0x94, 0x65, 0x52, 0x65,
0x76, 0xae, 0x4c, 0x59, 0x63, 0xa1, 0xa3, 0x9a, 0x8c, 0x33, 0xe2, 0x85, 0x52, 0x51, 0x42, 0x59,
0x83, 0x95, 0x89, 0x54, 0x81, 0x51, 0x2f, 0xbb, 0x7c, 0xbe, 0x7f, 0xa0,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xff, 0xaa, 0x0d, 0xb9, 0x3b, 0x2c, 0xb4, 0x7c, 0xd2, 0xee, 0xae, 0x07,
0xd2, 0x8b, 0xf7, 0x68, 0xfb, 0xe6, 0x3f, 0x4c, 0x6a, 0xe5, 0x69, 0xe0, 0x85, 0xa3, 0x98, 0xbf,
0xdb, 0xff, 0x58, 0x60, 0x4a, 0x09, 0xb5, 0xf9, 0xcf, 0x38, 0xff, 0x0e, 0x88, 0x77, 0x70, 0x6e,
0x6a, 0x87, 0x25, 0xfe, 0xd1, 0x77, 0x86, 0x6e, 0x75, 0xda, 0x2c, 0xe5, 0x39, 0xc7, 0xf9, 0x8f,
0xb7, 0xc9, 0x32, 0xfa, 0x1d, 0x37, 0x95, 0x7c, 0xca, 0x8a, 0xcd, 0x24, 0x5e, 0xf5, 0xc9, 0xee,
0x33, 0x24, 0x29, 0xba, 0x67, 0xec, 0xc8, 0x2d, 0xd2, 0xec, 0x0b, 0x4c, 0xb7, 0xad, 0xb2, 0x75,
0xab, 0x36, 0x8d, 0xbb, 0xb7, 0x8e, 0x74, 0x52, 0x72, 0xb1, 0x4e, 0x62, 0xdf, 0x34, 0xee, 0x2b,
0x03, 0x36, 0x23, 0xea, 0xd7, 0x83, 0x6e, 0xad, 0x89, 0xba, 0xf5, 0xf5, 0xd5, 0xb7, 0xf7, 0x4b,
0x74, 0x79, 0x93, 0xb6, 0xdd, 0x9b, 0x6f, 0xba, 0xd8, 0xff, 0x5e, 0xa9, 0x02, 0xe7, 0x54, 0xab,
0x79, 0xdf, 0xcb, 0x74, 0xcc, 0xcd, 0xfe, 0xf8, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x40, 0x39, 0x20,
0x0a, 0x23, 0x03, 0x00, 0x00,
// 467 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6f, 0xd3, 0x30,
0x14, 0xc6, 0x95, 0xad, 0xed, 0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c, 0xd3, 0xcd, 0xd4, 0xd9, 0xa6, 0x73, 0x33, 0xad,
0xbb, 0xb3, 0x8e, 0x30, 0xad, 0x78, 0xf0, 0x8e, 0x93, 0x89, 0x69, 0xdd, 0x17, 0x06, 0x7c, 0x18,
0x51, 0xdf, 0x3e, 0xf0, 0x6d, 0x24, 0xf2, 0xed, 0xab, 0xcb, 0xaf, 0xef, 0x96, 0xda, 0x15, 0x6d,
0xd6, 0xcd, 0xe6, 0x7c, 0x3d, 0xab, 0xfd, 0xf7, 0x52, 0x95, 0x7a, 0x4e, 0x8d, 0x9a, 0xf7, 0x73,
0x9b, 0x8d, 0x78, 0xf2, 0x3f, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x91, 0xad, 0xf5, 0x19, 0x43,
0x03, 0x00, 0x00,
}
......@@ -40,6 +40,7 @@ message CompileReq {
bool optimizeForDebug = 16; // Optimize compile output for debug, not for release.
bool dryRun = 17; // When set to `true` the compiled binary will not be copied to the export directory.
string export_dir = 18; // Optional: save the build artifacts in this directory, the directory must exist.
string programmer = 19; // External programmer for upload
}
message CompileResp {
......
This diff is collapsed.
......@@ -43,6 +43,7 @@ message UploadReq {
// Custom path to a directory containing compiled files. When `import_dir` is
// not specified, the standard build directory under `sketch_path` is used.
string import_dir = 8;
string programmer = 9;
}
message UploadResp {
......@@ -50,4 +51,42 @@ message UploadResp {
bytes out_stream = 1;
// The error output of the upload process.
bytes err_stream = 2;
}
\ No newline at end of file
}
message BurnBootloaderReq {
// Arduino Core Service instance from the `Init` response.
Instance instance = 1;
// Fully qualified board name of the target board (e.g., `arduino:avr:uno`).
string fqbn = 2;
// The port of the programmer used to program the bootloader.
string port = 3;
// Whether to turn on verbose output during the programming.
bool verbose = 4;
// After programming, verify the contents of the memory on the board match the
// uploaded binary.
bool verify = 5;
// The programmer to use for burning bootloader.
string programmer = 6;
}
message BurnBootloaderResp {
// The output of the burn bootloader process.
bytes out_stream = 1;
// The error output of the burn bootloader process.
bytes err_stream = 2;
}
message ListProgrammersAvailableForUploadReq {
Instance instance = 1;
string fqbn = 2;
}
message ListProgrammersAvailableForUploadResp {
repeated Programmer programmers = 1;
}
message Programmer {
string platform = 1;
string id = 2;
string name = 3;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment