{"id":5397,"date":"2019-11-14T09:28:09","date_gmt":"2019-11-14T17:28:09","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=5397"},"modified":"2025-09-09T19:28:49","modified_gmt":"2025-09-10T02:28:49","slug":"debugging-multiple-esp32-boards-with-visualgdb","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/esp32\/multi\/","title":{"rendered":"Debugging Multiple ESP32 Boards with VisualGDB"},"content":{"rendered":"<p>This tutorial shows how to debug multiple ESP32 boards using separate instances of Visual Studio with VisualGDB. We will show how to configure the ESP32-WROVER board to report a unique serial number and then use it in VisualGDB Project Properties to select a specific board instance that you would like to debug.<\/p>\n<p>Before you begin, install VisualGDB 5.4 or later.<\/p>\n<ol>\n<li>Start Visual Studio and open the VisualGDB ESP-IDF Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/01-newprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5398\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/01-newprj.png\" alt=\"\" width=\"1024\" height=\"710\" \/><\/a><\/li>\n<li>Specify the name and location for your project, then click &#8220;Create&#8221; to launch the VisualGDB&#8217;s portion of the wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/02-inst.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5399\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/02-inst.png\" alt=\"\" width=\"1024\" height=\"710\" \/><\/a><\/li>\n<li>On the first page of the wizard select &#8220;Create a new project based on a sample project -&gt; CMake&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/03-new.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5400\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/03-new.png\" alt=\"\" width=\"856\" height=\"693\" \/><\/a><\/li>\n<li>On the next page select your toolchain and ESP-IDF checkout:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/04-release.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5401\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/04-release.png\" alt=\"\" width=\"856\" height=\"693\" \/><\/a><strong>Update:<\/strong> For better compatibility with the latest ESP32 tools, we recommend selecting the <a href=\"https:\/\/visualgdb.com\/documentation\/espidf\/consolidated\/\">consolidated toolchain<\/a> instead.<\/li>\n<li>Proceed with the <strong>blink<\/strong> project sample:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/05-blink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5402\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/05-blink.png\" alt=\"\" width=\"856\" height=\"693\" \/><\/a><\/li>\n<li>Connect your board to the USB port and select it in the &#8220;Debug Using&#8221; field. Then press &#8220;Finish&#8221; to generate the project:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/06-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5403\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/06-debug.png\" alt=\"\" width=\"856\" height=\"693\" \/><\/a><\/li>\n<li>Build the solution by pressing Ctrl-Shift-B and ensure it succeeds:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/07-built.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5404\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/07-built.png\" alt=\"\" width=\"1227\" height=\"801\" \/><\/a>You can launch another instance of Visual Studio and repeat the steps shown above to create another project that will target another ESP32 board. The rest of the tutorial will show how to configure the boards to report unique serial numbers and how to configure VisualGDB to recognize the boards based on them.<\/li>\n<li>Open VisualGDB Project Properties for one of the projects and go to the Debug Settings page. Ensure you are using the &#8220;USB Devices&#8221; view and locate the serial number of your ESP32 board:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/08-sn.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5405\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/08-sn.png\" alt=\"\" width=\"1176\" height=\"754\" \/><\/a>If the serial number contains the &#8220;&amp;&#8221; character, it was temporarily generated by Windows because the board is not report a valid serial number. This will let Windows recognize the board, however VisualGDB and OpenOCD will not be able to distinguish it from other boards.<\/li>\n<li>The USB-to-JTAG interface on the ESP32 development boards is implemented by a <a href=\"https:\/\/www.ftdichip.com\/Products\/ICs\/FT2232D.html\">FT2232 chip<\/a> that is also used in many JTAG\/SWD debug adapters (e.g. Olimex ARM-USB-OCD-H). This enables tools like OpenOCD to recognize the board out-of-the-box and also allows using the FTDI tools to edit the FT2232 configuration. Download, install and launch the <a href=\"https:\/\/www.ftdichip.com\/Support\/Utilities.htm#FT_PROG\">FT_Prog tool<\/a> from the FTDI website. Once it launches, select <strong>Devices-&gt;Scan and Parse<\/strong>:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/09-ftprog.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5406\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/09-ftprog.png\" alt=\"\" width=\"624\" height=\"729\" \/><\/a><\/li>\n<li>FT_Prog will display the configuration for the FT2232 chip on the ESP32 board connected to your computer. Go to the <strong>USB String Descriptors<\/strong> page and ensure that the &#8220;<strong>Serial Number Enabled<\/strong>&#8221; and &#8220;<strong>Auto Generate Serial No<\/strong>&#8221; checkboxes are checked:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/10-sn.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5407\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/10-sn.png\" alt=\"\" width=\"624\" height=\"729\" \/><\/a><strong>Warning: Do not modify any other settings, as it may stop the board from being recognized<\/strong>.<\/li>\n<li>Select <strong>Devices-&gt;Program<\/strong> in the FT_Prog tool:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/11-program.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5408\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/11-program.png\" alt=\"\" width=\"624\" height=\"730\" \/><\/a><\/li>\n<li>If you have not used FT_Prog with this board before, the device will be marked as a <strong>BLANK DEVICE<\/strong> (i.e. having no serial number). Confirm that the &#8220;Serial Number&#8221; is set to &#8220;Auto-Generate&#8221; and click &#8220;Program&#8221; to proceed:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/12-confirm.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5409\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/12-confirm.png\" alt=\"\" width=\"562\" height=\"377\" \/><\/a><\/li>\n<li>Unplug the ESP32 board from your USB port and plug it back. Reopen VisualGDB Project Properties and check that the serial number for the board no longer includes the &#8220;&amp;&#8221; character:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/13-sn.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5410\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/13-sn.png\" alt=\"\" width=\"1142\" height=\"754\" \/><\/a><\/li>\n<li>Now you will be able to select a specific ESP32 board instance for each project and launch multiple simultaneous debug sessions from multiple Visual Studio instances. If you are using OpenOCD manually, you can add the following command-line argument after specifying the <strong>esp32_devkitj_v1.cfg<\/strong> script:\n<pre class=\"\">-c \"ftdi_serial FT3WOY1V\"<\/pre>\n<p>Replace <strong>FT3WOY1V<\/strong> with the serial number shown in the Device Manager&#8217;s properties for the USB Composite Device that corresponds to your board:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/14-device.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5411\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/11\/14-device.png\" alt=\"\" width=\"953\" height=\"598\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to debug multiple ESP32 boards using separate instances of Visual Studio with VisualGDB. We will show<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[142],"tags":[138,143],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/5397"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=5397"}],"version-history":[{"count":2,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/5397\/revisions"}],"predecessor-version":[{"id":9040,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/5397\/revisions\/9040"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=5397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=5397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=5397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}