Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
cc5e3d61
Unverified
Commit
cc5e3d61
authored
Sep 10, 2019
by
Massimiliano Pippi
Committed by
GitHub
Sep 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show core name when listing boards (#395)
* show core name in a column * use cores package to parse the FQBN
parent
b3db7a64
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
51 deletions
+27
-51
README.md
README.md
+10
-46
cli/board/list.go
cli/board/list.go
+17
-5
No files found.
README.md
View file @
cc5e3d61
...
...
@@ -137,44 +137,17 @@ MKR1000 board:
```
console
$
arduino-cli board list
FQBN Port ID Board Nam
e
/dev/ttyACM0 2341:804E unknown
Port Type Board Name FQBN Cor
e
/dev/ttyACM1 Serial Port (USB) Arduino/Genuino MKR1000 arduino:samd:mkr1000 arduino:samd
```
the board has been discovered but we
do not have the correct core to program it yet.
Let's
install it!
the board has been discovered but we
need the correct core to program it, let's
install it!
### Step 4.
Find and install the right core
### Step 4.
Install the core for your board
We have to look at the core available with the
`core search`
command. It will provide a list of
available cores matching the name arduino:
```
console
$
arduino-cli core search arduino
Searching for platforms matching 'arduino'
ID Version Name
Intel:arc32 2.0.4 Intel Curie Boards
arduino:avr 1.6.23 Arduino AVR Boards
arduino:mbed 1.1.0 Arduino nRF528x Boards (Mbed OS)
arduino:megaavr 1.8.3 Arduino megaAVR Boards
arduino:nrf52 1.0.2 Arduino nRF52 Boards
arduino:sam 1.6.12 Arduino SAM Boards (32-bits ARM Cortex-M3)
arduino:samd 1.8.3 Arduino SAMD Boards (32-bits ARM Cortex-M0+)
arduino:samd_beta 1.6.25 Arduino SAMD Beta Boards (32-bits ARM Cortex-M0+)
arduino:stm32f4 1.0.1 Arduino STM32F4 Boards
littleBits:avr 1.0.0 littleBits Arduino AVR Modules
```
If you're unsure you can try to refine the search with the board name
```
console
$
arduino-cli core search mkr1000
Searching for platforms matching 'mkr1000'
ID Version Name
arduino:samd 1.8.3 Arduino SAMD Boards (32-bits ARM Cortex-M0+)
```
So, the right platform for the Arduino MKR1000 is arduino:samd, now we can install it
From the output of the
`board list`
command, the right platform for the Arduino
MKR1000 is
`arduino:samd`
, we can install it with:
```
console
$
arduino-cli core
install
arduino:samd
...
...
@@ -207,14 +180,6 @@ ID Installed Latest Name
arduino:samd 1.6.19 1.6.19 Arduino SAMD Boards (32-bits ARM Cortex-M0+)
```
We can finally check if the board is now recognized as a MKR1000
```
console
$
arduino-cli board list
FQBN Port ID Board Name
arduino:samd:mkr1000 /dev/ttyACM0 2341:804E Arduino/Genuino MKR1000
```
If the board is not detected for any reason, you can list all the supported boards
with
`arduino-cli board listall`
and also search for a specific board:
...
...
@@ -229,8 +194,7 @@ Arduino MKRZERO arduino:samd:mkrzero
Arduino/Genuino MKR1000 arduino:samd:mkr1000
```
Great! Now we have the Board FQBN (Fully Qualified Board Name)
`arduino:samd:mkr1000`
and the Board Name look good, we are ready to compile and upload the sketch
Great! Now we are ready to compile and upload the sketch.
#### Adding 3rd party cores
...
...
cli/board/list.go
View file @
cc5e3d61
...
...
@@ -18,10 +18,12 @@
package
board
import
(
"fmt"
"os"
"sort"
"time"
"github.com/arduino/arduino-cli/arduino/cores"
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/cli/globals"
...
...
@@ -85,7 +87,7 @@ func outputListResp(ports []*rpc.DetectedPort) {
})
t
:=
table
.
New
()
t
.
SetHeader
(
"Port"
,
"Type"
,
"Board Name"
,
"FQBN"
)
t
.
SetHeader
(
"Port"
,
"Type"
,
"Board Name"
,
"FQBN"
,
"Core"
)
for
_
,
port
:=
range
ports
{
address
:=
port
.
GetProtocol
()
+
"://"
+
port
.
GetAddress
()
if
port
.
GetProtocol
()
==
"serial"
{
...
...
@@ -99,16 +101,26 @@ func outputListResp(ports []*rpc.DetectedPort) {
})
for
_
,
b
:=
range
boards
{
board
:=
b
.
GetName
()
fqbn
:=
b
.
GetFQBN
()
t
.
AddRow
(
address
,
protocol
,
board
,
fqbn
)
// show address and protocol only on the first row
// to improve the user experience, show on a dedicated column
// the name of the core supporting the board detected
var
coreName
=
""
fqbn
,
err
:=
cores
.
ParseFQBN
(
b
.
GetFQBN
())
if
err
==
nil
{
coreName
=
fmt
.
Sprintf
(
"%s:%s"
,
fqbn
.
Package
,
fqbn
.
PlatformArch
)
}
t
.
AddRow
(
address
,
protocol
,
board
,
fqbn
,
coreName
)
// reset address and protocol, we only show them on the first row
address
=
""
protocol
=
""
}
}
else
{
board
:=
"Unknown"
fqbn
:=
""
t
.
AddRow
(
address
,
protocol
,
board
,
fqbn
)
coreName
:=
""
t
.
AddRow
(
address
,
protocol
,
board
,
fqbn
,
coreName
)
}
}
feedback
.
Print
(
t
.
Render
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment