Skip to content

Commit

Permalink
Bugfix/idf versions (#1001)
Browse files Browse the repository at this point in the history
* idf versions download with retries fix readme

* idf version to monitor timestamps update changelog

* fix embed python pip

* update changelog

* fix task scope workspace folder

* rm EOL from gitee update submodule

* update changelog
  • Loading branch information
brianignacio5 authored Jun 30, 2023
1 parent bf070b4 commit 4962717
Show file tree
Hide file tree
Showing 15 changed files with 270 additions and 218 deletions.
243 changes: 130 additions & 113 deletions CHANGELOG.md

Large diffs are not rendered by default.

23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="./media/espressif_icon.png" alt="espressif logo" title="Espressif" align="right" height="60" />
</a>

# ESP-IDF VS Code Extension
# ESP-IDF Visual Studio Code Extension

[![Tutorials](https://img.shields.io/badge/-Tutorials-red)](./docs/tutorial/toc.md)
[![Documentation](https://img.shields.io/badge/Documentation-blue)](./docs/ONBOARDING.md)
Expand All @@ -14,18 +14,10 @@

Develop, build, flash, monitor, [debug](./docs/DEBUGGING.md) and [more](./docs/FEATURES.md) with Espressif chips using Espressif IoT Development Framework [(ESP-IDF)](https://github.com/espressif/esp-idf)

**NOTICE**: The `idf.customExtraVars` have change from string to object. Please run the `ESP-IDF: Configure ESP-IDF extension` to update the value.

**Nightly builds** for <a href="https://nightly.link/espressif/vscode-esp-idf-extension/workflows/ci/master/esp-idf-extension.vsix.zip">Visual Studio Code</a> or <a href="https://nightly.link/espressif/vscode-esp-idf-extension/workflows/ci/master/esp-idf-extension-open.vsix.zip">OpenVSX</a>.
**Nightly builds** for <a href="https://nightly.link/espressif/vscode-esp-idf-extension/workflows/ci/master/esp-idf-extension.vsix.zip">Visual Studio Code</a> or <a href="https://nightly.link/espressif/vscode-esp-idf-extension/workflows/ci/master/esp-idf-extension-open.vsix.zip">OpenVSX</a>. You can use this VSIX to test the current github master of the extension by pressing <kbd>F1</kbd> and type `Install from VSIX` and then select the downloaded `.vsix` file to install.

Make sure to review our [documentation](./docs/ONBOARDING.md) first to properly use the extension.

<a href="https://youtu.be/Lc6ausiKvQM">
<p align="center">
<img src="./media/youtube_tutorial_preview.png" alt="Quick User Guide for the ESP-IDF VS Code Extension" width="1024">
</p>
</a>

# Tutorials

1. [Install and setup the extension](./docs/tutorial/install.md).
Expand Down Expand Up @@ -64,7 +56,7 @@ There are few dependencies required in your system and available in environment
- Requirements for [MacOS](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/macos-setup.html#install-prerequisites)
- For Windows the [C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools) might be required.

Installation of ESP-IDF and ESP-IDF Tools is being done from this extension itself (existing ESP-IDF installation may also be reused) using the **ESP-IDF: Configure ESP-IDF extension** setup wizard or following the steps in the [setup documentation](./docs/SETUP.md).
Installation of ESP-IDF and ESP-IDF Tools is being done from this extension itself (existing ESP-IDF installation may also be reused) using the **ESP-IDF: Configure ESP-IDF extension** setup wizard or following the steps in the [setup documentation](./docs/SETUP.md) or following the [install tutorial](./docs/tutorial/install.md).

> **NOTE:** Please note that this extension **only [supports](https://github.com/espressif/esp-idf/blob/master/SUPPORT_POLICY.md)** the release versions of ESP-IDF, you can still use the extension on `master` branch or some other branch, but certain feature might not properly work.
Expand All @@ -76,7 +68,7 @@ Installation of ESP-IDF and ESP-IDF Tools is being done from this extension itse
- On the first time using the extension, press <kbd>F1</kbd> to show the Visual Studio Code Command Palette and type **ESP-IDF: Configure ESP-IDF extension** to open the extension configuration wizard. This will install ESP-IDF, ESP-IDF tools, create a virtual python environment with ESP-IDF and this extension python packages and configure the extension settings with these values. **NOTE: Make sure that there is no spaces in any configured path since [ESP-IDF build system doesn't support spaces yet.](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#start-a-project)**.

> **NOTE:** Please take a look at [SETUP](./docs/SETUP.md) documentation or the [Install](./docs/tutorial/install.md) tutorial for details about extension setup and configuration.
> **NOTE:** Please take a look at [Install tutorial](./docs/tutorial/install.md) documentation or the [Setup documentation](./docs/SETUP.md) for details about extension setup and configuration.
- Press <kbd>F1</kbd> and type **ESP-IDF: Show Examples Projects** to create a new project from ESP-IDF examples.

Expand All @@ -88,10 +80,11 @@ Installation of ESP-IDF and ESP-IDF Tools is being done from this extension itse
- Do some coding!
- Check you set the correct port of your device by pressing <kbd>F1</kbd>, typing **ESP-IDF: Select port to use:** and choosing the serial port your device is connected.
- Select an Espressif target (esp32, esp32s2, etc.) with the **ESP-IDF: Set Espressif device target** command. If you are using one of our boards, use the **ESP-IDF: Select OpenOCD Board Configuration** to choose the openOCD configuration files for the extension openOCD server.
- Select an Espressif target (esp32, esp32s2, etc.) with the **ESP-IDF: Set Espressif device target** command.
- Use the **ESP-IDF: Select OpenOCD Board Configuration** to choose the openOCD configuration files for the extension openOCD server.
- When you are ready, build your project by pressing <kbd>F1</kbd> and typing **ESP-IDF: Build your project**.
- Flash to your device by pressing <kbd>F1</kbd> and typing **ESP-IDF: Select Flash Method and Flash** to select either UART or JTAG. You can also use the **ESP-IDF: Flash (UART) your project** or **ESP-IDF: Flash (with JTag)** directly.
> **NOTE:** When using the **ESP-IDF: Select Flash Method and Flash** command, your choice will be saved in the `idf.flashType` configuration setting.
> **NOTE:** When using the **ESP-IDF: Select Flash Method and Flash** command, your choice will be saved in the `idf.flashType` configuration setting in the current workspace folder's settings.json.
- You can later start a monitor by pressing <kbd>F1</kbd> and typing **ESP-IDF: Monitor your device** which will log the device activity in a Visual Studio Code terminal.
- To make sure you can debug your device, select the your board by pressing <kbd>F1</kbd> and typing **ESP-IDF: Select OpenOCD Board Configuration** or manually define the openOCD configuration files with `idf.openOcdConfigs` configuration in your settings.json.
- If you want to start a debug session, just press F5 (make sure you had at least build and flash once before so the debugger works correctly). Check the [Troubleshooting](#Troubleshooting) section if you have any issues.
Expand Down Expand Up @@ -221,7 +214,7 @@ If something is not working please check for any error on one of these:

4. In Visual Studio Code, select menu "Help" -> `Toggle Developer Tools` and copy any error in the Console tab related to this extension.

5. Make sure that your extension is properly configured as described in [JSON Manual Configuration](./docs/SETUP.md#JSON-Manual-Configuration). Visual Studio Code allows the user to configure settings at different levels: Global (User Settings), Workspace and WorkspaceFolder so make sure your project has the right settings. The doctor command might give the values from user settings instead of the workspace folder settings.
5. Make sure that your extension is properly configured as described in [JSON Manual Configuration](./docs/SETUP.md#JSON-Manual-Configuration). Visual Studio Code allows the user to configure settings at different levels: Global (User Settings), Workspace and Workspace Folder so make sure your project has the right settings. The `ESP-IDF: Doctor command` result might give the values from user settings instead of the workspace folder settings.

6. Review the [OpenOCD troubleshooting FAQ](https://github.com/espressif/openocd-esp32/wiki/Troubleshooting-FAQ) related to the `OpenOCD` output, for application tracing, debug or any OpenOCD related issues.

Expand Down
15 changes: 9 additions & 6 deletions idf_versions.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
v4.1
v4.0.2
v3.3.4
v5.1-rc2
v5.0.2
v4.4.5
v4.3.5
v4.2.4
release/v5.1
release/v5.0
release/v4.4
release/v4.3
release/v4.2
release/v4.1
release/v4.0
release/v3.3
master
14 changes: 11 additions & 3 deletions src/build/buildTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ export class BuildTask {
options.shellArgs = shellExecutableArgs;
}

const curWorkspaceFolder = vscode.workspace.workspaceFolders.find(
(w) => w.uri === this.curWorkspace
);

const isSilentMode = idfConf.readParameter(
"idf.notificationSilentMode",
this.curWorkspace
Expand Down Expand Up @@ -212,7 +216,7 @@ export class BuildTask {
command: "ESP-IDF Compile",
taskId: "idf-compile-task",
},
vscode.TaskScope.Workspace,
curWorkspaceFolder || vscode.TaskScope.Workspace,
"ESP-IDF Compile",
compileExecution,
["espIdf"],
Expand All @@ -234,7 +238,7 @@ export class BuildTask {
} as vscode.TaskPresentationOptions;
TaskManager.addTask(
{ type: "esp-idf", command: "ESP-IDF Build", taskId: "idf-build-task" },
vscode.TaskScope.Workspace,
curWorkspaceFolder || vscode.TaskScope.Workspace,
"ESP-IDF Build",
buildExecution,
["espIdf"],
Expand Down Expand Up @@ -267,6 +271,10 @@ export class BuildTask {
options.shellArgs = shellExecutableArgs;
}

const curWorkspaceFolder = vscode.workspace.workspaceFolders.find(
(w) => w.uri === this.curWorkspace
);

const isSilentMode = idfConf.readParameter(
"idf.notificationSilentMode",
this.curWorkspace
Expand All @@ -288,7 +296,7 @@ export class BuildTask {
command: "ESP-IDF Write DFU.bin",
taskId: "idf-write-dfu-task",
},
vscode.TaskScope.Workspace,
curWorkspaceFolder || vscode.TaskScope.Workspace,
"ESP-IDF Write DFU.bin",
writeExecution,
["espIdf"],
Expand Down
3 changes: 1 addition & 2 deletions src/common/abstractCloning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
import * as idfConf from "../idfConfiguration";
import { PackageProgress } from "../PackageProgress";
import { ESP } from "../config";
import { EOL } from "os";

export class AbstractCloning {
private cloneProcess: ChildProcess;
Expand Down Expand Up @@ -243,7 +242,7 @@ export class AbstractCloning {
repoPath,
OutputChannel.init()
);
const lines = gitModules.split(EOL);
const lines = gitModules.split("\n");

function getSubmoduleUrl(line: string) {
const matches = line.match(
Expand Down
6 changes: 5 additions & 1 deletion src/customTasks/customTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
TaskRevealKind,
TaskScope,
Uri,
workspace,
} from "vscode";
import { readParameter } from "../idfConfiguration";
import { TaskManager } from "../taskManager";
Expand Down Expand Up @@ -115,13 +116,16 @@ export class CustomTask {
clear: false,
panel: TaskPanelKind.Dedicated
} as TaskPresentationOptions;
const curWorkspaceFolder = workspace.workspaceFolders.find(
(w) => w.uri === this.currentWorkspace
);
TaskManager.addTask(
{
type: "esp-idf",
command: `ESP-IDF ${taskName}`,
taskId: `idf-${taskType}-task`,
},
TaskScope.Workspace,
curWorkspaceFolder || TaskScope.Workspace,
`ESP-IDF ${taskName}`,
customExecution,
["espIdf"],
Expand Down
12 changes: 9 additions & 3 deletions src/espIdf/monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ export class IDFMonitor {
if (this.config.noReset && this.config.idfVersion >= "5.0") {
args.splice(2, 0, "--no-reset");
}
if (this.config.enableTimestamps) {
if (this.config.enableTimestamps && this.config.idfVersion >= "4.4") {
args.push("--timestamps");
}
if (this.config.customTimestampFormat.length > 0) {
args.push("--timestamp-format", JSON.stringify(this.config.customTimestampFormat));
if (
this.config.customTimestampFormat.length > 0 &&
this.config.idfVersion >= "4.4"
) {
args.push(
"--timestamp-format",
JSON.stringify(this.config.customTimestampFormat)
);
}
if (this.config.idfVersion >= "4.3") {
args.push("--target", this.config.idfTarget);
Expand Down
11 changes: 6 additions & 5 deletions src/espIdf/size/idfSizeTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
TaskRevealKind,
TaskScope,
Uri,
workspace,
} from "vscode";
import { readParameter } from "../../idfConfiguration";
import { TaskManager } from "../../taskManager";
Expand All @@ -46,10 +47,7 @@ export class IdfSizeTask {
) as string;
const idfPathDir = readParameter("idf.espIdfPath", workspacePath) as string;
this.idfSizePath = join(idfPathDir, "tools", "idf_size.py");
this.buildDirPath = readParameter(
"idf.buildPath",
workspacePath
) as string;
this.buildDirPath = readParameter("idf.buildPath", workspacePath) as string;
}

public async getShellExecution(options: ShellExecutionOptions) {
Expand Down Expand Up @@ -91,6 +89,9 @@ export class IdfSizeTask {
"idf.notificationSilentMode",
this.curWorkspace
) as boolean;
const curWorkspaceFolder = workspace.workspaceFolders.find(
(w) => w.uri === this.curWorkspace
);
const showTaskOutput = isSilentMode
? TaskRevealKind.Always
: TaskRevealKind.Silent;
Expand All @@ -102,7 +103,7 @@ export class IdfSizeTask {
} as TaskPresentationOptions;
TaskManager.addTask(
{ type: "esp-idf", command: "ESP-IDF Size", taskId: "idf-size-task" },
TaskScope.Workspace,
curWorkspaceFolder || TaskScope.Workspace,
"ESP-IDF Size",
sizeExecution,
["espIdf"],
Expand Down
Loading

0 comments on commit 4962717

Please sign in to comment.