-
-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove debug hotfix for arduino:[email protected]/9 (#2421)
- Loading branch information
1 parent
354464f
commit 7f1def1
Showing
3 changed files
with
60 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,10 +66,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai | |
|
||
details.DebuggingSupported = boardProperties.ContainsKey("debug.executable") || | ||
boardPlatformRelease.Properties.ContainsKey("debug.executable") || | ||
(boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable")) || | ||
// HOTFIX: Remove me when the `arduino:samd` core is updated | ||
boardPlatformRelease.String() == "arduino:[email protected]" || | ||
boardPlatformRelease.String() == "arduino:[email protected]" | ||
(boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable")) | ||
|
||
details.Package = &rpc.Package{ | ||
Name: boardPackage.Name, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,21 +84,6 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl | |
toolProperties.Merge(platformRelease.RuntimeProperties()) | ||
toolProperties.Merge(boardProperties) | ||
|
||
// HOTFIX: Remove me when the `arduino:samd` core is updated | ||
// (remember to remove it also in arduino/board/details.go) | ||
if !toolProperties.ContainsKey("debug.executable") { | ||
if platformRelease.String() == "arduino:[email protected]" || platformRelease.String() == "arduino:[email protected]" { | ||
toolProperties.Set("debug.executable", "{build.path}/{build.project_name}.elf") | ||
toolProperties.Set("debug.toolchain", "gcc") | ||
toolProperties.Set("debug.toolchain.path", "{runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/") | ||
toolProperties.Set("debug.toolchain.prefix", "arm-none-eabi-") | ||
toolProperties.Set("debug.server", "openocd") | ||
toolProperties.Set("debug.server.openocd.path", "{runtime.tools.openocd-0.10.0-arduino7.path}/bin/openocd") | ||
toolProperties.Set("debug.server.openocd.scripts_dir", "{runtime.tools.openocd-0.10.0-arduino7.path}/share/openocd/scripts/") | ||
toolProperties.Set("debug.server.openocd.script", "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}") | ||
} | ||
} | ||
|
||
for _, tool := range pme.GetAllInstalledToolsReleases() { | ||
toolProperties.Merge(tool.RuntimeProperties()) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -275,8 +275,8 @@ func TestBoardDetails(t *testing.T) { | |
|
||
_, _, err := cli.Run("core", "update-index") | ||
require.NoError(t, err) | ||
// Download samd core pinned to 1.8.6 | ||
_, _, err = cli.Run("core", "install", "arduino:[email protected].6") | ||
// Download samd core pinned to 1.8.13 | ||
_, _, err = cli.Run("core", "install", "arduino:[email protected].13") | ||
require.NoError(t, err) | ||
|
||
// Test board listall with and without showing hidden elements | ||
|
@@ -298,70 +298,73 @@ func TestBoardDetails(t *testing.T) { | |
require.NoError(t, err) | ||
|
||
requirejson.Contains(t, stdout, `{ | ||
"fqbn": "arduino:samd:nano_33_iot", | ||
"name": "Arduino NANO 33 IoT", | ||
"version": "1.8.6", | ||
"properties_id": "nano_33_iot", | ||
"official": true, | ||
"package": { | ||
"maintainer": "Arduino", | ||
"url": "https://downloads.arduino.cc/packages/package_index.tar.bz2", | ||
"website_url": "http://www.arduino.cc/", | ||
"email": "[email protected]", | ||
"name": "arduino", | ||
"help": { | ||
"online": "http://www.arduino.cc/en/Reference/HomePage" | ||
} | ||
}, | ||
"platform": { | ||
"architecture": "samd", | ||
"category": "Arduino", | ||
"url": "http://downloads.arduino.cc/cores/samd-1.8.6.tar.bz2", | ||
"archive_filename": "samd-1.8.6.tar.bz2", | ||
"checksum": "SHA-256:68a4fffa6fe6aa7886aab2e69dff7d3f94c02935bbbeb42de37f692d7daf823b", | ||
"size": 2980953, | ||
"fqbn": "arduino:samd:nano_33_iot", | ||
"name": "Arduino NANO 33 IoT", | ||
"version": "1.8.13", | ||
"properties_id": "nano_33_iot", | ||
"official": true, | ||
"package": { | ||
"maintainer": "Arduino", | ||
"url": "https://downloads.arduino.cc/packages/package_index.tar.bz2", | ||
"website_url": "http://www.arduino.cc/", | ||
"email": "[email protected]", | ||
"name": "arduino", | ||
"help": { | ||
"online": "http://www.arduino.cc/en/Reference/HomePage" | ||
} | ||
}, | ||
"platform": { | ||
"architecture": "samd", | ||
"category": "Arduino", | ||
"url": "http://downloads.arduino.cc/cores/core-ArduinoCore-samd-1.8.13.tar.bz2", | ||
"archive_filename": "core-ArduinoCore-samd-1.8.13.tar.bz2", | ||
"checksum": "SHA-256:47d44c80a5fd4ea224eb64fd676169e896caa6856f338d78feb4a12d42b4ea67", | ||
"size": 3074191, | ||
"name": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)" | ||
}, | ||
"identification_properties": [ | ||
}, | ||
"programmers": [ | ||
{ | ||
"properties": { | ||
"vid": "0x2341", | ||
"pid": "0x8057" | ||
} | ||
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)", | ||
"id": "jlink", | ||
"name": "Segger J-Link" | ||
}, | ||
{ | ||
"properties": { | ||
"vid": "0x2341", | ||
"pid": "0x0057" | ||
} | ||
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)", | ||
"id": "edbg", | ||
"name": "Atmel EDBG" | ||
}, | ||
{ | ||
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)", | ||
"id": "atmel_ice", | ||
"name": "Atmel-ICE" | ||
}, | ||
{ | ||
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)", | ||
"id": "sam_ice", | ||
"name": "Atmel SAM-ICE" | ||
} | ||
], | ||
"programmers": [ | ||
{ | ||
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)", | ||
"id": "edbg", | ||
"name": "Atmel EDBG" | ||
], | ||
"debugging_supported": true, | ||
"identification_properties": [ | ||
{ | ||
"properties": { | ||
"pid": "0x8057", | ||
"vid": "0x2341" | ||
} | ||
}, | ||
{ | ||
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)", | ||
"id": "atmel_ice", | ||
"name": "Atmel-ICE" | ||
"properties": { | ||
"pid": "0x0057", | ||
"vid": "0x2341" | ||
} | ||
}, | ||
{ | ||
"platform": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)", | ||
"id": "sam_ice", | ||
"name": "Atmel SAM-ICE" | ||
"properties": { | ||
"board": "nano_33_iot" | ||
} | ||
} | ||
] | ||
}`) | ||
|
||
// Download samd core pinned to 1.8.8 | ||
_, _, err = cli.Run("core", "install", "arduino:[email protected]") | ||
require.NoError(t, err) | ||
|
||
stdout, _, err = cli.Run("board", "details", "-b", "arduino:samd:nano_33_iot", "--format", "json") | ||
require.NoError(t, err) | ||
requirejson.Contains(t, stdout, `{"debugging_supported": true}`) | ||
] | ||
}`) | ||
} | ||
|
||
func TestBoardDetailsNoFlags(t *testing.T) { | ||
|