Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
0714612
Add command to setup venv in pico-sdk folder
May 14, 2025
62af60d
Install west in venv python
May 15, 2025
7eb5a0d
Create zephyr manifest in pico directory
May 15, 2025
1435d7a
Perform west init and update to setup Zephyr
May 15, 2025
43dce25
Install zephyr sdk and blobs
May 15, 2025
61e07b9
Move all zephyr downloads to zephyr_workspace directory
May 15, 2025
f2bdb3c
Add debug information to zephyr setup
May 15, 2025
d2616a7
Move zephyr venv to zephyr_workspace directory
May 15, 2025
5e1b6cb
Rename command and refactor internal functions
May 15, 2025
d57342b
Refactor west initialisation and make exe paths portable
May 15, 2025
ff029b9
Trigger openocd download and install at end of zephyr setup
May 15, 2025
5215232
Add command to get west path
May 15, 2025
883272f
Add command to get Zephyr workspace path
May 16, 2025
f3607ce
Create new Zephyr project based on app example
May 16, 2025
4ac556b
Check for Zephyr projects which can use the pico extension
May 16, 2025
b98e090
Move Zephyr project generation to new file
May 16, 2025
deb82f0
Simplify Zephyr project generation
May 16, 2025
af47a2a
Move manifest creation to top of Zephyr setup function
May 16, 2025
f9d2713
Fix missing await to create zephyr workspace
May 16, 2025
efdf968
Setup embeddable Python for package installation
May 21, 2025
868a60a
Setup CMake and Ninja as part of Zephyr install
May 23, 2025
080e30c
Run zephyr export command when setting up Zephyr
May 27, 2025
761012d
Copy MicroPython project panel for Zephyr
Jun 4, 2025
116d225
Zephyr panel performs simple Zephyr project creation
Jun 7, 2025
32ccd6f
Add New Zephyr Project panel to activity bar
Jun 7, 2025
38fdd12
Create Zephyr project from panel with USB console choice
Jun 11, 2025
c6ee073
Create project for different boards
Jun 11, 2025
8f2282c
Add command for switching boards for Zephyr
Jun 11, 2025
7348ae3
Implement board switching for Zephyr projects
Jun 12, 2025
fd0bbe5
Identify possible issues when switching board for Zephyr and fail wit…
Jun 12, 2025
7341d64
Implement board switching via activity bar and when loading project
Jun 12, 2025
b5ca17a
Add Kconfig settings to Zephyr project creation
Jun 12, 2025
4f25125
Enable Run Project command for Zephyr
Jun 12, 2025
b98c891
Temporarily point to fork which supports Pico 2W
Jun 12, 2025
caedeb9
Move Python installation further up in Zephyr setup
Jun 13, 2025
4eec560
Setup dtc, wget and gperf for windows Zephyr
Jun 13, 2025
b2a2577
Install 7zip durign Zephyr installation for Windows
Jun 13, 2025
368cbf6
Add Zephyr tools to path during setup
Jun 13, 2025
273c5a1
Get path set correctly for windows and linux
Jun 13, 2025
2cea3e9
Fix Zephyr SDK installation step
Jun 13, 2025
ef8999d
Fix sensor kconfig value
Jun 19, 2025
d29af69
Add picotool installation to Zephyr setup
Jun 20, 2025
c0f8532
Improve installation process of python, venv and 7zip
Jun 20, 2025
ea4b734
Refactor: Separate out Zephyr setup functionality and add to new Zephyr
Jun 20, 2025
31eb6ea
Add kconfig net shell to wifi shell option by default
Jun 20, 2025
8dfa806
Remove Python path selection from Zephyr project generation temporarily
Jun 20, 2025
399493d
Add progress bars and reports to Zephyr setup
Jul 30, 2025
96c85ab
Move the rest of Zephyr setup into async format with progress bars
Aug 1, 2025
42d46b6
Handle different CMake setups
Aug 20, 2025
3978c84
Improve CMake flexibility for Zephyr setup
Aug 23, 2025
4d10bf7
Fix integration of zephyr (part 1)
paulober Sep 9, 2025
7d743a0
Fix zephyr project creation UI
paulober Sep 15, 2025
9effa2f
Fix zephyr integration (part 2)
paulober Sep 17, 2025
ae0b674
Fix zephyr integration (part 3)
paulober Sep 17, 2025
f8d40e9
Fix zephyr integration (part 4)
paulober Sep 18, 2025
e1ace0b
Fix zephyr integration (part 5)
paulober Sep 18, 2025
ac6a004
Fix zephyr integration (part 6)
paulober Sep 19, 2025
d8468bf
Add zephyr setup on opening of zephyr pico projects
paulober Sep 19, 2025
f80c4c2
Add zephyr setup on opening of zephyr pico projects
paulober Sep 19, 2025
b693928
Update Windows Python download to 3.13.7
paulober Sep 22, 2025
0fec6be
Add custom ninja support for Zephyr project generation
Sep 22, 2025
c00b3d4
Fix ninja selection for Zephyr projects + clean-up
paulober Sep 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"activationEvents": [
"workspaceContains:./pico_sdk_import.cmake",
"workspaceContains:./.pico-rs",
"workspaceContains:./prj.conf",
"onWebviewPanel:newPicoProject",
"onWebviewPanel:newPicoMicroPythonProject"
],
Expand All @@ -80,13 +81,13 @@
"command": "raspberry-pi-pico.switchSDK",
"title": "Switch Pico SDK",
"category": "Raspberry Pi Pico",
"enablement": "raspberry-pi-pico.isPicoProject && !raspberry-pi-pico.isRustProject"
"enablement": "raspberry-pi-pico.isPicoProject && !raspberry-pi-pico.isRustProject && !raspberry-pi-pico.isZephyrProject"
},
{
"command": "raspberry-pi-pico.switchBoard",
"title": "Switch Board",
"category": "Raspberry Pi Pico",
"enablement": "raspberry-pi-pico.isPicoProject && !raspberry-pi-pico.isRustProject"
"enablement": "raspberry-pi-pico.isPicoProject"
},
{
"command": "raspberry-pi-pico.launchTargetPath",
Expand Down Expand Up @@ -159,13 +160,25 @@
"title": "Get OpenOCD root",
"category": "Raspberry Pi Pico",
"enablement": "false"
},
},
{
"command": "raspberry-pi-pico.getSVDPath",
"title": "Get SVD Path (rust only)",
"category": "Raspberry Pi Pico",
"enablement": "false"
},
{
"command": "raspberry-pi-pico.getWestPath",
"title": "Get West path",
"category": "Raspberry Pi Pico",
"enablement": "false"
},
{
"command": "raspberry-pi-pico.getZephyrWorkspacePath",
"title": "Get Zephyr workspace path",
"category": "Raspberry Pi Pico",
"enablement": "false"
},
{
"command": "raspberry-pi-pico.compileProject",
"title": "Compile Pico Project",
Expand Down Expand Up @@ -210,7 +223,7 @@
"command": "raspberry-pi-pico.switchBuildType",
"title": "Switch Build Type",
"category": "Raspberry Pi Pico",
"enablement": "raspberry-pi-pico.isPicoProject && !raspberry-pi-pico.isRustProject"
"enablement": "raspberry-pi-pico.isPicoProject && !raspberry-pi-pico.isRustProject && !raspberry-pi-pico.isZephyrProject"
},
{
"command": "raspberry-pi-pico.importProject",
Expand Down Expand Up @@ -244,12 +257,6 @@
"category": "Raspberry Pi Pico",
"enablement": "raspberry-pi-pico.isPicoProject && !raspberry-pi-pico.isRustProject"
},
{
"command": "raspberry-pi-pico.getRTTDecoderPath",
"title": "Get RTT Decoder module path",
"category": "Raspberry Pi Pico",
"enablement": "false"
},
{
"command": "raspberry-pi-pico.sbomTargetPathDebug",
"title": "Get path of the project debug SBOM (rust only)",
Expand Down
1 change: 1 addition & 0 deletions scripts/pico_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ def generateProjectFiles(
]
}

