├── .gitignore ├── device.png ├── SampleUI.jpg ├── .vscode ├── settings.json ├── launch.json ├── c_cpp_properties.json └── tasks.json ├── main ├── CMakeLists.txt └── main.cpp ├── .gitmodules ├── CMakeLists.txt ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── LICENSE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | sdkconfig 3 | sdkconfig.old -------------------------------------------------------------------------------- /device.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukesh-ak/LVGL8-WT32-SC01-IDF/HEAD/device.png -------------------------------------------------------------------------------- /SampleUI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sukesh-ak/LVGL8-WT32-SC01-IDF/HEAD/SampleUI.jpg -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.intelliSenseEngine": "Tag Parser", 3 | "idf.adapterTargetName": "esp32" 4 | } 5 | -------------------------------------------------------------------------------- /main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register( 2 | SRCS "main.cpp" 3 | INCLUDE_DIRS "" 4 | REQUIRES LovyanGFX lvgl 5 | ) 6 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "espidf", 6 | "name": "Launch", 7 | "request": "launch" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "components/LovyanGFX"] 2 | path = components/LovyanGFX 3 | url = https://github.com/lovyan03/LovyanGFX.git 4 | [submodule "components/lvgl"] 5 | path = components/lvgl 6 | url = https://github.com/lvgl/lvgl.git 7 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | project(lvgl-wt32-sc01) -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM espressif/idf:release-v4.3 2 | 3 | ARG DEBIAN_FRONTEND=nointeractive 4 | 5 | RUN apt-get update \ 6 | && apt install -y -q \ 7 | cmake \ 8 | git \ 9 | libglib2.0-0 \ 10 | libnuma1 \ 11 | libpixman-1-0 12 | 13 | RUN ./opt/esp/entrypoint.sh && pip install --no-cache-dir idf-component-manager 14 | 15 | # QEMU 16 | ENV QEMU_REL=esp-develop-20210220 17 | ENV QEMU_SHA256=44c130226bdce9aff6abf0aeaab44f09fe4f2d71a5f9225ac1708d68e4852c02 18 | ENV QEMU_DIST=qemu-${QEMU_REL}.tar.bz2 19 | ENV QEMU_URL=https://github.com/espressif/qemu/releases/download/${QEMU_REL}/${QEMU_DIST} 20 | 21 | ENV LC_ALL=C.UTF-8 22 | ENV LANG=C.UTF-8 23 | ENV IDF_PYTHON_ENV_PATH=/opt/esp/python_env/idf4.3_py3.6_env 24 | 25 | RUN wget --no-verbose ${QEMU_URL} \ 26 | && echo "${QEMU_SHA256} *${QEMU_DIST}" | sha256sum --check --strict - \ 27 | && tar -xf $QEMU_DIST -C /opt \ 28 | && rm ${QEMU_DIST} 29 | 30 | ENV PATH=/opt/qemu/bin:${PATH} 31 | 32 | RUN echo $($IDF_PATH/tools/idf_tools.py export) >> $HOME/.bashrc 33 | 34 | ENTRYPOINT [ "/opt/esp/entrypoint.sh" ] 35 | 36 | CMD ["/bin/bash"] -------------------------------------------------------------------------------- /.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.183.0/containers/ubuntu 3 | { 4 | "name": "ESP-IDF QEMU", 5 | "build": { 6 | "dockerfile": "Dockerfile" 7 | }, 8 | "settings": { 9 | "terminal.integrated.defaultProfile.linux": "bash", 10 | "idf.espIdfPath": "/opt/esp/idf", 11 | "idf.customExtraPaths": "", 12 | "idf.pythonBinPath": "/opt/esp/python_env/idf4.3_py3.6_env/bin/python", 13 | "idf.toolsPath": "/opt/esp", 14 | "idf.gitPath": "/usr/bin/git" 15 | }, 16 | // Add the IDs of extensions you want installed when the container is created. 17 | "extensions": [ 18 | "ms-vscode.cpptools", 19 | "espressif.esp-idf-extension" 20 | ], 21 | 22 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 23 | // "forwardPorts": [], 24 | 25 | // Use 'postCreateCommand' to run commands after the container is created. 26 | // "postCreateCommand": "bash /opt/esp/entrypoint.sh", 27 | 28 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 29 | // "remoteUser": "vscodeuser" 30 | } -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "ESP-IDF", 5 | "compilerPath": "d:\\esp\\.espressif\\tools\\xtensa-esp32-elf\\esp-2021r2-8.4.0\\xtensa-esp32-elf\\bin\\xtensa-esp32-elf-gcc.exe", 6 | "cStandard": "c11", 7 | "cppStandard": "c++17", 8 | "includePath": [ 9 | "${config:idf.espIdfPath}/components/**", 10 | "${config:idf.espIdfPathWin}/components/**", 11 | "${config:idf.espAdfPath}/components/**", 12 | "${config:idf.espAdfPathWin}/components/**", 13 | "${workspaceFolder}/**" 14 | ], 15 | "browse": { 16 | "path": [ 17 | "${config:idf.espIdfPath}/components", 18 | "${config:idf.espIdfPathWin}/components", 19 | "${config:idf.espAdfPath}/components/**", 20 | "${config:idf.espAdfPathWin}/components/**", 21 | "${workspaceFolder}" 22 | ], 23 | "limitSymbolsToIncludedHeaders": false 24 | }, 25 | "compileCommands": "${workspaceFolder}/build/compile_commands.json" 26 | } 27 | ], 28 | "version": 4 29 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project moved => [ESP32-TUX](https://github.com/sukesh-ak/ESP32-TUX) 2 | 3 | ## Check the updated version with lots of features, including support for the new version WT32-SC01 Plus 4 | https://github.com/sukesh-ak/ESP32-TUX 5 | 6 | 7 | ![device](device.png) 8 | 9 | 10 | - Board : WT32-SC01 from Wireless Tag (Seeed Studio also carries the same) 11 | - Graphics & Touch Driver : [LovyanGFX](https://github.com/lovyan03/LovyanGFX) 12 | - UI/Widgets : [LVGL8.x](https://github.com/lvgl/lvgl) 13 | - Framework : ESP-IDF ([Arduino sample here](https://github.com/sukesh-ak/LVGL8-WT32-SC01-Arduino)) 14 | (*Don't forget to run `idf.py menuconfig` before building the sample*) 15 | 16 | ## Demo code output 17 | ![device](SampleUI.jpg) 18 | 19 | ## WT32-SC01 Specs 20 | #### Pros: 21 | - ESP32 WROVER-B 22 | - 3.5" 480x320 ST7796S TFT Display 23 | - Capacitive touchscreen FT6336U 24 | - Default 4MB Flash & 8MB PSRAM 25 | - Two external expansion female pin headers with same pin-out (mirrored) 26 | - 2 x 3.3v LDO, 1 for the board and 1 for the external expansion 27 | - Separate Battery/External power option with voltage range 5v-9v (5) 28 | - USB-C for power and programming 29 | 30 | #### Cons: 31 | - No SD Card storage option 32 | - [16MB Flash version](https://www.alibaba.com/product-detail/esp32-development-board-WT32-SC01-3_62534911683.html) available but only through Alibaba (didn't know when I ordered) 33 | - Pin headers are 2mm pitch which is not the common standard (2.54mm is common). 34 | - Mounting holes in the wrong place so you cannot use it (fixed in newer revisions) 35 | 36 | ## Board config 37 | - TFT (ST7796) 38 | - TFT_RST=22 39 | - TFT_SCLK=14 40 | - TFT_DC=21 41 | - TFT_CS=15 42 | - TFT_MOSI=13 43 | - TFT_MISO=-1 44 | - TFT_BCKL=23 45 | - Touch (FT6336U) 46 | - TOUCH_SDA=18 47 | - TOUCH_SCL=19 48 | - I2C_TOUCH_ADDRESS=0x38 49 | 50 | ## Touch and Draw sample (without LVGL) 51 | Replace the content of main.cpp with the following to test quickly 52 | 53 | ``` C++ 54 | 55 | /* 56 | Simple Touch Drawing sample for WT32-SC01 57 | */ 58 | #include 59 | #include 60 | #include 61 | #include "sdkconfig.h" 62 | 63 | #define LGFX_WT32_SC01 64 | #define LGFX_USE_V1 // set to use new version of library 65 | 66 | #include // main library 67 | #include 68 | 69 | static LGFX lcd; // declare display variable 70 | 71 | extern "C" 72 | { 73 | void setup(void) 74 | { 75 | lcd.init(); 76 | 77 | // Setting display to landscape 78 | if (lcd.width() < lcd.height()) lcd.setRotation(lcd.getRotation() ^ 1); 79 | 80 | // Variables for touch x,y 81 | static int32_t x,y; 82 | while(1) 83 | { 84 | if (lcd.getTouch(&x, &y)) { 85 | lcd.fillRect(x-2, y-2, 5, 5, TFT_RED); 86 | lcd.setCursor(380,0); 87 | lcd.printf("Touch:(%03d,%03d)", x,y); 88 | } 89 | } 90 | } 91 | 92 | 93 | ``` 94 | 95 | ## 3D Printable enclosure (STL) 96 | [3D enclosure on SketchFab website](https://sketchfab.com/3d-models/wt32-sc01-case-cfec05638de540b0acccff2091508500) 97 | -------------------------------------------------------------------------------- /main/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Simple ESP-IDF Demo with WT32-SC01 + LovyanGFX + LVGL8.x 3 | */ 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "sdkconfig.h" 9 | 10 | static const char *TAG = "MAIN"; 11 | #define LV_TICK_PERIOD_MS 1 12 | #define LGFX_WT32_SC01 // Wireless Tag / Seeed WT32-SC01 13 | #define LGFX_USE_V1 // LovyanGFX version 14 | 15 | //#define LGFX_AUTODETECT 16 | #include 17 | #include 18 | 19 | static LGFX lcd; 20 | 21 | #include 22 | 23 | /*** Setup screen resolution for LVGL ***/ 24 | static const uint16_t screenWidth = 480; 25 | static const uint16_t screenHeight = 320; 26 | static lv_disp_draw_buf_t draw_buf; 27 | static lv_color_t buf[screenWidth * 10]; 28 | 29 | /*** Function declaration ***/ 30 | void display_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p); 31 | void touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data); 32 | void lv_button_demo(void); 33 | static void lv_tick_task(void *arg); 34 | 35 | char txt[100]; 36 | lv_obj_t *tlabel; // touch x,y label 37 | 38 | extern "C" 39 | { 40 | void app_main(void) 41 | { 42 | lcd.init(); // Initialize LovyanGFX 43 | lv_init(); // Initialize lvgl 44 | 45 | // Setting display to landscape 46 | if (lcd.width() < lcd.height()) 47 | lcd.setRotation(lcd.getRotation() ^ 1); 48 | 49 | /* LVGL : Setting up buffer to use for display */ 50 | lv_disp_draw_buf_init(&draw_buf, buf, NULL, screenWidth * 10); 51 | 52 | /*** LVGL : Setup & Initialize the display device driver ***/ 53 | static lv_disp_drv_t disp_drv; 54 | lv_disp_drv_init(&disp_drv); 55 | disp_drv.hor_res = screenWidth; 56 | disp_drv.ver_res = screenHeight; 57 | disp_drv.flush_cb = display_flush; 58 | disp_drv.draw_buf = &draw_buf; 59 | lv_disp_drv_register(&disp_drv); 60 | 61 | /*** LVGL : Setup & Initialize the input device driver ***/ 62 | static lv_indev_drv_t indev_drv; 63 | lv_indev_drv_init(&indev_drv); 64 | indev_drv.type = LV_INDEV_TYPE_POINTER; 65 | indev_drv.read_cb = touchpad_read; 66 | lv_indev_drv_register(&indev_drv); 67 | 68 | /* Create and start a periodic timer interrupt to call lv_tick_inc */ 69 | const esp_timer_create_args_t periodic_timer_args = { 70 | .callback = &lv_tick_task, 71 | .name = "periodic_gui"}; 72 | esp_timer_handle_t periodic_timer; 73 | ESP_ERROR_CHECK(esp_timer_create(&periodic_timer_args, &periodic_timer)); 74 | ESP_ERROR_CHECK(esp_timer_start_periodic(periodic_timer, LV_TICK_PERIOD_MS * 1000)); 75 | 76 | /*** Create simple label and show LVGL version ***/ 77 | 78 | sprintf(txt, "WT32-SC01 with LVGL v%d.%d.%d", lv_version_major(), lv_version_minor(), lv_version_patch()); 79 | 80 | lv_obj_t *label = lv_label_create(lv_scr_act()); // full screen as the parent 81 | lv_label_set_text(label, txt); // set label text 82 | lv_obj_align(label, LV_ALIGN_TOP_MID, 0, 20); // Center but 20 from the top 83 | 84 | tlabel = lv_label_create(lv_scr_act()); // full screen as the parent 85 | lv_label_set_text(tlabel, "Touch:(000,000)"); // set label text 86 | lv_obj_align(tlabel, LV_ALIGN_TOP_RIGHT, 0, 0); // Center but 20 from the top 87 | 88 | lv_button_demo(); // lvl buttons 89 | 90 | while (1) 91 | { 92 | lv_timer_handler(); /* let the GUI do its work */ 93 | vTaskDelay(1); 94 | } 95 | } 96 | } 97 | 98 | /*** Display callback to flush the buffer to screen ***/ 99 | void display_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) 100 | { 101 | uint32_t w = (area->x2 - area->x1 + 1); 102 | uint32_t h = (area->y2 - area->y1 + 1); 103 | 104 | lcd.startWrite(); 105 | lcd.setAddrWindow(area->x1, area->y1, w, h); 106 | lcd.pushColors((uint16_t *)&color_p->full, w * h, true); 107 | lcd.endWrite(); 108 | 109 | lv_disp_flush_ready(disp); 110 | } 111 | 112 | /*** Touchpad callback to read the touchpad ***/ 113 | void touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) 114 | { 115 | uint16_t touchX, touchY; 116 | bool touched = lcd.getTouch(&touchX, &touchY); 117 | 118 | if (!touched) 119 | { 120 | data->state = LV_INDEV_STATE_REL; 121 | } 122 | else 123 | { 124 | data->state = LV_INDEV_STATE_PR; 125 | 126 | /*Set the coordinates*/ 127 | data->point.x = touchX; 128 | data->point.y = touchY; 129 | 130 | sprintf(txt, "Touch:(%03d,%03d)", touchX, touchY); 131 | lv_label_set_text(tlabel, txt); // set label text 132 | } 133 | } 134 | 135 | /* Counter button event handler */ 136 | static void counter_event_handler(lv_event_t *e) 137 | { 138 | lv_event_code_t code = lv_event_get_code(e); 139 | lv_obj_t *btn = lv_event_get_target(e); 140 | if (code == LV_EVENT_CLICKED) 141 | { 142 | static uint8_t cnt = 0; 143 | cnt++; 144 | 145 | /*Get the first child of the button which is the label and change its text*/ 146 | lv_obj_t *label = lv_obj_get_child(btn, 0); 147 | lv_label_set_text_fmt(label, "Button: %d", cnt); 148 | LV_LOG_USER("Clicked"); 149 | ESP_LOGI(TAG, "Clicked"); 150 | } 151 | } 152 | 153 | /* Toggle button event handler */ 154 | static void toggle_event_handler(lv_event_t *e) 155 | { 156 | lv_event_code_t code = lv_event_get_code(e); 157 | if (code == LV_EVENT_VALUE_CHANGED) 158 | { 159 | LV_LOG_USER("Toggled"); 160 | ESP_LOGI(TAG, "Toggled"); 161 | } 162 | } 163 | 164 | /* Button with counter & Toggle Button */ 165 | void lv_button_demo(void) 166 | { 167 | lv_obj_t *label; 168 | 169 | // Button with counter 170 | lv_obj_t *btn1 = lv_btn_create(lv_scr_act()); 171 | lv_obj_add_event_cb(btn1, counter_event_handler, LV_EVENT_ALL, NULL); 172 | 173 | lv_obj_set_pos(btn1, 100, 100); /*Set its position*/ 174 | lv_obj_set_size(btn1, 120, 50); /*Set its size*/ 175 | 176 | label = lv_label_create(btn1); 177 | lv_label_set_text(label, "Button"); 178 | lv_obj_center(label); 179 | 180 | // Toggle button 181 | lv_obj_t *btn2 = lv_btn_create(lv_scr_act()); 182 | lv_obj_add_event_cb(btn2, toggle_event_handler, LV_EVENT_ALL, NULL); 183 | lv_obj_add_flag(btn2, LV_OBJ_FLAG_CHECKABLE); 184 | lv_obj_set_pos(btn2, 250, 100); /*Set its position*/ 185 | lv_obj_set_size(btn2, 120, 50); /*Set its size*/ 186 | 187 | label = lv_label_create(btn2); 188 | lv_label_set_text(label, "Toggle Button"); 189 | lv_obj_center(label); 190 | } 191 | 192 | /* Setting up tick task for lvgl */ 193 | static void lv_tick_task(void *arg) 194 | { 195 | (void)arg; 196 | lv_tick_inc(LV_TICK_PERIOD_MS); 197 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Build - Build project", 6 | "type": "shell", 7 | "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py build", 8 | "windows": { 9 | "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py build", 10 | "options": { 11 | "env": { 12 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 13 | } 14 | } 15 | }, 16 | "options": { 17 | "env": { 18 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 19 | } 20 | }, 21 | "problemMatcher": [ 22 | { 23 | "owner": "cpp", 24 | "fileLocation": [ 25 | "relative", 26 | "${workspaceFolder}" 27 | ], 28 | "pattern": { 29 | "regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 30 | "file": 1, 31 | "line": 2, 32 | "column": 3, 33 | "severity": 4, 34 | "message": 5 35 | } 36 | }, 37 | { 38 | "owner": "cpp", 39 | "fileLocation": "absolute", 40 | "pattern": { 41 | "regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 42 | "file": 1, 43 | "line": 2, 44 | "column": 3, 45 | "severity": 4, 46 | "message": 5 47 | } 48 | } 49 | ], 50 | "group": { 51 | "kind": "build", 52 | "isDefault": true 53 | } 54 | }, 55 | { 56 | "label": "Set ESP-IDF Target", 57 | "type": "shell", 58 | "command": "${command:espIdf.setTarget}", 59 | "problemMatcher": { 60 | "owner": "cpp", 61 | "fileLocation": "absolute", 62 | "pattern": { 63 | "regexp": "^(.*):(//d+):(//d+)://s+(warning|error)://s+(.*)$", 64 | "file": 1, 65 | "line": 2, 66 | "column": 3, 67 | "severity": 4, 68 | "message": 5 69 | } 70 | } 71 | }, 72 | { 73 | "label": "Clean - Clean the project", 74 | "type": "shell", 75 | "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py fullclean", 76 | "windows": { 77 | "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py fullclean", 78 | "options": { 79 | "env": { 80 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 81 | } 82 | } 83 | }, 84 | "options": { 85 | "env": { 86 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 87 | } 88 | }, 89 | "problemMatcher": [ 90 | { 91 | "owner": "cpp", 92 | "fileLocation": [ 93 | "relative", 94 | "${workspaceFolder}" 95 | ], 96 | "pattern": { 97 | "regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 98 | "file": 1, 99 | "line": 2, 100 | "column": 3, 101 | "severity": 4, 102 | "message": 5 103 | } 104 | }, 105 | { 106 | "owner": "cpp", 107 | "fileLocation": "absolute", 108 | "pattern": { 109 | "regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 110 | "file": 1, 111 | "line": 2, 112 | "column": 3, 113 | "severity": 4, 114 | "message": 5 115 | } 116 | } 117 | ] 118 | }, 119 | { 120 | "label": "Flash - Flash the device", 121 | "type": "shell", 122 | "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} -b ${config:idf.flashBaudRate} flash", 123 | "windows": { 124 | "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py flash -p ${config:idf.portWin} -b ${config:idf.flashBaudRate}", 125 | "options": { 126 | "env": { 127 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 128 | } 129 | } 130 | }, 131 | "options": { 132 | "env": { 133 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 134 | } 135 | }, 136 | "problemMatcher": [ 137 | { 138 | "owner": "cpp", 139 | "fileLocation": [ 140 | "relative", 141 | "${workspaceFolder}" 142 | ], 143 | "pattern": { 144 | "regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 145 | "file": 1, 146 | "line": 2, 147 | "column": 3, 148 | "severity": 4, 149 | "message": 5 150 | } 151 | }, 152 | { 153 | "owner": "cpp", 154 | "fileLocation": "absolute", 155 | "pattern": { 156 | "regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 157 | "file": 1, 158 | "line": 2, 159 | "column": 3, 160 | "severity": 4, 161 | "message": 5 162 | } 163 | } 164 | ] 165 | }, 166 | { 167 | "label": "Monitor: Start the monitor", 168 | "type": "shell", 169 | "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} monitor", 170 | "windows": { 171 | "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py -p ${config:idf.portWin} monitor", 172 | "options": { 173 | "env": { 174 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 175 | } 176 | } 177 | }, 178 | "options": { 179 | "env": { 180 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 181 | } 182 | }, 183 | "problemMatcher": [ 184 | { 185 | "owner": "cpp", 186 | "fileLocation": [ 187 | "relative", 188 | "${workspaceFolder}" 189 | ], 190 | "pattern": { 191 | "regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 192 | "file": 1, 193 | "line": 2, 194 | "column": 3, 195 | "severity": 4, 196 | "message": 5 197 | } 198 | }, 199 | { 200 | "owner": "cpp", 201 | "fileLocation": "absolute", 202 | "pattern": { 203 | "regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 204 | "file": 1, 205 | "line": 2, 206 | "column": 3, 207 | "severity": 4, 208 | "message": 5 209 | } 210 | } 211 | ], 212 | "dependsOn": "Flash - Flash the device" 213 | }, 214 | { 215 | "label": "OpenOCD: Start openOCD", 216 | "type": "shell", 217 | "presentation": { 218 | "echo": true, 219 | "reveal": "never", 220 | "focus": false, 221 | "panel": "new" 222 | }, 223 | "command": "openocd -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}", 224 | "windows": { 225 | "command": "openocd.exe -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}", 226 | "options": { 227 | "env": { 228 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 229 | } 230 | } 231 | }, 232 | "options": { 233 | "env": { 234 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 235 | } 236 | }, 237 | "problemMatcher": { 238 | "owner": "cpp", 239 | "fileLocation": "absolute", 240 | "pattern": { 241 | "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", 242 | "file": 1, 243 | "line": 2, 244 | "column": 3, 245 | "severity": 4, 246 | "message": 5 247 | } 248 | } 249 | }, 250 | { 251 | "label": "adapter", 252 | "type": "shell", 253 | "command": "${config:idf.pythonBinPath}", 254 | "isBackground": true, 255 | "options": { 256 | "env": { 257 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}", 258 | "PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter" 259 | } 260 | }, 261 | "problemMatcher": { 262 | "background": { 263 | "beginsPattern": "\bDEBUG_ADAPTER_STARTED\b", 264 | "endsPattern": "DEBUG_ADAPTER_READY2CONNECT", 265 | "activeOnStart": true 266 | }, 267 | "pattern": { 268 | "regexp": "(\\d+)-(\\d+)-(\\d+)\\s(\\d+):(\\d+):(\\d+),(\\d+)\\s-(.+)\\s(ERROR)", 269 | "file": 8, 270 | "line": 2, 271 | "column": 3, 272 | "severity": 4, 273 | "message": 9 274 | } 275 | }, 276 | "args": [ 277 | "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter_main.py", 278 | "-e", 279 | "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf", 280 | "-s", 281 | "${command:espIdf.getOpenOcdScriptValue}", 282 | "-ip", 283 | "localhost", 284 | "-dn", 285 | "${config:idf.adapterTargetName}", 286 | "-om", 287 | "connect_to_instance" 288 | ], 289 | "windows": { 290 | "command": "${config:idf.pythonBinPathWin}", 291 | "options": { 292 | "env": { 293 | "PATH": "${env:PATH};${config:idf.customExtraPaths}", 294 | "PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter" 295 | } 296 | } 297 | } 298 | } 299 | ] 300 | } --------------------------------------------------------------------------------