{"id":3418,"date":"2017-10-17T19:52:45","date_gmt":"2017-10-18T02:52:45","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=3418"},"modified":"2020-04-03T11:45:17","modified_gmt":"2020-04-03T18:45:17","slug":"developing-firmware-for-the-esp-wroom-32-module","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/esp32\/wroom\/","title":{"rendered":"Developing Firmware for the ESP-WROOM-32 Module"},"content":{"rendered":"<p>This tutorial shows how to develop and debug a simple WiFi HTTP server for the ESP-WROOM-32 module using Visual Studio and VisualGDB. Before you begin, install VisualGDB 5.3 or later.<\/p>\n<p><strong>Warning: The MSBuild-based ESP32 projects are deprecated since VisualGDB 5.4. Please use the <a href=\"https:\/\/visualgdb.com\/tutorials\/esp32\/esp-idf\/\">Advanced ESP-IDF Project Subsystem<\/a>\u00a0instead. The rest of the steps shown in this tutorial will still work.<\/strong><\/p>\n<p>In order to debug the ESP-WROOM-32 module over JTAG, you will need to use an external stabilized 3.3V power supply and a JTAG debugger (e.g. Olimex ARM-USB-OCD-H) and connect it to certain pins of the ESP-WROOM-32 module. The table below shows the relevant pins:<\/p>\n<table>\n<tbody>\n<tr>\n<td>ESP32 signal<\/td>\n<td>ESP-WROOM-32 signal<\/td>\n<td>JTAG signal<\/td>\n<td>JTAG20 pin<\/td>\n<\/tr>\n<tr>\n<td>+3.3V<\/td>\n<td>3V3<\/td>\n<td>VCC<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>CHIP_PU<\/td>\n<td>EN<\/td>\n<td>SRST<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>GND<\/td>\n<td>GND<\/td>\n<td>GND<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>MTDI<\/td>\n<td>GPIO12<\/td>\n<td>TDI<\/td>\n<td>5<\/td>\n<\/tr>\n<tr>\n<td>MTMS<\/td>\n<td>GPIO14<\/td>\n<td>TMS<\/td>\n<td>7<\/td>\n<\/tr>\n<tr>\n<td>MTCK<\/td>\n<td>GPIO13<\/td>\n<td>TCK<\/td>\n<td>9<\/td>\n<\/tr>\n<tr>\n<td>MTDO<\/td>\n<td>GPIO15<\/td>\n<td>TDO<\/td>\n<td>13<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>See <a href=\"https:\/\/dl.espressif.com\/dl\/schematics\/ESP-WROOM-32-v3.2_sch.pdf\">ESP-WROOM-32 schematics<\/a> for more details.<\/p>\n<p>You can use a breadboard to easily connect the relevant signals to a JTAG cable as shown below:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/wroom1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3430\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/wroom1.jpg\" alt=\"wroom\" width=\"1131\" height=\"1136\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/wroom1.jpg 1131w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/wroom1-150x150.jpg 150w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/wroom1-300x300.jpg 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/wroom1-1019x1024.jpg 1019w\" sizes=\"(max-width: 1131px) 100vw, 1131px\" \/><\/a><\/p>\n<p><strong>Warning! Be careful not to short-circuit nearby signals and double-check everything with a multimeter. Also note that confusing +3.3V and ground may instantly burn your ESP-WROOM-32!<\/strong><\/p>\n<p>The final setup of the ESP-WROOM-32 and a JTAG debugger would look as shown below:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/2boards2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3431\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/2boards2.jpg\" alt=\"2boards\" width=\"1200\" height=\"531\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/2boards2.jpg 1200w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/2boards2-300x133.jpg 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/2boards2-1024x453.jpg 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p>Once the wiring is configured, you can proceed with creating and testing out a basic project.<\/p>\n<p>Note:\u00a0VisualGDB 5.4 supports the new advanced ESP-IDF project subsystem that\u00a0delivers better development experience than MSBuild-projects shown in this tutorial. Once you get basic debugging to work, follow <a href=\"https:\/\/visualgdb.com\/tutorials\/esp32\/esp-idf\/\">this tutorial<\/a> to get started with the new advanced ESP-IDF project subsystem.<\/p>\n<ol>\n<li>Start Visual Studio and open the VisualGDB Embedded Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/01-newprj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3419\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/01-newprj.png\" alt=\"01-newprj\" width=\"832\" height=\"558\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/01-newprj.png 832w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/01-newprj-300x201.png 300w\" sizes=\"(max-width: 832px) 100vw, 832px\" \/><\/a><\/li>\n<li>Proceed with the default &#8220;New Project-&gt;MSBuild&#8221; setting:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/02-msbuild.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3420\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/02-msbuild.png\" alt=\"02-msbuild\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/02-msbuild.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/02-msbuild-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Select the ESP32 toolchain and the regular ESP32 device:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/03-esp32.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3421\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/03-esp32.png\" alt=\"03-esp32\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/03-esp32.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/03-esp32-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>As we have not soldered any LEDs on the board, we will proceed directly with the Wi-Fi example. Select &#8220;HTTP Server&#8221; and proceed with the default configuration:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/04-server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3422\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/04-server.png\" alt=\"04-server\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/04-server.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/04-server-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Connect your JTAG debugger to USB and select it in the &#8220;Debug Using&#8221; field. VisualGDB should automatically detect supported JTAG programmers and install the necessary drivers:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/05-dbgconf.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3423\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/05-dbgconf.png\" alt=\"05-dbgconf\" width=\"822\" height=\"642\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/05-dbgconf.png 822w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/05-dbgconf-300x234.png 300w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/li>\n<li>Click &#8220;Test&#8221; to check the connection. If you see errors like &#8220;scan chain interrogation failed&#8221;, double-check your wiring and power:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/06-test.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3424\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/06-test.png\" alt=\"06-test\" width=\"1058\" height=\"706\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/06-test.png 1058w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/06-test-300x200.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/06-test-1024x683.png 1024w\" sizes=\"(max-width: 1058px) 100vw, 1058px\" \/><\/a><\/li>\n<li>Press &#8220;Finish&#8221; to create the project and build it via Ctrl-Shift-B:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/07-build1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3425\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/07-build1.png\" alt=\"07-build\" width=\"1058\" height=\"706\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/07-build1.png 1058w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/07-build1-300x200.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/07-build1-1024x683.png 1024w\" sizes=\"(max-width: 1058px) 100vw, 1058px\" \/><\/a><\/li>\n<li>Set a breakpoint in the ServerTask() function and press F5 to begin debugging:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/08-flash.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3426\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/08-flash.png\" alt=\"08-flash\" width=\"1058\" height=\"706\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/08-flash.png 1058w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/08-flash-300x200.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/08-flash-1024x683.png 1024w\" sizes=\"(max-width: 1058px) 100vw, 1058px\" \/><\/a><\/li>\n<li>VisualGDB will program the FLASH memory in the ESP-WROOM-32 module and start debugging. The breakpoint will hit: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/09-hit.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3427\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/09-hit.png\" alt=\"09-hit\" width=\"1058\" height=\"706\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/09-hit.png 1058w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/09-hit-300x200.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2017\/10\/09-hit-1024x683.png 1024w\" sizes=\"(max-width: 1058px) 100vw, 1058px\" \/><\/a><\/li>\n<li>\u00a0Press F5 to continue debugging. Then locate the ESP32_VisualGDB Wi-Fi network from your device:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-wifi.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2369\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-wifi.png\" alt=\"09-wifi\" width=\"283\" height=\"342\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-wifi.png 283w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/09-wifi-248x300.png 248w\" sizes=\"(max-width: 283px) 100vw, 283px\" \/><\/a><\/li>\n<li>Once the connection is successful, open <strong>192.168.&lt;subnet&gt;.1<\/strong> in your browser:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-page.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2370\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-page.png\" alt=\"10-page\" width=\"671\" height=\"299\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-page.png 671w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/11\/10-page-300x134.png 300w\" sizes=\"(max-width: 671px) 100vw, 671px\" \/><\/a><\/li>\n<\/ol>\n<p>Congratulations! Now you customize the example to add your custom logic on top of it or explore one of the advanced samples provided by the <a href=\"https:\/\/visualgdb.com\/tutorials\/esp32\/esp-idf\/\">ESP-IDF project subsystem<\/a>. You can use all other GPIO pins on the ESP-WROOM-32 module to control your peripherals as long as you reserve the MTDI, MTDO, MTMS and MTCK pins for JTAG.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to develop and debug a simple WiFi HTTP server for the ESP-WROOM-32 module using Visual Studio<\/p>\n","protected":false},"author":1,"featured_media":3433,"comment_status":"closed","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[142],"tags":[138,101],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3418"}],"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=3418"}],"version-history":[{"count":4,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3418\/revisions"}],"predecessor-version":[{"id":5885,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3418\/revisions\/5885"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media\/3433"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=3418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=3418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=3418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}