Closed
Description
$ arduino-cli board attach esp8266:esp8266:generic
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x8d10c1]
goroutine 1 [running]:
github.com/arduino/arduino-cli/commands/board.runAttachCommand(0xc000137400, 0xc000065570, 0x1, 0x1)
$GOCODE/src/github.com/arduino/arduino-cli/commands/board/attach.go:82 +0x1e1
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc000137400, 0xc000065540, 0x1, 0x1, 0xc000137400, 0xc000065540)
$GOCODE/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:766 +0x2ae
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000136f00, 0x93dcec, 0xc00014ff88, 0xc000034118)
$GOCODE/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:852 +0x2c0
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).Execute(...)
$GOCODE/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:800
main.main()
$GOCODE/src/github.com/arduino/arduino-cli/main.go:30 +0x28
I replaced the GOCODE portion of the paths, obviously.
The line of code in question is the assignment in this block:
if fqbn != nil {
sketch.Metadata.CPU = sketches.BoardMetadata{
Fqbn: fqbn.String(),
}
So it found the fqbn in the args, but can't turn it into a string? This is exactly the example command line for 'board attach' with a different fqbn. Any hints will be appreciated.
Also, is there any documentation for 'board attach'?