Skip to content

Commit 46e58b5

Browse files
committed
Fix crash when attempting upload without specifying port address
1 parent 050d01e commit 46e58b5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cli/arguments/port.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ func (p *Port) GetPort(instance *rpc.Instance, sk *sketch.Sketch) (*discovery.Po
6161
}
6262
}
6363
if address == "" {
64-
return nil, nil
64+
// If no address is provided we assume the user is trying to upload
65+
// to a board that supports a tool that automatically detects
66+
// the attached board without specifying explictly a port.
67+
// Tools that work this way must be specified using the property
68+
// "BOARD_ID.upload.tool.default" in the platform's boards.txt.
69+
return &discovery.Port{
70+
Protocol: "default",
71+
}, nil
6572
}
6673
logrus.WithField("port", address).Tracef("Upload port")
6774

0 commit comments

Comments
 (0)