Skip to content

Commit

Permalink
Add support for SDK 2.1.0 and Pico 2 W
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Nov 25, 2024
1 parent c489e3c commit c518847
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 15 deletions.
197 changes: 193 additions & 4 deletions data/0.17.0/github-cache.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"githubApiCache-0-0": [
"1.5.1",
"2.0.0"
"2.0.0",
"2.1.0"
],
"githubApiCache-0-1-1.5.1": {
"assets": [
Expand All @@ -23,9 +24,20 @@
],
"assetsUrl": "https://api.github.com/repos/raspberrypi/pico-sdk/releases/169292056/assets"
},
"githubApiCache-0-1-2.1.0": {
"assets": [
{
"id": 208867614,
"name": "pico-sdk-2.1.0.tar.gz",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk/releases/download/2.1.0/pico-sdk-2.1.0.tar.gz"
}
],
"assetsUrl": "https://api.github.com/repos/raspberrypi/pico-sdk/releases/187177527/assets"
},
"githubApiCache-1-0": [
"v3.28.6",
"v3.29.6"
"v3.29.6",
"v3.29.9"
],
"githubApiCache-1-1-v3.28.6": {
"assets": [
Expand Down Expand Up @@ -227,6 +239,106 @@
],
"assetsUrl": "https://api.github.com/repos/Kitware/CMake/releases/160931478/assets"
},
"githubApiCache-1-1-v3.29.9": {
"assets": [
{
"id": 208104321,
"name": "cmake-3.29.9-files-v1.json",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-files-v1.json"
},
{
"id": 208104322,
"name": "cmake-3.29.9-linux-aarch64.sh",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-linux-aarch64.sh"
},
{
"id": 208104324,
"name": "cmake-3.29.9-linux-aarch64.tar.gz",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-linux-aarch64.tar.gz"
},
{
"id": 208104336,
"name": "cmake-3.29.9-linux-x86_64.sh",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-linux-x86_64.sh"
},
{
"id": 208104342,
"name": "cmake-3.29.9-linux-x86_64.tar.gz",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-linux-x86_64.tar.gz"
},
{
"id": 208104354,
"name": "cmake-3.29.9-macos-universal.dmg",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-macos-universal.dmg"
},
{
"id": 208104365,
"name": "cmake-3.29.9-macos-universal.tar.gz",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-macos-universal.tar.gz"
},
{
"id": 208104384,
"name": "cmake-3.29.9-macos10.10-universal.dmg",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-macos10.10-universal.dmg"
},
{
"id": 208104392,
"name": "cmake-3.29.9-macos10.10-universal.tar.gz",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-macos10.10-universal.tar.gz"
},
{
"id": 208104400,
"name": "cmake-3.29.9-SHA-256.txt",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-SHA-256.txt"
},
{
"id": 208104401,
"name": "cmake-3.29.9-SHA-256.txt.asc",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-SHA-256.txt.asc"
},
{
"id": 208104403,
"name": "cmake-3.29.9-windows-arm64.msi",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-windows-arm64.msi"
},
{
"id": 208104417,
"name": "cmake-3.29.9-windows-arm64.zip",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-windows-arm64.zip"
},
{
"id": 208104420,
"name": "cmake-3.29.9-windows-i386.msi",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-windows-i386.msi"
},
{
"id": 208104423,
"name": "cmake-3.29.9-windows-i386.zip",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-windows-i386.zip"
},
{
"id": 208104428,
"name": "cmake-3.29.9-windows-x86_64.msi",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-windows-x86_64.msi"
},
{
"id": 208104437,
"name": "cmake-3.29.9-windows-x86_64.zip",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9-windows-x86_64.zip"
},
{
"id": 208104442,
"name": "cmake-3.29.9.tar.gz",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9.tar.gz"
},
{
"id": 208104444,
"name": "cmake-3.29.9.zip",
"browser_download_url": "https://github.com/Kitware/CMake/releases/download/v3.29.9/cmake-3.29.9.zip"
}
],
"assetsUrl": "https://api.github.com/repos/Kitware/CMake/releases/186670936/assets"
},
"githubApiCache-2-0": [
"v1.12.1"
],
Expand Down Expand Up @@ -267,7 +379,8 @@
"v2.0.0-2",
"v2.0.0-3",
"v2.0.0-4",
"v2.0.0-5"
"v2.0.0-5",
"v2.1.0-0"
],
"githubApiCache-3-1-v1.5.1-0": {
"assets": [
Expand Down Expand Up @@ -774,8 +887,74 @@
],
"assetsUrl": "https://api.github.com/repos/raspberrypi/pico-sdk-tools/releases/177327402/assets"
},
"githubApiCache-3-1-v2.1.0-0": {
"assets": [
{
"id": 208907841,
"name": "openocd-0.12.0+dev-aarch64-lin.tar.gz",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/openocd-0.12.0%2Bdev-aarch64-lin.tar.gz"
},
{
"id": 208909295,
"name": "openocd-0.12.0+dev-arm64-mac.zip",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/openocd-0.12.0%2Bdev-arm64-mac.zip"
},
{
"id": 208909148,
"name": "openocd-0.12.0+dev-x64-win.zip",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/openocd-0.12.0%2Bdev-x64-win.zip"
},
{
"id": 208907708,
"name": "openocd-0.12.0+dev-x86_64-lin.tar.gz",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/openocd-0.12.0%2Bdev-x86_64-lin.tar.gz"
},
{
"id": 208907840,
"name": "pico-sdk-tools-2.1.0-aarch64-lin.tar.gz",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/pico-sdk-tools-2.1.0-aarch64-lin.tar.gz"
},
{
"id": 208909294,
"name": "pico-sdk-tools-2.1.0-mac.zip",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/pico-sdk-tools-2.1.0-mac.zip"
},
{
"id": 208909147,
"name": "pico-sdk-tools-2.1.0-x64-win.zip",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/pico-sdk-tools-2.1.0-x64-win.zip"
},
{
"id": 208907707,
"name": "pico-sdk-tools-2.1.0-x86_64-lin.tar.gz",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/pico-sdk-tools-2.1.0-x86_64-lin.tar.gz"
},
{
"id": 208907842,
"name": "picotool-2.1.0-aarch64-lin.tar.gz",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/picotool-2.1.0-aarch64-lin.tar.gz"
},
{
"id": 208909293,
"name": "picotool-2.1.0-mac.zip",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/picotool-2.1.0-mac.zip"
},
{
"id": 208909149,
"name": "picotool-2.1.0-x64-win.zip",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/picotool-2.1.0-x64-win.zip"
},
{
"id": 208907706,
"name": "picotool-2.1.0-x86_64-lin.tar.gz",
"browser_download_url": "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/picotool-2.1.0-x86_64-lin.tar.gz"
}
],
"assetsUrl": "https://api.github.com/repos/raspberrypi/pico-sdk-tools/releases/187251265/assets"
},
"githubApiCache-4-0": [
"2.0.0"
"2.0.0",
"2.1.0"
],
"githubApiCache-4-1-2.0.0": {
"assets": [
Expand All @@ -786,5 +965,15 @@
}
],
"assetsUrl": "https://api.github.com/repos/raspberrypi/picotool/releases/169321961/assets"
},
"githubApiCache-4-1-2.1.0": {
"assets": [
{
"id": 208873404,
"name": "picotool-2.1.0.tar.gz",
"browser_download_url": "https://github.com/raspberrypi/picotool/releases/download/2.1.0/picotool-2.1.0.tar.gz"
}
],
"assetsUrl": "https://api.github.com/repos/raspberrypi/picotool/releases/187217595/assets"
}
}
7 changes: 7 additions & 0 deletions data/0.17.0/versionBundles.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@
"picotool": "2.0.0",
"toolchain": "13_2_Rel1",
"riscvToolchain": "RISCV_RPI_2_0_0_5"
},
"2.1.0": {
"ninja": "v1.12.1",
"cmake": "v3.29.9",
"picotool": "2.1.0",
"toolchain": "13_3_Rel1",
"riscvToolchain": "RISCV_RPI_2_0_0_5"
}
}
8 changes: 4 additions & 4 deletions scripts/genCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@

