Skip to content

Commit 5d6eef4

Browse files
committed
Added support for Giga+ST/Link board combination
1 parent e842c77 commit 5d6eef4

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

test/RpcClientTest/RpcClientTest.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#ifdef ARDUINO_SAMD_ZERO
44
#define MSGPACKRPC Serial // MsgPack RPC runs on the hardware serial port (that do not disconnects on reset/upload)
55
#define DEBUG SerialUSB // Debug and upload port is the native USB
6+
#elif ARDUINO_GIGA
7+
#define MSGPACKRPC Serial1 // MsgPack RPC runs on Serial1
8+
#define DEBUG SerialUSB // Debug and upload port is Serial
69
#else
710
#error "Unsupported board"
811
#endif

test/RpcClientTest/RpcClient_test.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ func getFQBNAndPorts(t *testing.T) (fqbn string, rpcPort string, uploadPort stri
130130
Fqbn string `json:"fqbn"`
131131
} `json:"matching_boards"`
132132
Port struct {
133-
Address string `json:"address"`
133+
Address string `json:"address"`
134+
Properties struct {
135+
Vid string `json:"vid"`
136+
Pid string `json:"pid"`
137+
} `json:"properties"`
134138
} `json:"port"`
135139
} `json:"detected_ports"`
136140
}
@@ -144,6 +148,10 @@ func getFQBNAndPorts(t *testing.T) (fqbn string, rpcPort string, uploadPort stri
144148
}
145149
for _, port := range cliResult.DetectedPorts {
146150
for _, board := range port.MatchingBoards {
151+
if board.Fqbn == "arduino:mbed_giga:giga" {
152+
checkFQBN(board.Fqbn)
153+
uploadPort = port.Port.Address
154+
}
147155
if board.Fqbn == "arduino:samd:arduino_zero_edbg" {
148156
checkFQBN("arduino:samd:arduino_zero_native")
149157
rpcPort = port.Port.Address
@@ -154,6 +162,13 @@ func getFQBNAndPorts(t *testing.T) (fqbn string, rpcPort string, uploadPort stri
154162
}
155163
}
156164
}
165+
if rpcPort == "" {
166+
for _, port := range cliResult.DetectedPorts {
167+
if port.Port.Properties.Vid == "0x0483" && port.Port.Properties.Pid == "0x374B" {
168+
rpcPort = port.Port.Address
169+
}
170+
}
171+
}
157172
require.NotEmpty(t, uploadPort, "Upload port not found")
158173
require.NotEmpty(t, rpcPort, "Debug port not found")
159174
return fqbn, rpcPort, uploadPort

0 commit comments

Comments
 (0)