{"id":23802361,"url":"https://github.com/technosf/esp-blink-vscode-ftdi","last_synced_at":"2025-06-20T00:05:23.760Z","repository":{"id":75890639,"uuid":"312929821","full_name":"technosf/ESP-Blink-VSCode-FTDI","owner":"technosf","description":"ESP32 Blink example with VSCode FTDI debug configs","archived":false,"fork":false,"pushed_at":"2020-11-18T02:36:32.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-21T16:46:58.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technosf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-15T00:42:14.000Z","updated_at":"2020-12-08T18:19:24.000Z","dependencies_parsed_at":"2023-07-11T23:45:43.433Z","dependency_job_id":null,"html_url":"https://github.com/technosf/ESP-Blink-VSCode-FTDI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/technosf/ESP-Blink-VSCode-FTDI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technosf%2FESP-Blink-VSCode-FTDI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technosf%2FESP-Blink-VSCode-FTDI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technosf%2FESP-Blink-VSCode-FTDI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technosf%2FESP-Blink-VSCode-FTDI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technosf","download_url":"https://codeload.github.com/technosf/ESP-Blink-VSCode-FTDI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technosf%2FESP-Blink-VSCode-FTDI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260852138,"owners_count":23072602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-01T22:21:04.854Z","updated_at":"2025-06-20T00:05:18.735Z","avatar_url":"https://github.com/technosf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP-Blink-VSCode-FTDI\nThis repo contains the ESP32 Blink example with VSCode FTDI debug configs. It's where I'm experimenting with getting it all to work, which is somewhat problematic :(\n\n\u003c!-- TOC --\u003e\n\n- [Overview](#overview)\n    - [Dev Board](#dev-board)\n    - [FTDI Connector](#ftdi-connector)\n    - [VSCode](#vscode)\n        - [settings.json](#settingsjson)\n        - [launch.jsonon](#launchjsonon)\n- [Errors](#errors)\n    - [ESP32 Monitor Output](#esp32-monitor-output)\n    - [GDB Terminal](#gdb-terminal)\n    - [OpenOCD Output](#openocd-output)\n    - [VSCode](#vscode)\n\n\u003c!-- /TOC --\u003e\n\n## Overview\nThe idea of a debugger integrated with an IDE to poke around and step through the ESP32 is appealing, but the reality of getting it to work is challenging (in my experience).\n\nVSCode provides an OpenOCD server (which communicates via an FTDI JTAG cable to the ESP32s [JTAG](https://en.wikipedia.org/wiki/JTAG) interface) and a generic GDB visual interface that is configured to use the ESP-IDFs `xtensa-esp32-elf-gdb` debugger. The debugger connects to OpenOCD and thus to the ESP32. _In theory._\n\nIn practice I appear to have the GDB terminal stepping through the code and the VSCode debugger stepping through something completely different.\n\n### Dev Board\nMy dev system is a Intel-based Linux machine, with an ESP32 WROOM-32 devkit on `/dev/ttyESP`\n\n\n### FTDI Connector\nI'm using a [FTDI C232HM-DDHSL-0](https://www.ftdichip.com/Products/Cables/USBMPSSE.htm). It is _3.3v_ and it lives on `/dev/ttyFTDI`\n\n### VSCode\nI'm on the latest VSCode - _1.5.1.1_ as of writing.\n\n\n#### settings.json\nThis is the OpenOCD server config that VSCode kicks off.\nNote that I modified `interface/ftdi/c232hm.cfg` to add the comms speed with a line `adapter_khz 20000`.\n```\n  \"idf.port\": \"/dev/ttyESP\",\n  \"idf.showOnboardingOnInit\": false,\n  \"idf.openOcdConfigs\": [\n      \"/dev/ttyFTDI\",\n      \"board/esp32-wrover-kit-3.3v.cfg\",\n      \"interface/ftdi/c232hm.cfg\"\n  ]\n  ```\n\n#### launch.jsonon\n  This is the GDB configuration.\n  ```\n   {\n            \"name\": \"(gdb) Launch\",\n            \"type\": \"cppdbg\",\n            \"request\": \"launch\",\n            \"program\": \"${env:HOME}/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb\",\n            \"args\": [\n                \"-x\",\n                \"${workspaceFolder}/gdbinit\",\n                \"${workspaceFolder}/build/blink.elf\"\n            ],\n            \"stopAtEntry\": false,\n            \"cwd\": \"${workspaceFolder}\",\n            \"environment\": [],\n            \"externalConsole\": false,\n            \"MIMode\": \"gdb\",\n            \"setupCommands\": [\n                {\n                    \"description\": \"Enable pretty-printing for gdb\",\n                    \"text\": \"-enable-pretty-printing\",\n                    \"ignoreFailures\": true\n                }\n            ]\n        }\n  ```\n\n## Errors\nOn the whole, it looks to all hang together, but trying to step through the code, hit break points or examine storage is non-functional.\n\n### ESP32 Monitor Output\nThe chip hangs as if at a breakpoint waiting for VSCode to tell it to continue:\n```\nI (197) cpu_start: Application information:\nI (201) cpu_start: Project name:     blink\nI (206) cpu_start: App version:      1\nI (211) cpu_start: Compile time:     Nov 14 2020 15:54:30\nI (217) cpu_start: ELF file SHA256:  705499d79b77531d...\nI (223) cpu_start: ESP-IDF:          v4.2-beta1-227-gf0e87c933\nI (229) cpu_start: Starting app cpu, entry point is 0x400815c0\n0x400815c0: call_start_cpu1 at ~/esp/esp-idf/components/esp32/cpu_start.c:287\n\nI (221) cpu_start: App cpu up.\nI (240) heap_init: Initializing. RAM available for dynamic allocation:\nI (247) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM\nI (253) heap_init: At 3FFB28B0 len 0002D750 (181 KiB): DRAM\nI (259) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM\nI (265) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM\nI (272) heap_init: At 40089EB0 len 00016150 (88 KiB): IRAM\nI (278) cpu_start: Pro cpu start user code\nI (296) spi_flash: detected chip: generic\nI (297) spi_flash: flash io: dio\nI (297) cpu_start: Starting scheduler on PRO CPU.\nI (0) cpu_start: Starting scheduler on APP CPU.\n```\n\n### GDB Terminal\n```\nGNU gdb (crosstool-NG esp-2020r3) 8.1.0.20180627-git\nCopyright (C) 2018 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttp://gnu.org/licenses/gpl.html\u003e\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\nThis GDB was configured as \"--host=x86_64-build_pc-linux-gnu --target=xtensa-esp32-elf\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n\u003chttp://www.gnu.org/software/gdb/bugs/\u003e.\nFind the GDB manual and other documentation resources online at:\n\u003chttp://www.gnu.org/software/gdb/documentation/\u003e.\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\"...\nReading symbols from /home/martin/workspaces/vscode/ESP-Blink-VSCode-FTDI/build/blink.elf...done.\n0x400e262a in esp_pm_impl_waiti () at /home/martin/esp/esp-idf/components/esp32/pm_esp32.c:484\n484         asm(\"waiti 0\");\nJTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)\nJTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)\ncpu0: Debug controller 0 was reset.\ncpu0: Core 0 was reset.\ncpu0: Target halted, PC=0x500000CF, debug_reason=00000000\nesp32: Core 0 was reset.\nesp32: Debug controller 1 was reset.\nesp32: Core 1 was reset.\nTarget halted. CPU0: PC=0x40000400 (active)\nTarget halted. CPU1: PC=0x40000400 \nHardware assisted breakpoint 1 at 0x400d2b07: file ../main/blink.c, line 28.\nTarget halted. CPU0: PC=0x400D2B07 (active)\nTarget halted. CPU1: PC=0x400E262A \n[New Thread 1073436320]\n[New Thread 1073434428]\n[New Thread 1073438968]\n[New Thread 1073426644]\n[New Thread 1073412788]\n[New Thread 1073413520]\n[New Thread 1073427784]\n[Switching to Thread 1073432536]\n\nThread 1 hit Temporary breakpoint 1, app_main () at ../main/blink.c:28\n28          gpio_pad_select_gpio(BLINK_GPIO);\n(gdb) \n```\n\n### OpenOCD Output\nLooks good, AFAICT\n```\nOpen On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\nInfo : Configured 2 cores\nWarn : Interface already configured, ignoring\nInfo : Listening on port 6666 for tcl connections\nInfo : Listening on port 4444 for telnet connections\nInfo : ftdi: if you experience problems at higher adapter clocks, try the command \"ftdi_tdo_sample_edge falling\"\nInfo : clock speed 20000 kHz\nInfo : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)\nInfo : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)\nInfo : Target halted. CPU0: PC=0x400D2B07 (active)\nInfo : Target halted. CPU1: PC=0x400E262A \nInfo : Listening on port 3333 for gdb connections\n❌ Info : accepting 'gdb' connection on tcp/3333\nError: No symbols for FreeRTOS\nInfo : cpu0: Target halted, PC=0x40091856, debug_reason=00000001\nInfo : Flash mapping 0: 0x10020 -\u003e 0x3f400020, 23 KB\nInfo : Flash mapping 1: 0x20020 -\u003e 0x400d0020, 75 KB\nInfo : cpu0: Target halted, PC=0x40091856, debug_reason=00000001\nInfo : Auto-detected flash bank 'esp32.flash' size 4096 KB\nInfo : Using flash bank 'esp32.flash' size 4096 KB\nInfo : cpu0: Target halted, PC=0x40091856, debug_reason=00000001\nInfo : Flash mapping 0: 0x10020 -\u003e 0x3f400020, 23 KB\nInfo : Flash mapping 1: 0x20020 -\u003e 0x400d0020, 75 KB\nInfo : Using flash bank 'esp32.irom' size 76 KB\nInfo : cpu0: Target halted, PC=0x40091856, debug_reason=00000001\nInfo : Flash mapping 0: 0x10020 -\u003e 0x3f400020, 23 KB\nInfo : Flash mapping 1: 0x20020 -\u003e 0x400d0020, 75 KB\nInfo : Using flash bank 'esp32.drom' size 24 KB\nInfo : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)\nInfo : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)\nInfo : cpu0: Debug controller 0 was reset.\nInfo : cpu0: Core 0 was reset.\nInfo : cpu0: Target halted, PC=0x500000CF, debug_reason=00000000\nInfo : esp32: Core 0 was reset.\nInfo : esp32: Debug controller 1 was reset.\nInfo : esp32: Core 1 was reset.\nInfo : Target halted. CPU0: PC=0x40000400 (active)\nInfo : Target halted. CPU1: PC=0x40000400 \nInfo : Target halted. CPU0: PC=0x400D2B07 (active)\nInfo : Target halted. CPU1: PC=0x400E262A \n```\n\n### VSCode\nA couple of error panels come up trying to budge the debugger, they complain of missing source:\n```\nUnable to open 'poll.c': Unable to read file '/build/glibc-ZN95T4/glibc-2.31/sysdeps/unix/sysv/linux/poll.c' (Error: Unable to resolve non-existing file '/build/glibc-ZN95T4/glibc-2.31/sysdeps/unix/sysv/linux/poll.c').\n```\n\n```\nUnable to open 'libc-start.c': Unable to read file '/build/glibc-ZN95T4/glibc-2.31/csu/libc-start.c' (Error: Unable to resolve non-existing file '/build/glibc-ZN95T4/glibc-2.31/csu/libc-start.c').\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnosf%2Fesp-blink-vscode-ftdi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnosf%2Fesp-blink-vscode-ftdi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnosf%2Fesp-blink-vscode-ftdi/lists"}