Skip to content

Commit 7f1def1

Browse files
Remove debug hotfix for arduino:[email protected]/9 (#2421)
1 parent 354464f commit 7f1def1

File tree

3 files changed

+60
-75
lines changed

3 files changed

+60
-75
lines changed

commands/board/details.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai
6666

6767
details.DebuggingSupported = boardProperties.ContainsKey("debug.executable") ||
6868
boardPlatformRelease.Properties.ContainsKey("debug.executable") ||
69-
(boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable")) ||
70-
// HOTFIX: Remove me when the `arduino:samd` core is updated
71-
boardPlatformRelease.String() == "arduino:[email protected]" ||
72-
boardPlatformRelease.String() == "arduino:[email protected]"
69+
(boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable"))
7370

7471
details.Package = &rpc.Package{
7572
Name: boardPackage.Name,

commands/debug/debug_info.go

-15
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,6 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
8484
toolProperties.Merge(platformRelease.RuntimeProperties())
8585
toolProperties.Merge(boardProperties)
8686

87-
// HOTFIX: Remove me when the `arduino:samd` core is updated
88-
// (remember to remove it also in arduino/board/details.go)
89-
if !toolProperties.ContainsKey("debug.executable") {
90-
if platformRelease.String() == "arduino:[email protected]" || platformRelease.String() == "arduino:[email protected]" {
91-
toolProperties.Set("debug.executable", "{build.path}/{build.project_name}.elf")
92-
toolProperties.Set("debug.toolchain", "gcc")
93-
toolProperties.Set("debug.toolchain.path", "{runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/")
94-
toolProperties.Set("debug.toolchain.prefix", "arm-none-eabi-")
95-
toolProperties.Set("debug.server", "openocd")
96-
toolProperties.Set("debug.server.openocd.path", "{runtime.tools.openocd-0.10.0-arduino7.path}/bin/openocd")
97-
toolProperties.Set("debug.server.openocd.scripts_dir", "{runtime.tools.openocd-0.10.0-arduino7.path}/share/openocd/scripts/")
98-
toolProperties.Set("debug.server.openocd.script", "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}")
99-
}
100-
}
101-
10287
for _, tool := range pme.GetAllInstalledToolsReleases() {
10388
toolProperties.Merge(tool.RuntimeProperties())
10489
}

internal/integrationtest/board/board_test.go

+59-56
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ func TestBoardDetails(t *testing.T) {
275275

276276
_, _, err := cli.Run("core", "update-index")
277277
require.NoError(t, err)
278-
// Download samd core pinned to 1.8.6
279-
_, _, err = cli.Run("core", "install", "arduino:[email protected].6")
278+
// Download samd core pinned to 1.8.13
279+
_, _, err = cli.Run("core", "install", "arduino:[email protected].13")
280280
require.NoError(t, err)
281281

282282
// Test board listall with and without showing hidden elements
@@ -298,70 +298,73 @@ func TestBoardDetails(t *testing.T) {
298298
require.NoError(t, err)
299299

300300
requirejson.Contains(t, stdout, `{
301-
"fqbn": "arduino:samd:nano_33_iot",
302-
"name": "Arduino NANO 33 IoT",
303-
"version": "1.8.6",
304-
"properties_id": "nano_33_iot",
305-
"official": true,
306-
"package": {
307-
"maintainer": "Arduino",
308-
"url": "https://downloads.arduino.cc/packages/package_index.tar.bz2",
309-
"website_url": "http://www.arduino.cc/",
310-
"email": "[email protected]",
311-
"name": "arduino",
312-
"help": {
313-
"online": "http://www.arduino.cc/en/Reference/HomePage"
314-
}
315-
},
316-
"platform": {
317-
"architecture": "samd",
318-
"category": "Arduino",
319-
"url": "http://downloads.arduino.cc/cores/samd-1.8.6.tar.bz2",
320-
"archive_filename": "samd-1.8.6.tar.bz2",
321-
"checksum": "SHA-256:68a4fffa6fe6aa7886aab2e69dff7d3f94c02935bbbeb42de37f692d7daf823b",
322-
"size": 2980953,
301+
"fqbn": "arduino:samd:nano_33_iot",
302+
"name": "Arduino NANO 33 IoT",
303+
"version": "1.8.13",
304+
"properties_id": "nano_33_iot",
305+
"official": true,
306+
"package": {
307+
"maintainer": "Arduino",
308+
"url": "https://downloads.arduino.cc/packages/package_index.tar.bz2",
309+
"website_url": "http://www.arduino.cc/",
310+
"email": "[email protected]",
311+
"name": "arduino",
312+
"help": {
313+
"online": "http://www.arduino.cc/en/Reference/HomePage"
314+
}
315+
},
316+
"platform": {
317+
"architecture": "samd",
318+
"category": "Arduino",
319+
"url": "http://downloads.arduino.cc/cores/core-ArduinoCore-samd-1.8.13.tar.bz2",
320+
"archive_filename": "core-ArduinoCore-samd-1.8.13.tar.bz2",
321+
"checksum": "SHA-256:47d44c80a5fd4ea224eb64fd676169e896caa6856f338d78feb4a12d42b4ea67",
322+
"size": 3074191,
323323
"name": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)"
324-
},
325-
"identification_properties": [
324+
},
325+
"programmers": [
326326
{
327-
"properties": {
328-
"vid": "0x2341",
329-
"pid": "0x8057"
330-
}
327+
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
328+
"id": "jlink",
329+
"name": "Segger J-Link"
331330
},
332331
{
333-
"properties": {
334-
"vid": "0x2341",
335-
"pid": "0x0057"
336-
}
332+
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
333+
"id": "edbg",
334+
"name": "Atmel EDBG"
335+
},
336+
{
337+
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
338+
"id": "atmel_ice",
339+
"name": "Atmel-ICE"
340+
},
341+
{
342+
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
343+
"id": "sam_ice",
344+
"name": "Atmel SAM-ICE"
337345
}
338-
],
339-
"programmers": [
340-
{
341-
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
342-
"id": "edbg",
343-
"name": "Atmel EDBG"
346+
],
347+
"debugging_supported": true,
348+
"identification_properties": [
349+
{
350+
"properties": {
351+
"pid": "0x8057",
352+
"vid": "0x2341"
353+
}
344354
},
345355
{
346-
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
347-
"id": "atmel_ice",
348-
"name": "Atmel-ICE"
356+
"properties": {
357+
"pid": "0x0057",
358+
"vid": "0x2341"
359+
}
349360
},
350361
{
351-
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
352-
"id": "sam_ice",
353-
"name": "Atmel SAM-ICE"
362+
"properties": {
363+
"board": "nano_33_iot"
364+
}
354365
}
355-
]
356-
}`)
357-
358-
// Download samd core pinned to 1.8.8
359-
_, _, err = cli.Run("core", "install", "arduino:[email protected]")
360-
require.NoError(t, err)
361-
362-
stdout, _, err = cli.Run("board", "details", "-b", "arduino:samd:nano_33_iot", "--format", "json")
363-
require.NoError(t, err)
364-
requirejson.Contains(t, stdout, `{"debugging_supported": true}`)
366+
]
367+
}`)
365368
}
366369

367370
func TestBoardDetailsNoFlags(t *testing.T) {

0 commit comments

Comments
 (0)