diff --git a/docs_espressif/en/additionalfeatures/docker-container.rst b/docs_espressif/en/additionalfeatures/docker-container.rst index e39a1afa8..962ebe316 100644 --- a/docs_espressif/en/additionalfeatures/docker-container.rst +++ b/docs_espressif/en/additionalfeatures/docker-container.rst @@ -123,11 +123,11 @@ for a list of USB serial devices. .. note:: this command needs to be used only one time,unless the computer has restarted. **1-1** is the device's bus id ```` I would like to bind. -5. After binding, please attach the specified device to WSL with this command in the Powershell command prompt. +5. After binding, please attach the specified device to WSL with this command in the Powershell command prompt. The ``--auto-attach`` parameter allows the device to be visible in the container after unplug and plug. .. code-block:: - usbipd attach --wsl --busid + usbipd attach --wsl --busid --auto-attach 6. At last, let us check if it works well on both side and type this command on WSL side. @@ -231,6 +231,9 @@ Create a Container At this moment, you can start to use the ``Blink`` example project for building, flashing, monitoring, debugging, etc. +.. warning:: + * In order to have access to the serial port from the Docker container, make sure you have attached the device with ``usbipd attach --wsl --busid --auto-attach`` **BEFORE** opening the folder in container in VS Code otherwise it won't be visible. If you want to be able to plug and unplug the device and still see it in the docker container don't forget the ``--auto-attach`` usbipd parameter. + 3. Here taking the esp32-c3 as an example, users only need to change the target device from ``esp32`` to ``esp32-c3``, as below: .. image:: ../../../media/tutorials/using_docker_container/device_target_esp32_c3.png diff --git a/l10n/bundle.l10n.es.json b/l10n/bundle.l10n.es.json index 2be741f1d..1aa0de980 100644 --- a/l10n/bundle.l10n.es.json +++ b/l10n/bundle.l10n.es.json @@ -62,6 +62,8 @@ "{destFolder} already exists.": "{destFolder} ya existe.", "ESP-IDF Project has been imported": "El proyecto ESP-IDF ha sido importado.", "Merging binaries for flashing": "Fusionar binarios para flashear", + "ESP-IDF: Starting ESP-IDF QEMU Debug": "ESP-IDF: Iniciando la depuración QEMU de ESP-IDF", + "Error launching QEMU debugging": "Error al iniciar la depuración de QEMU", "Select a partition to use": "Seleccione una partición para usar", "Enter custom partition table offset": "Ingrese el desplazamiento de la tabla de particiones personalizada", "Flash binary to this partition": "Flash binario a esta partición", diff --git a/l10n/bundle.l10n.pt.json b/l10n/bundle.l10n.pt.json index a064300a0..42fe8c041 100644 --- a/l10n/bundle.l10n.pt.json +++ b/l10n/bundle.l10n.pt.json @@ -62,6 +62,8 @@ "{destFolder} already exists.": "{destFolder} já existe.", "ESP-IDF Project has been imported": "O projeto ESP-IDF foi importado", "Merging binaries for flashing": "Mesclando binários para piscar", + "ESP-IDF: Starting ESP-IDF QEMU Debug": "ESP-IDF: Iniciando a depuração ESP-IDF QEMU", + "Error launching QEMU debugging": "Erro ao iniciar a depuração do QEMU", "Select a partition to use": "Selecione uma partição para usar", "Enter custom partition table offset": "Insira o deslocamento da tabela de partição personalizada", "Flash binary to this partition": "Flash binário para esta partição", diff --git a/l10n/bundle.l10n.ru.json b/l10n/bundle.l10n.ru.json index 75317990b..45f54e41a 100644 --- a/l10n/bundle.l10n.ru.json +++ b/l10n/bundle.l10n.ru.json @@ -62,6 +62,8 @@ "{destFolder} already exists.": "{destFolder} уже существует.", "ESP-IDF Project has been imported": "Проект ESP-IDF импортирован.", "Merging binaries for flashing": "Объединение бинарников для перепрошивки", + "ESP-IDF: Starting ESP-IDF QEMU Debug": "ESP-IDF: запуск отладки ESP-IDF QEMU", + "Error launching QEMU debugging": "Ошибка запуска отладки QEMU", "Select a partition to use": "Выберите раздел для использования", "Enter custom partition table offset": "Введите пользовательское смещение таблицы разделов", "Flash binary to this partition": "Записать двоичный файл в этот раздел", diff --git a/l10n/bundle.l10n.zh-CN.json b/l10n/bundle.l10n.zh-CN.json index e6ecd905d..e27cf0ded 100644 --- a/l10n/bundle.l10n.zh-CN.json +++ b/l10n/bundle.l10n.zh-CN.json @@ -62,6 +62,8 @@ "{destFolder} already exists.": "{destFolder} 已存在。", "ESP-IDF Project has been imported": "ESP-IDF 项目已导入", "Merging binaries for flashing": "合并二进制文件以进行闪烁", + "ESP-IDF: Starting ESP-IDF QEMU Debug": "ESP-IDF:启动 ESP-IDF QEMU 调试", + "Error launching QEMU debugging": "启动 QEMU 调试时出错", "Select a partition to use": "选择要使用的分区", "Enter custom partition table offset": "输入自定义分区表偏移量", "Flash binary to this partition": "将二进制文件烧录到该分区", diff --git a/src/build/buildCmd.ts b/src/build/buildCmd.ts index ed62671d0..954251a9e 100644 --- a/src/build/buildCmd.ts +++ b/src/build/buildCmd.ts @@ -86,6 +86,15 @@ export async function buildCommand( await TaskManager.runTasks(); } } + const buildDirPath = readParameter( + "idf.buildPath", + workspace + ) as string; + const qemuBinPath = join(buildDirPath, "merged_qemu.bin"); + const qemuBinExists = await pathExists(qemuBinPath); + if (qemuBinExists) { + await vscode.workspace.fs.delete(vscode.Uri.file(qemuBinPath)); + } if (!cancelToken.isCancellationRequested) { updateIdfComponentsTree(workspace); Logger.infoNotify("Build Successfully"); diff --git a/src/extension.ts b/src/extension.ts index b40a72268..9a65ebc34 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -110,7 +110,7 @@ import { configureProjectWithGcov } from "./coverage/configureProject"; import { ComponentManagerUIPanel } from "./component-manager/panel"; import { verifyAppBinary } from "./espIdf/debugAdapter/verifyApp"; import { mergeFlashBinaries } from "./qemu/mergeFlashBin"; -import { IQemuOptions, QemuManager } from "./qemu/qemuManager"; +import { QemuLaunchMode, QemuManager } from "./qemu/qemuManager"; import { PartitionItem, PartitionTreeDataProvider, @@ -360,9 +360,38 @@ export async function activate(context: vscode.ExtensionContext) { } else { UpdateCmakeLists.updateSrcsInCmakeLists(e.fsPath, srcOp.other); } + await binTimestampEventFunc(e); }); context.subscriptions.push(srcWatchOnChangeDisposable); + const buildWatcher = vscode.workspace.createFileSystemWatcher( + "**/.bin_timestamp", + false, + false, + true + ); + + const binTimestampEventFunc = async (e: vscode.Uri) => { + const buildDirPath = idfConf.readParameter( + "idf.buildPath", + workspaceRoot + ) as string; + const qemuBinPath = path.join(buildDirPath, "merged_qemu.bin"); + const qemuBinExists = await pathExists(qemuBinPath); + if (qemuBinExists) { + await vscode.workspace.fs.delete(vscode.Uri.file(qemuBinPath)); + } + }; + + const buildWatcherDisposable = buildWatcher.onDidChange( + binTimestampEventFunc + ); + context.subscriptions.push(buildWatcherDisposable); + const buildWatcherCreateDisposable = buildWatcher.onDidCreate( + binTimestampEventFunc + ); + context.subscriptions.push(buildWatcherCreateDisposable); + vscode.workspace.onDidChangeWorkspaceFolders(async (e) => { if (PreCheck.isWorkspaceFolderOpen()) { for (const ws of e.removed) { @@ -430,9 +459,6 @@ export async function activate(context: vscode.ExtensionContext) { workspace: workspaceRoot, } as IOpenOCDConfig; openOCDManager.configureServer(openOCDConfig); - qemuManager.configure({ - workspaceFolder: workspaceRoot, - } as IQemuOptions); } ConfserverProcess.dispose(); }); @@ -968,9 +994,6 @@ export async function activate(context: vscode.ExtensionContext) { workspace: workspaceRoot, } as IOpenOCDConfig; openOCDManager.configureServer(openOCDConfig); - qemuManager.configure({ - workspaceFolder: workspaceRoot, - } as IQemuOptions); ConfserverProcess.dispose(); const coverageOptions = getCoverageOptions(workspaceRoot); covRenderer = new CoverageRenderer(workspaceRoot, coverageOptions); @@ -1177,10 +1200,6 @@ export async function activate(context: vscode.ExtensionContext) { } } else if (e.affectsConfiguration("idf.espIdfPath" + winFlag)) { ESP.URL.Docs.IDF_INDEX = undefined; - } else if (e.affectsConfiguration("idf.qemuTcpPort")) { - qemuManager.configure({ - tcpPort: idfConf.readParameter("idf.qemuTcpPort", workspaceRoot), - } as IQemuOptions); } else if (e.affectsConfiguration("idf.port" + winFlag)) { if (statusBarItems && statusBarItems["port"]) { statusBarItems["port"].text = @@ -2440,52 +2459,79 @@ export async function activate(context: vscode.ExtensionContext) { registerIDFCommand("espIdf.qemuDebug", () => { PreCheck.perform([openFolderCheck], async () => { - if (IDFMonitor.terminal) { - IDFMonitor.terminal.sendText(ESP.CTRL_RBRACKET); - } - const buildDirPath = idfConf.readParameter( - "idf.buildPath", + const notificationMode = idfConf.readParameter( + "idf.notificationMode", workspaceRoot ) as string; - const qemuBinExists = await pathExists( - path.join(buildDirPath, "merged_qemu.bin") - ); - if (!qemuBinExists) { - await mergeFlashBinaries(workspaceRoot); - } - if (qemuManager.isRunning()) { - qemuManager.stop(); - await utils.sleep(1000); - } - qemuManager.configureWithDefValues(); - qemuManager.start(); - const gdbPath = await utils.getToolchainPath(workspaceRoot, "gdb"); - const workspaceFolder = vscode.workspace.getWorkspaceFolder( - workspaceRoot - ); - await vscode.debug.startDebugging(workspaceFolder, { - name: "GDB QEMU", - type: "gdbtarget", - request: "attach", - sessionID: "qemu.debug.session", - gdb: gdbPath, - initCommands: [ - "set remote hardware-watchpoint-limit {IDF_TARGET_CPU_WATCHPOINT_NUM}", - "mon reset halt", - "maintenance flush register-cache", - "thb app_main", - ], - target: { - type: "remote", - host: "localhost", - port: "1234", + const ProgressLocation = + notificationMode === idfConf.NotificationMode.All || + notificationMode === idfConf.NotificationMode.Notifications + ? vscode.ProgressLocation.Notification + : vscode.ProgressLocation.Window; + await vscode.window.withProgress( + { + cancellable: true, + location: ProgressLocation, + title: vscode.l10n.t("ESP-IDF: Starting ESP-IDF QEMU Debug"), }, - }); - vscode.debug.onDidTerminateDebugSession(async (session) => { - if (session.configuration.sessionID === "qemu.debug.session") { - qemuManager.stop(); + async ( + progress: vscode.Progress<{ message: string; increment: number }>, + cancelToken: vscode.CancellationToken + ) => { + try { + if (IDFMonitor.terminal) { + IDFMonitor.terminal.sendText(ESP.CTRL_RBRACKET); + } + const buildDirPath = idfConf.readParameter( + "idf.buildPath", + workspaceRoot + ) as string; + const qemuBinExists = await pathExists( + path.join(buildDirPath, "merged_qemu.bin") + ); + if (!qemuBinExists) { + await mergeFlashBinaries(workspaceRoot); + } + if (qemuManager.isRunning()) { + qemuManager.stop(); + await utils.sleep(1000); + } + await qemuManager.start(QemuLaunchMode.Debug, workspaceRoot); + const gdbPath = await utils.getToolchainPath(workspaceRoot, "gdb"); + const workspaceFolder = vscode.workspace.getWorkspaceFolder( + workspaceRoot + ); + await vscode.debug.startDebugging(workspaceFolder, { + name: "GDB QEMU", + type: "gdbtarget", + request: "attach", + sessionID: "qemu.debug.session", + gdb: gdbPath, + initCommands: [ + "set remote hardware-watchpoint-limit {IDF_TARGET_CPU_WATCHPOINT_NUM}", + "mon reset halt", + "maintenance flush register-cache", + "thb app_main", + ], + target: { + type: "remote", + host: "localhost", + port: "1234", + }, + }); + vscode.debug.onDidTerminateDebugSession(async (session) => { + if (session.configuration.sessionID === "qemu.debug.session") { + qemuManager.stop(); + } + }); + } catch (error) { + const msg = error.message + ? error.message + : vscode.l10n.t("Error launching QEMU debugging"); + Logger.errorNotify(msg, error, "extension qemu debug"); + } } - }); + ); }); }); @@ -3870,35 +3916,62 @@ const flash = ( function createQemuMonitor() { PreCheck.perform([openFolderCheck], async () => { - const isQemuLaunched = qemuManager.isRunning(); - if (isQemuLaunched) { - qemuManager.stop(); - } - const qemuTcpPort = idfConf.readParameter( - "idf.qemuTcpPort", - workspaceRoot - ) as number; - qemuManager.configure({ - launchArgs: [ - "-nographic", - "-machine", - "esp32", - "-drive", - "file=build/merged_qemu.bin,if=mtd,format=raw", - "-monitor stdio", - `-serial tcp::${qemuTcpPort},server,nowait`, - ], - } as IQemuOptions); - await qemuManager.start(); - if (IDFMonitor.terminal) { - await utils.sleep(1000); - } - const serialPort = `socket://localhost:${qemuTcpPort}`; - const noReset = idfConf.readParameter( - "idf.monitorNoReset", + const notificationMode = idfConf.readParameter( + "idf.notificationMode", workspaceRoot - ) as boolean; - await createNewIdfMonitor(workspaceRoot, noReset, serialPort); + ) as string; + const ProgressLocation = + notificationMode === idfConf.NotificationMode.All || + notificationMode === idfConf.NotificationMode.Notifications + ? vscode.ProgressLocation.Notification + : vscode.ProgressLocation.Window; + await vscode.window.withProgress( + { + cancellable: true, + location: ProgressLocation, + title: "ESP-IDF: Starting ESP-IDF QEMU Monitor", + }, + async ( + progress: vscode.Progress<{ message: string; increment: number }>, + cancelToken: vscode.CancellationToken + ) => { + try { + const isQemuLaunched = qemuManager.isRunning(); + if (isQemuLaunched) { + qemuManager.stop(); + } + const buildDirPath = idfConf.readParameter( + "idf.buildPath", + workspaceRoot + ) as string; + const qemuBinExists = await pathExists( + path.join(buildDirPath, "merged_qemu.bin") + ); + if (!qemuBinExists) { + await mergeFlashBinaries(workspaceRoot); + } + const qemuTcpPort = idfConf.readParameter( + "idf.qemuTcpPort", + workspaceRoot + ) as string; + await qemuManager.start(QemuLaunchMode.Monitor, workspaceRoot); + if (IDFMonitor.terminal) { + await utils.sleep(1000); + } + const serialPort = `socket://localhost:${qemuTcpPort}`; + const noReset = idfConf.readParameter( + "idf.monitorNoReset", + workspaceRoot + ) as boolean; + await createNewIdfMonitor(workspaceRoot, noReset, serialPort); + } catch (error) { + const msg = error.message + ? error.message + : "Error launching QEMU monitor"; + Logger.errorNotify(msg, error, "extension qemu monitor"); + } + } + ); }); } diff --git a/src/qemu/qemuManager.ts b/src/qemu/qemuManager.ts index 373120907..e83dcc09d 100644 --- a/src/qemu/qemuManager.ts +++ b/src/qemu/qemuManager.ts @@ -18,6 +18,7 @@ import { EventEmitter } from "events"; import { + commands, env, StatusBarAlignment, StatusBarItem, @@ -25,22 +26,17 @@ import { TreeItemCheckboxState, Uri, window, - workspace, } from "vscode"; import { ESP } from "../config"; import { readParameter } from "../idfConfiguration"; import { Logger } from "../logger/logger"; -import { appendIdfAndToolsToPath, isBinInPath, PreCheck } from "../utils"; import { statusBarItems } from "../statusBar"; -import { - CommandKeys, - createCommandDictionary, -} from "../cmdTreeView/cmdStore"; +import { CommandKeys, createCommandDictionary } from "../cmdTreeView/cmdStore"; +import { appendIdfAndToolsToPath, isBinInPath } from "../utils"; -export interface IQemuOptions { - launchArgs: string[]; - tcpPort: string; - workspaceFolder: Uri; +export enum QemuLaunchMode { + Debug, + Monitor, } export class QemuManager extends EventEmitter { @@ -51,14 +47,12 @@ export class QemuManager extends EventEmitter { return QemuManager.instance; } private static instance: QemuManager; - private execString = "qemu-system-xtensa"; private qemuTerminal: Terminal; - private options: IQemuOptions; private _statusBarItem: StatusBarItem; private constructor() { super(); - this.configureWithDefValues(); + this.registerQemuStatusBarItem(); } public statusBarItem(): StatusBarItem { @@ -71,30 +65,34 @@ export class QemuManager extends EventEmitter { } public async commandHandler() { - const pickItems = []; - if (!QemuManager.instance.isRunning()) { - pickItems.push({ - label: "Start QEMU", + const pickItems = [ + { + label: "QEMU Monitor", description: "", - }); - } else { - pickItems.push({ + }, + { + label: "QEMU Debug", + description: "", + }, + { label: "Stop QEMU", description: "", - }); - } + }, + ]; const selectedOption = await window.showQuickPick(pickItems); if (!selectedOption) { return; } - try { switch (selectedOption.label) { - case "Start QEMU": - await QemuManager.instance.start(); - break; case "Stop QEMU": - await QemuManager.instance.stop(); + QemuManager.instance.stop(); + break; + case "QEMU Monitor": + commands.executeCommand("espIdf.monitorQemu"); + break; + case "QEMU Debug": + commands.executeCommand("espIdf.qemuDebug"); break; default: break; @@ -105,105 +103,86 @@ export class QemuManager extends EventEmitter { } } - public configure(config: IQemuOptions) { - if (!this.options) { - this.options = {} as IQemuOptions; - } - if (config.launchArgs) { - this.options.launchArgs = config.launchArgs; - } - if (config.tcpPort) { - this.options.tcpPort = config.tcpPort; - } - if (config.workspaceFolder) { - this.options.workspaceFolder = config.workspaceFolder; - } - this.registerQemuStatusBarItem(); - } - - public configureWithDefValues() { - let workspaceFolder: Uri; - if (PreCheck.isWorkspaceFolderOpen()) { - workspaceFolder = workspace.workspaceFolders[0].uri; - } - const defOptions = { - launchArgs: [ + public getLaunchArguments( + mode: QemuLaunchMode, + idfTarget: string, + workspaceFolder: Uri + ) { + const buildPath = readParameter("idf.buildPath", workspaceFolder) as string; + const qemuFile = Uri.joinPath(Uri.file(buildPath), "merged_qemu.bin"); + const qemuTcpPort = readParameter( + "idf.qemuTcpPort", + workspaceFolder + ) as string; + + if (mode === QemuLaunchMode.Debug) { + return [ "-nographic", "-s", "-S", "-machine", - "esp32", + idfTarget, "-drive", - "file=build/merged_qemu.bin,if=mtd,format=raw", - ], - tcpPort: readParameter("idf.qemuTcpPort", workspaceFolder), - workspaceFolder, - } as IQemuOptions; - this.configure(defOptions); + `file='${qemuFile.fsPath}',if=mtd,format=raw`, + ]; + } else { + return [ + "-nographic", + "-machine", + idfTarget, + "-drive", + `file='${qemuFile.fsPath}',if=mtd,format=raw`, + "-monitor stdio", + `-serial tcp::${qemuTcpPort},server,nowait`, + ]; + } } public isRunning(): boolean { return !!this.qemuTerminal; } - public async promptToQemuLaunch(): Promise { - if (QemuManager.instance && QemuManager.instance.isRunning()) { - return true; - } - const launchQemuResponse = await window.showInformationMessage( - "QEMU is not running, Do you want to execute it?", - { modal: true }, - { title: "Yes" }, - { title: "Cancel", isCloseAffordance: true } - ); - if (launchQemuResponse && launchQemuResponse.title === "Yes") { - await QemuManager.init().start(); - return true; - } - return false; - } - - public async start() { + public async start(mode: QemuLaunchMode, workspaceFolder: Uri) { if (this.isRunning()) { return; } - const modifiedEnv = await appendIdfAndToolsToPath( - this.options.workspaceFolder - ); + const modifiedEnv = await appendIdfAndToolsToPath(workspaceFolder); + const qemuExecutable = + modifiedEnv.IDF_TARGET === "esp32" + ? "qemu-system-xtensa" + : modifiedEnv.IDF_TARGET === "esp32c3" + ? "qemu-system-riscv32" + : ""; + if (!qemuExecutable) { + throw new Error( + `${modifiedEnv.IDF_TARGET} is not supported by Espressif QEMU. Only esp32 or esp32c3 targets are supported.` + ); + } const isQemuBinInPath = await isBinInPath( - this.execString, - this.options.workspaceFolder.fsPath, + qemuExecutable, + workspaceFolder.fsPath, modifiedEnv ); if (!isQemuBinInPath) { - throw new Error("qemu-system-xtensa is not in PATH or access is denied"); - } - if (typeof this.options === "undefined") { - throw new Error("No QEMU options found."); + throw new Error( + `${qemuExecutable} is not found in PATH or access is denied` + ); } - if ( - typeof this.options.launchArgs === "undefined" || - this.options.launchArgs.length < 1 - ) { + + const qemuArgs: string[] = this.getLaunchArguments( + mode, + modifiedEnv.IDF_TARGET, + workspaceFolder + ); + if (typeof qemuArgs === "undefined" || qemuArgs.length < 1) { throw new Error("No QEMU launch arguments found."); } - if (typeof this.options.tcpPort === "undefined") { - throw new Error("No QEMU tcp port for serial port was found."); - } - - const qemuArgs: string[] = []; - this.options.launchArgs.forEach((arg) => { - qemuArgs.push(arg); - }); if (typeof this.qemuTerminal === "undefined") { this.qemuTerminal = window.createTerminal({ name: "ESP-IDF QEMU", env: modifiedEnv, - cwd: - this.options.workspaceFolder.fsPath || - modifiedEnv.IDF_PATH || - process.cwd(), + cwd: workspaceFolder.fsPath || modifiedEnv.IDF_PATH || process.cwd(), shellArgs: [], shellPath: env.shell, strictEnv: true, @@ -214,7 +193,7 @@ export class QemuManager extends EventEmitter { } }); } - this.qemuTerminal.sendText(`${this.execString} ${qemuArgs.join(" ")}`); + this.qemuTerminal.sendText(`${qemuExecutable} ${qemuArgs.join(" ")}`); this.qemuTerminal.show(true); this.updateStatusText("❇️ ESP-IDF: QEMU Server (Running)"); } @@ -247,8 +226,8 @@ export class QemuManager extends EventEmitter { commandDictionary[CommandKeys.QemuServer].tooltip; this._statusBarItem.command = CommandKeys.QemuServer; if ( - commandDictionary[CommandKeys.QemuServer] - .checkboxState === TreeItemCheckboxState.Checked + commandDictionary[CommandKeys.QemuServer].checkboxState === + TreeItemCheckboxState.Checked ) { this._statusBarItem.show(); } diff --git a/templates/.devcontainer/Dockerfile b/templates/.devcontainer/Dockerfile index 8d7b92d61..dafb8adbb 100644 --- a/templates/.devcontainer/Dockerfile +++ b/templates/.devcontainer/Dockerfile @@ -1,44 +1,10 @@ -FROM espressif/idf - -ARG DEBIAN_FRONTEND=nointeractive -ARG CONTAINER_USER=esp -ARG USER_UID=1050 -ARG USER_GID=$USER_UID - -RUN apt-get update \ - && apt install -y -q \ - cmake \ - git \ - libglib2.0-0 \ - libnuma1 \ - libpixman-1-0 \ - && rm -rf /var/lib/apt/lists/* - -# QEMU -ENV QEMU_REL=esp_develop_8.2.0_20240122 -ENV QEMU_SHA256=e7c72ef5705ad1444d391711088c8717fc89f42e9bf6d1487f9c2a326b8cfa83 -ENV QEMU_DIST=qemu-xtensa-softmmu-${QEMU_REL}-x86_64-linux-gnu.tar.xz -ENV QEMU_URL=https://github.com/espressif/qemu/releases/download/esp-develop-8.2.0-20240122/${QEMU_DIST} +ARG DOCKER_TAG=latest +FROM espressif/idf:${DOCKER_TAG} ENV LC_ALL=C.UTF-8 ENV LANG=C.UTF-8 -RUN wget --no-verbose ${QEMU_URL} \ - && echo "${QEMU_SHA256} *${QEMU_DIST}" | sha256sum --check --strict - \ - && tar -xf $QEMU_DIST -C /opt \ - && rm ${QEMU_DIST} - -ENV PATH=/opt/qemu/bin:${PATH} - -RUN groupadd --gid $USER_GID $CONTAINER_USER \ - && adduser --uid $USER_UID --gid $USER_GID --disabled-password --gecos "" ${CONTAINER_USER} \ - && usermod -a -G root $CONTAINER_USER && usermod -a -G dialout $CONTAINER_USER - -RUN chmod -R 775 /opt/esp/python_env/ - -USER ${CONTAINER_USER} -ENV USER=${CONTAINER_USER} -WORKDIR /home/${CONTAINER_USER} +RUN apt-get update -y && apt-get install udev -y RUN echo "source /opt/esp/idf/export.sh > /dev/null 2>&1" >> ~/.bashrc diff --git a/templates/.devcontainer/devcontainer.json b/templates/.devcontainer/devcontainer.json index 2d8816380..b80178618 100644 --- a/templates/.devcontainer/devcontainer.json +++ b/templates/.devcontainer/devcontainer.json @@ -15,18 +15,6 @@ "espressif.esp-idf-extension", "espressif.esp-idf-web" ] - }, - "codespaces": { - "settings": { - "terminal.integrated.defaultProfile.linux": "bash", - "idf.espIdfPath": "/opt/esp/idf", - "idf.toolsPath": "/opt/esp", - "idf.gitPath": "/usr/bin/git" - }, - "extensions": [ - "espressif.esp-idf-extension", - "espressif.esp-idf-web" - ] } }, "runArgs": ["--privileged"]