# TODO: use get picotool path command!
tasks = f"""{{
"version": "2.0.0",
"tasks": [
Expand Down
28 changes: 14 additions & 14 deletions src/commands/configureCmake.mts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export default class ConfigureCmakeCommand extends Command {
} else {
void window.showWarningMessage(
"CMake failed to configure your build. " +
"See the developer console for details " +
"(Help -> Toggle Developer Tools). " +
"You can also use the CMake Tools Extension Integration " +
"to get more information about the error."
"See the developer console for details " +
"(Help -> Toggle Developer Tools). " +
"You can also use the CMake Tools Extension Integration " +
"to get more information about the error."
);
}
}
Expand Down Expand Up @@ -110,15 +110,15 @@ export class CleanCMakeCommand extends Command {
} else {
void window.showWarningMessage(
"CMake could not be reconfigured. " +
"See the developer console for details " +
"(Help -> Toggle Developer Tools). " +
"You can also use the CMake Tools Extension Integration " +
"to get more information about the error."
"See the developer console for details " +
"(Help -> Toggle Developer Tools). " +
"You can also use the CMake Tools Extension Integration " +
"to get more information about the error."
);
}

const ws = workspaceFolder.uri.fsPath;
const cMakeCachePath = join(ws, "build","CMakeCache.txt");
const cMakeCachePath = join(ws, "build", "CMakeCache.txt");
const newBuildType = cmakeGetPicoVar(cMakeCachePath, "CMAKE_BUILD_TYPE");
this._ui.updateBuildType(newBuildType ?? "unknown");
}
Expand Down Expand Up @@ -159,7 +159,7 @@ export class SwitchBuildTypeCommand extends Command {
}

const ws = workspaceFolder.uri.fsPath;
const cMakeCachePath = join(ws, "build","CMakeCache.txt");
const cMakeCachePath = join(ws, "build", "CMakeCache.txt");
const oldBuildType = cmakeGetPicoVar(cMakeCachePath, "CMAKE_BUILD_TYPE");

// QuickPick for the build type
Expand All @@ -173,10 +173,10 @@ export class SwitchBuildTypeCommand extends Command {
} else {
void window.showWarningMessage(
"CMake failed to configure your build. " +
"See the developer console for details " +
"(Help -> Toggle Developer Tools). " +
"You can also use the CMake Tools Extension Integration " +
"to get more information about the error."
"See the developer console for details " +
"(Help -> Toggle Developer Tools). " +
"You can also use the CMake Tools Extension Integration " +
"to get more information about the error."
);
}

Expand Down
127 changes: 120 additions & 7 deletions src/commands/getPaths.mts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
buildPicotoolPath,
buildSDKPath,
buildToolchainPath,
buildWestPath,
buildZephyrWorkspacePath,
downloadAndInstallOpenOCD,
downloadAndInstallPicotool,
} from "../utils/download.mjs";
Expand All @@ -26,10 +28,19 @@ import { getSupportedToolchains } from "../utils/toolchainUtil.mjs";
import Logger from "../logger.mjs";
import { rustProjectGetSelectedChip } from "../utils/rustUtil.mjs";
import { OPENOCD_VERSION } from "../utils/sharedConstants.mjs";
import {
getBoardFromZephyrProject,
ZEPHYR_PICO,
ZEPHYR_PICO2,
ZEPHYR_PICO2_W,
ZEPHYR_PICO_W,
} from "./switchBoard.mjs";

export class GetPythonPathCommand extends CommandWithResult<string> {
public static readonly id = "getPythonPath";

constructor() {
super("getPythonPath");
super(GetPythonPathCommand.id);
}

async execute(): Promise<string> {
Expand All @@ -47,8 +58,10 @@ export class GetPythonPathCommand extends CommandWithResult<string> {
}

export class GetEnvPathCommand extends CommandWithResult<string> {
public static readonly id = "getEnvPath";

constructor() {
super("getEnvPath");
super(GetEnvPathCommand.id);
}

async execute(): Promise<string> {
Expand All @@ -66,8 +79,10 @@ export class GetEnvPathCommand extends CommandWithResult<string> {
}

export class GetGDBPathCommand extends CommandWithResult<string> {
public static readonly id = "getGDBPath";

constructor(private readonly _extensionUri: Uri) {
super("getGDBPath");
super(GetGDBPathCommand.id);
}

async execute(): Promise<string> {
Expand Down Expand Up @@ -157,8 +172,10 @@ export class GetGDBPathCommand extends CommandWithResult<string> {
}

export class GetCompilerPathCommand extends CommandWithResult<string> {
public static readonly id = "getCompilerPath";

constructor() {
super("getCompilerPath");
super(GetCompilerPathCommand.id);
}

async execute(): Promise<string> {
Expand Down Expand Up @@ -196,8 +213,10 @@ export class GetCompilerPathCommand extends CommandWithResult<string> {
}

export class GetCxxCompilerPathCommand extends CommandWithResult<string> {
public static readonly id = "getCxxCompilerPath";

constructor() {
super("getCxxCompilerPath");
super(GetCxxCompilerPathCommand.id);
}

async execute(): Promise<string> {
Expand Down Expand Up @@ -253,6 +272,37 @@ export class GetChipCommand extends CommandWithResult<string> {

const workspaceFolder = workspace.workspaceFolders?.[0];
const isRustProject = State.getInstance().isRustProject;
const isZephyrProject = State.getInstance().isZephyrProject;

if (isZephyrProject) {
const board = await getBoardFromZephyrProject(
join(workspaceFolder.uri.fsPath, ".vscode", "tasks.json")
);

if (board === undefined) {
this._logger.error("Failed to read Zephyr board from tasks.json");

return "";
}

switch (board) {
case ZEPHYR_PICO:
case ZEPHYR_PICO_W:
return "rp2040";
case ZEPHYR_PICO2:
case ZEPHYR_PICO2_W:
return "rp2350";
default:
this._logger.error(`Unsupported Zephyr board: ${board}`);
void window.showErrorMessage(
`Unsupported Zephyr board: ${board}. ` +
`Supported boards are: ${ZEPHYR_PICO}, ${ZEPHYR_PICO_W}, ` +
`${ZEPHYR_PICO2}, ${ZEPHYR_PICO2_W}`
);

return "rp2040";
}
}

if (isRustProject) {
// read .pico-rs
Expand Down Expand Up @@ -307,8 +357,10 @@ export class GetChipCommand extends CommandWithResult<string> {
}

export class GetChipUppercaseCommand extends CommandWithResult<string> {
public static readonly id = "getChipUppercase";

constructor() {
super("getChipUppercase");
super(GetChipUppercaseCommand.id);
}

async execute(): Promise<string> {
Expand All @@ -320,8 +372,10 @@ export class GetChipUppercaseCommand extends CommandWithResult<string> {
}

export class GetTargetCommand extends CommandWithResult<string> {
public static readonly id = "getTarget";

constructor() {
super("getTarget");
super(GetTargetCommand.id);
}

async execute(): Promise<string> {
Expand All @@ -334,7 +388,28 @@ export class GetTargetCommand extends CommandWithResult<string> {

const workspaceFolder = workspace.workspaceFolders?.[0];
const isRustProject = State.getInstance().isRustProject;
const isZephyrProject = State.getInstance().isZephyrProject;

if (isZephyrProject) {
const board = await getBoardFromZephyrProject(
join(workspaceFolder.uri.fsPath, ".vscode", "tasks.json")
);

if (board === undefined) {
return "rp2040";
}

switch (board) {
case ZEPHYR_PICO:
case ZEPHYR_PICO_W:
return "rp2040";
case ZEPHYR_PICO2:
case ZEPHYR_PICO2_W:
return "rp2350";
default:
return "rp2040";
}
}
if (isRustProject) {
const chip = rustProjectGetSelectedChip(workspaceFolder.uri.fsPath);

Expand Down Expand Up @@ -505,3 +580,41 @@ export class GetSVDPathCommand extends CommandWithResult<string | undefined> {
);
}
}

export class GetWestPathCommand extends CommandWithResult<string | undefined> {
public static readonly id = "getWestPath";

constructor() {
super(GetWestPathCommand.id);
}

execute(): string | undefined {
const result = buildWestPath();

if (result === null || !result) {
return undefined;
}

return result;
}
}

export class GetZephyrWorkspacePathCommand extends CommandWithResult<
string | undefined
> {
public static readonly id = "getZephyrWorkspacePath";

constructor() {
super(GetZephyrWorkspacePathCommand.id);
}

execute(): string | undefined {
const result = buildZephyrWorkspacePath();

if (result === null || !result) {
return undefined;
}

return result;
}
}
Loading
Loading