# Only provide data for these versions
versions = [
["1.5.1", "2.0.0"],
["v3.28.6", "v3.29.6"],
["1.5.1", "2.0.0", "2.1.0"],
["v3.28.6", "v3.29.6", "v3.29.9"],
["v1.12.1"],
["v1.5.1-0", "v2.0.0-0", "v2.0.0-1", "v2.0.0-2", "v2.0.0-3", "v2.0.0-4", "v2.0.0-5"],
["2.0.0"]
["v1.5.1-0", "v2.0.0-0", "v2.0.0-1", "v2.0.0-2", "v2.0.0-3", "v2.0.0-4", "v2.0.0-5", "v2.1.0-0"],
["2.0.0", "2.1.0"]
]

headers = {
Expand Down
4 changes: 4 additions & 0 deletions src/commands/switchBoard.mts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export default class SwitchBoardCommand extends Command {
quickPickItems.push("pico2");
}

if (!compareLtMajor(sdkVersion, "2.1.0")) {
quickPickItems.push("pico2_w");
}

const sdkPath = buildSDKPath(sdkVersion);

readdirSync(join(sdkPath, "src", "boards", "include", "boards")).forEach(
Expand Down
2 changes: 1 addition & 1 deletion src/commands/switchSDK.mts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ export default class SwitchSDKCommand extends Command {
workspaceFolder.uri,
selectedSDK.sdk,
selectedToolchain.toolchain.version,
selectedPicotool ?? "2.0.0"
selectedPicotool ?? "2.1.0"
);

progress.report({
Expand Down
8 changes: 5 additions & 3 deletions src/utils/cmakeUtil.mts
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,13 @@ export async function cmakeUpdateSDK(

const picoBoard = content.match(picoBoardRegex);
// update the PICO_BOARD variable if it's a pico2 board and the new sdk
// version is less than 2.0.0
// version is less than 2.0.0, or pico2_w and new version <2.1.0
if (
picoBoard !== null &&
picoBoard[1].includes("pico2") &&
compareLtMajor(newSDKVersion, "2.0.0")
((picoBoard[1].includes("pico2") &&
compareLtMajor(newSDKVersion, "2.0.0")) ||
(picoBoard[1].includes('pico2_w') &&
compareLtMajor(newSDKVersion, "2.1.0")))
) {
const result = await window.showQuickPick(["pico", "pico_w"], {
placeHolder: "The new SDK version does not support your current board",
Expand Down
4 changes: 4 additions & 0 deletions src/utils/download.mts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@ const TOOLS_RELEASES: { [key: string]: string } = {
"1.5.1": "v1.5.1-0",
// eslint-disable-next-line @typescript-eslint/naming-convention
"2.0.0": "v2.0.0-5",
// eslint-disable-next-line @typescript-eslint/naming-convention
"2.1.0": "v2.1.0-0",
};

/// Release tags for picotool
const PICOTOOL_RELEASES: { [key: string]: string } = {
// eslint-disable-next-line @typescript-eslint/naming-convention
"2.0.0": "v2.0.0-5",
// eslint-disable-next-line @typescript-eslint/naming-convention
"2.1.0": "v2.1.0-0",
};

/// Release tags for openocd
Expand Down
4 changes: 2 additions & 2 deletions src/utils/examplesUtil.mts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const EXAMPLES_REPOSITORY_URL =
const EXAMPLES_JSON_URL =
"https://raspberrypi.github.io/pico-vscode/" +
`${CURRENT_DATA_VERSION}/examples.json`;
const EXAMPLES_GITREF = "7fe60d6b4027771e45d97f207532c41b1d8c5418";
const EXAMPLES_TAG = "sdk-2.0.0";
const EXAMPLES_GITREF = "b6ac07f1946271de2817f94d8ffc0425ecb7c2a9";
const EXAMPLES_TAG = "sdk-2.1.0";

export interface Example {
path: string;
Expand Down
8 changes: 7 additions & 1 deletion src/webview/newProjectPanel.mts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ enum BoardType {
pico = "pico",
picoW = "pico_w",
pico2 = "pico2",
pico2W = "pico2_w",
other = "other",
}

Expand Down Expand Up @@ -177,6 +178,8 @@ async function enumToBoard(e: BoardType, sdkPath: string): Promise<string> {
return "-board pico_w";
case BoardType.pico2:
return "-board pico2";
case BoardType.pico2W:
return "-board pico2_w";
case BoardType.other:
readdirSync(`${sdkPath}/src/boards/include/boards`).forEach(file => {
quickPickItems.push(file.split(".")[0]);
Expand Down Expand Up @@ -1229,7 +1232,7 @@ export class NewProjectPanel {
theData.hwtimerFeature ? Library.timer : null,
theData.hwwatchdogFeature ? Library.watch : null,
theData.hwclocksFeature ? Library.clocks : null,
theData.boardType === "pico_w"
["pico_w", "pico2_w"].includes(theData.boardType)
? Object.values(PicoWirelessOption)[theData.picoWireless]
: null,
].filter(option => option !== null) as Library[],
Expand Down Expand Up @@ -1749,6 +1752,9 @@ export class NewProjectPanel {
<option id="option-board-type-${
BoardType.picoW
}" value="${BoardType.picoW}">Pico W</option>
<option id="option-board-type-${
BoardType.pico2W
}" value="${BoardType.pico2W}">Pico 2 W</option>
<option id="option-board-type-${
BoardType.other
}" value="${BoardType.other}">Other</option>
Expand Down

0 comments on commit c518847

Please sign in to comment.