{"id":4826,"date":"2019-06-10T07:03:51","date_gmt":"2019-06-10T14:03:51","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=4826"},"modified":"2025-09-09T19:31:26","modified_gmt":"2025-09-10T02:31:26","slug":"creating-esp-adf-projects-with-visual-studio","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/esp32\/esp-adf\/","title":{"rendered":"Creating ESP-ADF Projects with Visual Studio"},"content":{"rendered":"<p>This tutorial shows how to use Visual Studio with VisualGDB to create C\/C++ projects for ESP32 devices using the ESP-ADF (Audio Development framework).<\/p>\n<p>We will show how to create a basic project, upload it into the FLASH memory of the ESP32-LyraT board and test it out.<\/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\/ADF Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/01-newprj-6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4827\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/01-newprj-6.png\" alt=\"\" width=\"891\" height=\"639\" \/><\/a><\/li>\n<li>If you would like to use <strong>ESP-ADF 1.x<\/strong> that does not support CMake, select GNU Make on the first page. If you are using <strong>ESP-ADF 2.x<\/strong>, select CMake:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/02-gnumake-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4828\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/02-gnumake-1.png\" alt=\"\" width=\"856\" height=\"693\" \/><\/a><\/li>\n<li>On the next page select the ESP32 toolchain and click &#8220;Clone an SDK release from Github&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/03-clone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4829\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/03-clone.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>Select &#8220;ESP-ADF (audio)&#8221; as the SDK type and pick the latest stable release. Then click &#8220;OK&#8221; to import the SDK into VisualGDB:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/04-release.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4830\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/04-release.png\" alt=\"\" width=\"586\" height=\"230\" \/><\/a><strong><strong>WARNING: Each ESP-ADF release will only work with a specific ESP32 toolchain. You can find it out by looking up the ESP-IDF version bundled with ESP-ADF <a href=\"https:\/\/github.com\/espressif\/esp-adf#idf-version\">here<\/a>, and then manually downloading an <a href=\"https:\/\/gnutoolchains.com\/esp32\/\">ESP32 toolchain<\/a> compatible with that ESP-IDF.<br \/>\n<\/strong><\/strong><\/li>\n<li>Once VisualGDB finishes checking out ESP-ADF, ensure it is selected in the &#8220;SDK Checkout&#8221; field and click &#8220;Next&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/05-espadf.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4831\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/05-espadf.png\" alt=\"\" width=\"856\" height=\"693\" \/><\/a><\/li>\n<li>The next page of the wizard allows selecting a project sample that will be cloned when creating the new project. Select the <strong>play_mp3<\/strong> sample in the <strong>get-started<\/strong> folder:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/06-play.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4832\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/06-play.png\" alt=\"\" width=\"856\" height=\"693\" \/><\/a><\/li>\n<li>Debugging the ESP32-LyraT board via JTAG requires a separate JTAG programmer and additional wiring setup, so in this tutorial we will not use JTAG debugging, focusing on building and configuring the project. Connect both power and UART ports of the board to USB and plug in headphones into the analog output port as shown below:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/board-annotated.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4840\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/board-annotated.jpg\" alt=\"\" width=\"1280\" height=\"648\" \/><\/a><\/li>\n<li>Select the COM port of the board on the &#8220;Debug Method&#8221; page of the wizard so that VisualGDB can program the FLASH memory via this port:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/07-port.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4833\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/07-port.png\" alt=\"\" width=\"856\" height=\"693\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to generate the project. VisualGDB will clone the selected example and query its detailed structure from the ESP-ADF framework, reflecting it in Solution Explorer:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/08-loaded.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4834\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/08-loaded.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><strong>WARNING: if the project does not load or does not build, please make sure you are using the ESP32 toolchain based on GCC 5.2.0. ESP-ADF does not support the newer toolchains based on GCC 8.x.<br \/>\n<\/strong><\/li>\n<li>Open VisualGDB Project Properties and go to the <strong>ESP-IDF Configuration<\/strong> section on the first page. Ensure that the <strong>Audio Board<\/strong> setting matches the board you are using:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/09-board.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4835\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/09-board.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><\/li>\n<li>We also recommend setting the <strong>Default serial port<\/strong> to the COM port of your board to allow programming it using the context menu in Solution Explorer:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/10-port.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4836\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/10-port.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><\/li>\n<li>Build the project by pressing Ctrl-Shift-B and ensure the build succeeds:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/11-built.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4837\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/11-built.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><\/li>\n<li>You can use the <strong>View-&gt;Embedded Memory Explorer<\/strong> command to get a detailed overview of the project&#8217;s memory footprint:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/eme.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4841\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/eme.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><\/li>\n<li>The ESP32-LyraT board does not include the wiring to automatically switch the ESP32 chip into the bootloader mode. This needs to be done manually by holding the <strong>Boot<\/strong> button, pressing and releasing the <strong>RST<\/strong> button and finally releasing the <strong>Boot<\/strong> button. Once this is done, press F5 to begin programming the FLASH memory via the COM port: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/12-program-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4838\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/12-program-1.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><\/li>\n<li>Once VisualGDB reports that the memory has been programmed, the board will start playing a sample MP3 file into the headphones connected to the audio output jack: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/13-done.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4839\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/13-done.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a>If you do not hear the playback via the headphones, try resetting the board by pressing the RST button.<\/li>\n<li>You can configure VisualGDB to display the output from board&#8217;s COM port via the Raw Terminal page of VisualGDB Project Properties (Custom edition and higher):<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/com.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4842\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/com.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><\/li>\n<li>Once the port is configured, use the context menu in Solution Explorer to connect to the port:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/open.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4843\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/open.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><\/li>\n<li>VisualGDB will then connect to the board&#8217;s COM port and display the output produced by the ESP-ADF framework:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/term.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4844\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2019\/06\/term.png\" alt=\"\" width=\"1131\" height=\"807\" \/><\/a><\/li>\n<\/ol>\n<p>If you would like to debug your ESP-ADF-based firmware on the ESP32-LyraT board via JTAG, follow <a href=\"https:\/\/visualgdb.com\/tutorials\/esp32\/lyrat\/\">this tutorial<\/a> to get JTAG to work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to use Visual Studio with VisualGDB to create C\/C++ projects for ESP32 devices using the ESP-ADF<\/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":[181,182,138],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4826"}],"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=4826"}],"version-history":[{"count":12,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4826\/revisions"}],"predecessor-version":[{"id":9047,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/4826\/revisions\/9047"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=4826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=4826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=4826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}