├── .devcontainer └── devcontainer.json ├── .gitignore ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── CMakeLists.txt ├── Dockerfile ├── README.md ├── esp32-prog.png ├── etc └── udev │ └── rules.d │ ├── 60-openocd.rules │ └── 98-espprog-dual-rs232-hs.rules └── main ├── CMakeLists.txt └── main.cpp /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/docker-existing-dockerfile 3 | { 4 | "name": "ESP32 Development Environment Dockerfile", 5 | 6 | // Sets the run context to one level up instead of the .devcontainer folder. 7 | "context": "..", 8 | 9 | // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. 10 | "dockerFile": "../Dockerfile", 11 | 12 | // Set *default* container specific settings.json values on container create. 13 | "settings": { 14 | "C_Cpp.default.includePath": [ 15 | "${default}", 16 | "${workspaceFolder}/**", 17 | "${config:esp_idf_path}/**" 18 | ], 19 | "C_Cpp.default.compilerPath": "${config:esp_toolchain_path}/xtensa-esp32-elf-gcc", 20 | "idf.adapterTargetName": "esp32", 21 | "terminal.integrated.defaultProfile.linux": "bash", 22 | "terminal.integrated.env.linux": { 23 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 24 | } 25 | }, 26 | 27 | // Add the IDs of extensions you want installed when the container is created. 28 | "extensions": [ 29 | "ms-vscode.cpptools", 30 | "ms-vscode.hexeditor", 31 | "ms-vscode.vscode-serial-monitor", 32 | "twxs.cmake" 33 | ], 34 | 35 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 36 | // "forwardPorts": [], 37 | 38 | // Uncomment the next line to run commands after the container is created - for example installing curl. 39 | //"postCreateCommand": "apt-get update && apt-get install -y curl", 40 | 41 | // Uncomment when using a ptrace-based debugger like C++, Go, and Rust 42 | "runArgs": [ 43 | "--device=/dev/bus/usb", 44 | // "--device=/dev/ttyUSB0", 45 | // "--device=/dev/ttyUSB1" 46 | ], 47 | 48 | // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. 49 | // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], 50 | 51 | // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. 52 | "remoteUser": "maker" 53 | } 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | sdkconfig 2 | sdkconfig.old 3 | build/ -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "ESP-Prog Debug", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${workspaceFolder}/build/esp_prog_vscode_debug.elf", 12 | "args": [], 13 | "cwd": "${workspaceFolder}", 14 | "environment": [ 15 | { 16 | "name": "PATH", 17 | "value": "${config:esp_dev_env_path}:${env:PATH}" 18 | } 19 | ], 20 | "externalConsole": false, 21 | "MIMode": "gdb", 22 | "miDebuggerPath": "${config:esp_toolchain_path}/xtensa-esp32-elf-gdb", 23 | "miDebuggerServerAddress": ":3333", 24 | "useExtendedRemote": true, 25 | "debugServerPath": "${config:esp_openocd_path}/openocd", 26 | "debugServerArgs": "-f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32.cfg -c \"esp32.cpu1 configure -rtos FreeRTOS\"", 27 | "serverStarted": "Listening on port [0-9]+ for gdb connections", 28 | "filterStderr": true, 29 | "filterStdout": false, 30 | "launchCompleteCommand": "None", 31 | "postRemoteConnectCommands": [ 32 | { 33 | "description": "Respect Hardware Limitations (as prescribed by Espressif)", 34 | "text": "set remote hardware-watchpoint-limit 2", 35 | "ignoreFailures": false 36 | }, 37 | { 38 | "description": "Hard Reset and Immediately Halt", 39 | "text": "monitor reset halt", 40 | "ignoreFailures": false 41 | }, 42 | { 43 | "description": "Flush Internal Register Cache", 44 | "text": "flushregs", 45 | "ignoreFailures": false 46 | }, 47 | { 48 | "description": "Set Temporary Hardware Assisted Breakpoint at `app_main`", 49 | "text": "thbreak app_main", 50 | "ignoreFailures": false 51 | }, 52 | { 53 | "description": "Shutdown GDB Server on GDB Detach", 54 | "text": "monitor [target current] configure -event gdb-detach { shutdown }", 55 | "ignoreFailures": false 56 | }, 57 | ], 58 | "stopAtConnect": false, 59 | "logging": { 60 | "exceptions": true, 61 | "engineLogging": false, 62 | "moduleLoad": true, 63 | "programOutput": true, 64 | "trace": true, 65 | "traceResponse": false 66 | }, 67 | } 68 | ] 69 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // If necessary, update the value of `esp_idf_path` to match your 3 | // environment. The value provided has been selected based on the 4 | // instructions provided by ESP regarding tool installation, see: 5 | // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#step-3-set-up-the-tools 6 | "esp_idf_path":"${env:HOME}/esp/esp-idf", 7 | 8 | // The tools needed for building, flashing, and debugging. These variables 9 | // are for informational purposes ONLY, and should NOT need to be modified. 10 | "esp_idf_tools": "${config:esp_idf_path}/tools", 11 | "esp_toolchain_root":"${env:HOME}/.espressif", 12 | "esp_binutils_path": "${config:esp_toolchain_root}/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin", 13 | "esp_openocd_path": "${config:esp_toolchain_root}/tools/openocd-esp32/v0.11.0-esp32-20221026/openocd-esp32/bin", 14 | "esp_python_path": "${config:esp_toolchain_root}/python_env/idf5.0_py3.9_env/bin", 15 | "esp_toolchain_path": "${config:esp_toolchain_root}/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin", 16 | 17 | "esp_dev_env_path": "${config:esp_idf_tools}:${config:esp_binutils_path}:${config:esp_openocd_path}:${config:esp_python_path}:${config:esp_toolchain_path}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 18 | } 19 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Build Firmware", 8 | "type": "shell", 9 | "group": { 10 | "kind": "build", 11 | "isDefault": true 12 | }, 13 | "options": { 14 | "cwd": "${workspaceFolder}", 15 | "env": { 16 | "IDF_PATH": "${config:esp_idf_path}", 17 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 18 | } 19 | }, 20 | "command": "idf.py build", 21 | "problemMatcher": [ 22 | "$gcc" 23 | ] 24 | }, 25 | { 26 | "label": "Clean Project", 27 | "type": "shell", 28 | "options": { 29 | "cwd": "${workspaceFolder}", 30 | "env": { 31 | "IDF_PATH": "${config:esp_idf_path}", 32 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 33 | } 34 | }, 35 | "command": "idf.py fullclean", 36 | "problemMatcher": [] 37 | }, 38 | { 39 | "label": "Manually remove the `build/` Directory", 40 | "type": "shell", 41 | "options": { 42 | "cwd": "${workspaceFolder}", 43 | }, 44 | "command": "rm -rf build/", 45 | "problemMatcher": [] 46 | }, 47 | { 48 | "label": "Flash Application via OpenOCD (ESP-Prog)", 49 | "type": "shell", 50 | "options": { 51 | "cwd": "${workspaceFolder}", 52 | "env": { 53 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 54 | } 55 | }, 56 | "command": "openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32.cfg -c \"program_esp build/esp_prog_vscode_debug.bin 0x10000 verify reset exit\" ", 57 | "problemMatcher": [] 58 | }, 59 | { 60 | "label": "Flash Bootloader, Partition Table and Application over USB", 61 | "type": "shell", 62 | "options": { 63 | "cwd": "${workspaceFolder}", 64 | "env": { 65 | "IDF_PATH": "${config:esp_idf_path}", 66 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 67 | } 68 | }, 69 | "command": "idf.py flash", 70 | "problemMatcher": [] 71 | }, 72 | { 73 | "label": "Monitor Serial Output", 74 | "type": "shell", 75 | "options": { 76 | "cwd": "${workspaceFolder}", 77 | "env": { 78 | "IDF_PATH": "${config:esp_idf_path}", 79 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 80 | } 81 | }, 82 | "command": "idf.py monitor", 83 | "problemMatcher": [] 84 | }, 85 | { 86 | "label": "Flash over USB and Monitor Serial Output", 87 | "type": "shell", 88 | "options": { 89 | "cwd": "${workspaceFolder}", 90 | "env": { 91 | "IDF_PATH": "${config:esp_idf_path}", 92 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 93 | } 94 | }, 95 | "command": "idf.py flash monitor", 96 | "problemMatcher": [] 97 | }, 98 | { 99 | "label": "Environment Check", 100 | "type": "shell", 101 | "options": { 102 | "cwd": "${workspaceFolder}", 103 | "env": { 104 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 105 | } 106 | }, 107 | "command": "printenv", 108 | "problemMatcher": [] 109 | }, 110 | { 111 | "label": "Open ESP-IDF Menu Config", 112 | "type": "shell", 113 | "options": { 114 | "cwd": "${workspaceFolder}", 115 | "env": { 116 | "IDF_PATH": "${config:esp_idf_path}", 117 | "LC_ALL": "C", 118 | "PATH": "${config:esp_dev_env_path}:${env:PATH}" 119 | } 120 | }, 121 | "command": "idf.py menuconfig", 122 | "problemMatcher": [] 123 | }, 124 | ] 125 | } 126 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 3 | project(esp_prog_vscode_debug) 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Build development environment 2 | # docker build --tag esp-dev-env . 3 | 4 | # Launch development environment 5 | # docker run --device /dev/bus/usb/ --interactive --rm --tty --volume "$(pwd)":/host-volume/ esp-dev-env 6 | 7 | # _**NOTE:** In order to utilize DFU and debugging functionality, you must 8 | # install (copy) the `.rules` file related to your debugging probe into the 9 | # `/etc/udev/rules.d` directory of the host machine and restart the host._ 10 | 11 | # _**NOTE:** The debugging probe must be attached while the container is 12 | # launched in order for it to be accessible from inside the container._ 13 | 14 | # Define global arguments 15 | ARG DEBIAN_FRONTEND="noninteractive" 16 | ARG UID=1000 17 | ARG USER=maker 18 | 19 | # POSIX compatible (Linux/Unix) base image 20 | FROM debian:stable-slim 21 | 22 | # Import global arguments 23 | ARG DEBIAN_FRONTEND 24 | ARG UID 25 | ARG USER 26 | 27 | # Define local arguments 28 | 29 | # Create Non-Root User 30 | RUN ["dash", "-c", "\ 31 | addgroup \ 32 | --gid ${UID} \ 33 | \"${USER}\" \ 34 | && adduser \ 35 | --disabled-password \ 36 | --gecos \"\" \ 37 | --ingroup \"${USER}\" \ 38 | --uid ${UID} \ 39 | \"${USER}\" \ 40 | && usermod \ 41 | --append \ 42 | --groups \"dialout,plugdev\" \ 43 | \"${USER}\" \ 44 | "] 45 | ENV PATH="/home/${USER}/.local/bin:${PATH}" 46 | 47 | # Step 1. Install Prerequisites 48 | # https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-setup.html#install-prerequisites 49 | RUN ["dash", "-c", "\ 50 | apt-get update --quiet \ 51 | && apt-get install --assume-yes --no-install-recommends --quiet \ 52 | bison \ 53 | ccache \ 54 | cmake \ 55 | dfu-util \ 56 | flex \ 57 | git \ 58 | gperf \ 59 | libffi-dev \ 60 | libpython2.7 \ 61 | libssl-dev \ 62 | libusb-1.0-0 \ 63 | nano \ 64 | ninja-build \ 65 | python3 \ 66 | python3-pip \ 67 | python3-setuptools \ 68 | python3-venv \ 69 | udev \ 70 | wget \ 71 | && apt-get clean \ 72 | && apt-get purge \ 73 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ 74 | "] 75 | 76 | # Install IDF as non-root user 77 | WORKDIR /home/${USER}/ 78 | USER ${USER} 79 | 80 | # Step 2. Get ESP-IDF 81 | # https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#step-2-get-esp-idf 82 | RUN ["dash", "-c", "\ 83 | mkdir esp \ 84 | && cd esp/ \ 85 | && git clone --recursive https://github.com/espressif/esp-idf.git --branch v5.0 \ 86 | "] 87 | 88 | # Step 3. Set up the tools 89 | # https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#step-3-set-up-the-tools 90 | ENV IDF_TARGET="esp32" 91 | RUN ["dash", "-c", "\ 92 | cd ./esp/esp-idf \ 93 | && ./install.sh ${IDF_TARGET} \ 94 | "] 95 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP-Prog Debugging in VSCode Sample Repo 2 | 3 | This is an example repository to quickly get you debugging an ESP32-based dev 4 | board with the ESP-Prog programmer in VSCode. 5 | 6 | ## Features 7 | 8 | Includes VSCode tasks out of the box for: 9 | - Building firmware 10 | - Flashing firmware to your device 11 | - Debugging firmware integrated in VSCode 12 | - Monitoring your device over serial 13 | - Cleaning your build folder 14 | 15 | ## How To Use This Repo 16 | 17 | ### New Project 18 | 19 | If you are starting a new project from scratch you can clone this repo directly 20 | and use it as a bare bones base to build on top of. After cloning, follow the 21 | instructions under the **Setup** and **Configuration** sections below. 22 | 23 | ### Add To Existing Project 24 | 25 | If you already have an existing ESP32 firmware project setup in VSCode it is 26 | very simple to integrate pieces of this repository into your project. The core 27 | functionality to enable debugging is provided by 3 files in the **.vscode** folder. 28 | 29 | - **launch.json** - Contains the debug configuration 30 | - **settings.json** - Contains environment-specific paths to various tools 31 | required for building and debugging 32 | - **tasks.json** - Defines tasks for building, flashing, monitoring, and debugging 33 | 34 | If you don't have any of these files in your existing repo simply copy all of 35 | them into your **.vscode** folder. If you have a **launch.json** file I highly 36 | recommend you simply replace it with the file in this repo. 37 | 38 | If you already have a `launch.json`, `settings.json`, or `tasks.json` file, then 39 | you can simply add the contents from the corresponding files in this repo to 40 | yours. 41 | 42 | ## Setup 43 | 44 | ### Install VSCode Dependencies 45 | 46 | ```none 47 | Name: C/C++ 48 | Id: ms-vscode.cpptools 49 | Description: C/C++ IntelliSense, debugging, and code browsing. 50 | Version: 1.9.7 51 | Publisher: Microsoft 52 | VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools 53 | ``` 54 | 55 | ### Clone the ESP-IDF Repo 56 | 57 | If you don't already have it you will need to clone the ESP-IDF repo to a location 58 | of your choice on your machine. You will need the path to this location later on. 59 | 60 | ```sh 61 | git clone --recursive https://github.com/espressif/esp-idf.git --branch v5.0 62 | ``` 63 | 64 | ### Install the ESP-IDF Toolchain 65 | 66 | The configuration instructions below assume you have already installed the 67 | ESP-IDF toolchain. Instructions for installing the toolchain can be found here. 68 | 69 | [Set Up The Tools](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#step-3-set-up-the-tools) 70 | 71 | ### Python 2 Dependencies 72 | 73 | Due to [some issues with Python versions in the ESP-IDF tooling](https://github.com/espressif/esp-idf/issues/5284#issuecomment-693426699), 74 | you must have the Python 2.7 dependencies installed on your machine even if 75 | you have configured ESP-IDF to use Python 3. 76 | 77 | On Linux, you may install `libpython2.7` with the following command. 78 | 79 | ```sh 80 | sudo apt-get install libpython2.7 81 | ``` 82 | 83 | ## Configuration 84 | 85 | To configure the tasks and debug configuration there are a few tweaks you need 86 | to make to the files in the **.vscode** directory as follows. 87 | 88 | ### settings.json 89 | 90 | - **esp_idf_path** - The ESP IDF path is set in $IDF_PATH after running `. export.sh` (default: `~/esp/esp-idf`). 91 | 92 | The value in `esp_idf_path` has been defaulted based on the instructions 93 | provided by ESP regarding tool installation. see: 94 | https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#step-3-set-up-the-tools 95 | 96 | ### launch.json 97 | 98 | If you cloned this repository directly to start a new project this file does 99 | not need to be changed. Proceed to the next section. 100 | 101 | If you added this file to an existing project you need to change the **target** 102 | attribute to point to the `.elf` file created during a firmware build. It will 103 | be named based on what you call your project in the top-level `CMakeLists.txt` 104 | file. 105 | 106 | ### tasks.json 107 | 108 | No changes need to be made to this file. 109 | 110 | ## Debugging Instructions 111 | 112 | **ESP-Prog Connector Pinout Diagram:** 113 | 114 | ![ESP-Prog Connector Pinout](esp32-prog.png) 115 | 116 | 1. Attach the ESP-Prog to your target device via whatever JTAG cable is required. 117 | 1. Plug the target device (the one you want to debug) into your computer. 118 | 1. Click **Terminal > Run Tasks...** to open the Task list in VSCode and select 119 | _Flash and Monitor Device_. 120 | 1. The device should successfully flash and start showing serial output, if applicable. 121 | 1. Plug the ESP-Prog into your computer. The red LED should illuminate. 122 | 1. Start a debug session with **F5** or **Run->Start Debugging** from the menu. 123 | 124 | ### Done 🤩 125 | 126 | From this state you can makes changes and flash new firmware. Starting a new 127 | debug session will reset and halt your device at your application entry point. 128 | 129 | ### It Stopped Working, Now What? 😞 130 | 131 | I've found this to be a very reliable approach to debugging my ESP32 device. 132 | However, occasionally things will stop working and it won't be clear why. The 133 | 'ol "turn it off and back on again" is pretty effective here. To fix almost any 134 | issues: 135 | 136 | 1. Make sure the debugger is stopped by hitting the Red square from the debug 137 | panel, hitting **Shift-F5** or **Run->Stop Debugging** from the menu. 138 | 1. Stop OpenOCD by focusing the OpenOCD shell output window and hitting **Ctrl-C**. 139 | 1. Try to start debugging again. 140 | 141 | If you get the following error when trying to flash your device: 142 | 143 | ```none 144 | A fatal error occurred: Timed out waiting for packet content 145 | CMake Error at run_cmd.cmake:14 (message): 146 | esptool.py failed 147 | Call Stack (most recent call first): 148 | run_esptool.cmake:21 (include) 149 | ``` 150 | 151 | This can be due to the IDF not correctly identifying your target device during 152 | the original port scan (i.e. the wrong `/dev/ttyXXX` device). Both the ESP32 153 | target device, as well as the ESP-Prog, will enumerate as `/dev/ttyUSB0` 154 | (depending on whichever was plugged in first). Since the debug commands scan for 155 | the target device port in ascending order, it can be helpful if you plug in the 156 | target device first. 157 | 158 | Another thing to try is to disconnect your ESP-Prog and try to flash your device 159 | without the ESP-Prog connected. After successful flash, you can reconnect the 160 | ESP-Prog to your computer. 161 | 162 | ## **-----> A Note on Versions <-----** 163 | 164 | The main branch of this repo is configured to work with version 5.0 of ESP-IDF. 165 | If you are using a different version of IDF it is very likely that paths in the 166 | **settings.json** file will need to be altered to match the various toolchain 167 | versions. 168 | 169 | ## Donate a Burrito 170 | 171 | This information is the result of hours upon hours of research and trial and 172 | error and is provided free to the community to hopefully help other ESP32 makers. 173 | That said, if you found this helpful or if it saved you time and you wanna say 174 | thanks in the form of a burrito, well, I'm not gonna stop you. 175 | 176 | [Buy Me a Burrito](https://www.buymeacoffee.com/kevinsidwar) 🌯🌯🌯 177 | -------------------------------------------------------------------------------- /esp32-prog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/makercrew/esp_prog_vscode_debug/5a944cd55d758f08efea56ccb55ad086bc914434/esp32-prog.png -------------------------------------------------------------------------------- /etc/udev/rules.d/60-openocd.rules: -------------------------------------------------------------------------------- 1 | # Copy this file to /etc/udev/rules.d/ 2 | # If rules fail to reload automatically, you can refresh udev rules 3 | # with the command "udevadm control --reload" 4 | 5 | ACTION!="add|change", GOTO="openocd_rules_end" 6 | SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end" 7 | 8 | # Please keep this list sorted by VID:PID 9 | 10 | # opendous and estick 11 | ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="660", GROUP="plugdev", TAG+="uaccess" 12 | 13 | # Original FT232/FT245 VID:PID 14 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", TAG+="uaccess" 15 | 16 | # Original FT2232 VID:PID 17 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess" 18 | 19 | # Original FT4232 VID:PID 20 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="660", GROUP="plugdev", TAG+="uaccess" 21 | 22 | # Original FT232H VID:PID 23 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="660", GROUP="plugdev", TAG+="uaccess" 24 | 25 | # DISTORTEC JTAG-lock-pick Tiny 2 26 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="660", GROUP="plugdev", TAG+="uaccess" 27 | 28 | # TUMPA, TUMPA Lite 29 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="660", GROUP="plugdev", TAG+="uaccess" 30 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a99", MODE="660", GROUP="plugdev", TAG+="uaccess" 31 | 32 | # XDS100v2 33 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="660", GROUP="plugdev", TAG+="uaccess" 34 | 35 | # Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE) 36 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="660", GROUP="plugdev", TAG+="uaccess" 37 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca1", MODE="660", GROUP="plugdev", TAG+="uaccess" 38 | 39 | # TI/Luminary Stellaris Evaluation Board FTDI (several) 40 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="660", GROUP="plugdev", TAG+="uaccess" 41 | 42 | # TI/Luminary Stellaris In-Circuit Debug Interface FTDI (ICDI) Board 43 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="660", GROUP="plugdev", TAG+="uaccess" 44 | 45 | # egnite Turtelizer 2 46 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="660", GROUP="plugdev", TAG+="uaccess" 47 | 48 | # Section5 ICEbear 49 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c140", MODE="660", GROUP="plugdev", TAG+="uaccess" 50 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c141", MODE="660", GROUP="plugdev", TAG+="uaccess" 51 | 52 | # Amontec JTAGkey and JTAGkey-tiny 53 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="660", GROUP="plugdev", TAG+="uaccess" 54 | 55 | # TI ICDI 56 | ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="660", GROUP="plugdev", TAG+="uaccess" 57 | 58 | # STMicroelectronics ST-LINK V1 59 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE="660", GROUP="plugdev", TAG+="uaccess" 60 | 61 | # STMicroelectronics ST-LINK/V2 62 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="660", GROUP="plugdev", TAG+="uaccess" 63 | 64 | # STMicroelectronics ST-LINK/V2.1 65 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE="660", GROUP="plugdev", TAG+="uaccess" 66 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3752", MODE="660", GROUP="plugdev", TAG+="uaccess" 67 | 68 | # STMicroelectronics STLINK-V3 69 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374d", MODE="660", GROUP="plugdev", TAG+="uaccess" 70 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", MODE="660", GROUP="plugdev", TAG+="uaccess" 71 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", MODE="660", GROUP="plugdev", TAG+="uaccess" 72 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", MODE="660", GROUP="plugdev", TAG+="uaccess" 73 | 74 | # Cypress KitProg in KitProg mode 75 | ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f139", MODE="660", GROUP="plugdev", TAG+="uaccess" 76 | 77 | # Cypress KitProg in CMSIS-DAP mode 78 | ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f138", MODE="660", GROUP="plugdev", TAG+="uaccess" 79 | 80 | # Hilscher NXHX Boards 81 | ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="660", GROUP="plugdev", TAG+="uaccess" 82 | 83 | # Hitex STR9-comStick 84 | ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002c", MODE="660", GROUP="plugdev", TAG+="uaccess" 85 | 86 | # Hitex STM32-PerformanceStick 87 | ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002d", MODE="660", GROUP="plugdev", TAG+="uaccess" 88 | 89 | # Altera USB Blaster 90 | ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", TAG+="uaccess" 91 | 92 | # Amontec JTAGkey-HiSpeed 93 | ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="660", GROUP="plugdev", TAG+="uaccess" 94 | 95 | # SEGGER J-Link 96 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", MODE="660", GROUP="plugdev", TAG+="uaccess" 97 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0102", MODE="660", GROUP="plugdev", TAG+="uaccess" 98 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0103", MODE="660", GROUP="plugdev", TAG+="uaccess" 99 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0104", MODE="660", GROUP="plugdev", TAG+="uaccess" 100 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", MODE="660", GROUP="plugdev", TAG+="uaccess" 101 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0107", MODE="660", GROUP="plugdev", TAG+="uaccess" 102 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0108", MODE="660", GROUP="plugdev", TAG+="uaccess" 103 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1010", MODE="660", GROUP="plugdev", TAG+="uaccess" 104 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1011", MODE="660", GROUP="plugdev", TAG+="uaccess" 105 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1012", MODE="660", GROUP="plugdev", TAG+="uaccess" 106 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1013", MODE="660", GROUP="plugdev", TAG+="uaccess" 107 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1014", MODE="660", GROUP="plugdev", TAG+="uaccess" 108 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", MODE="660", GROUP="plugdev", TAG+="uaccess" 109 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1016", MODE="660", GROUP="plugdev", TAG+="uaccess" 110 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1017", MODE="660", GROUP="plugdev", TAG+="uaccess" 111 | ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1018", MODE="660", GROUP="plugdev", TAG+="uaccess" 112 | 113 | # Raisonance RLink 114 | ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="660", GROUP="plugdev", TAG+="uaccess" 115 | 116 | # Debug Board for Neo1973 117 | ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="660", GROUP="plugdev", TAG+="uaccess" 118 | 119 | # Olimex ARM-USB-OCD 120 | ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="660", GROUP="plugdev", TAG+="uaccess" 121 | 122 | # Olimex ARM-USB-OCD-TINY 123 | ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0004", MODE="660", GROUP="plugdev", TAG+="uaccess" 124 | 125 | # Olimex ARM-JTAG-EW 126 | ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="001e", MODE="660", GROUP="plugdev", TAG+="uaccess" 127 | 128 | # Olimex ARM-USB-OCD-TINY-H 129 | ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="660", GROUP="plugdev", TAG+="uaccess" 130 | 131 | # Olimex ARM-USB-OCD-H 132 | ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002b", MODE="660", GROUP="plugdev", TAG+="uaccess" 133 | 134 | # USBprog with OpenOCD firmware 135 | ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="660", GROUP="plugdev", TAG+="uaccess" 136 | 137 | # TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board 138 | ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="660", GROUP="plugdev", TAG+="uaccess" 139 | 140 | # TI XDS110 Debug Probe (Launchpads and Standalone) 141 | ATTRS{idVendor}=="0451", ATTRS{idProduct}=="bef3", MODE="660", GROUP="plugdev", TAG+="uaccess" 142 | 143 | # TI Tiva-based ICDI and XDS110 probes in DFU mode 144 | ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00ff", MODE="660", GROUP="plugdev", TAG+="uaccess" 145 | 146 | # Ambiq Micro EVK and Debug boards. 147 | ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev", TAG+="uaccess" 148 | ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6011", MODE="664", GROUP="plugdev", TAG+="uaccess" 149 | ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="1106", MODE="664", GROUP="plugdev", TAG+="uaccess" 150 | 151 | # Marvell Sheevaplug 152 | ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="660", GROUP="plugdev", TAG+="uaccess" 153 | 154 | # Keil Software, Inc. ULink 155 | ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="660", GROUP="plugdev", TAG+="uaccess" 156 | 157 | # CMSIS-DAP compatible adapters 158 | ATTRS{product}=="*CMSIS-DAP*", MODE="660", GROUP="plugdev", TAG+="uaccess" 159 | 160 | # Espressif dev kit FTDI 161 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess" 162 | 163 | LABEL="openocd_rules_end" 164 | -------------------------------------------------------------------------------- /etc/udev/rules.d/98-espprog-dual-rs232-hs.rules: -------------------------------------------------------------------------------- 1 | # Assign fixed port names for ESP32 Prog Adapter 2 | SUBSYSTEMS=="usb", ATTRS{interface}=="Dual RS232-HS", KERNELS=="*:1.0", MODE:="0660", GROUP:="dialout", SYMLINK+="ttyUSB_jtag" 3 | SUBSYSTEMS=="usb", ATTRS{interface}=="Dual RS232-HS", KERNELS=="*:1.1", MODE:="0660", GROUP:="dialout", SYMLINK+="ttyUSB_prog" 4 | -------------------------------------------------------------------------------- /main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "main.cpp") 2 | -------------------------------------------------------------------------------- /main/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | extern "C" void app_main(void) 6 | { 7 | while (true) { 8 | printf("Debugging in VSCode!!!!!\n"); 9 | std::this_thread::sleep_for(std::chrono::seconds(1)); 10 | } 11 | } 12 | --------------------------------------------------------------------------------