{"id":3843,"date":"2018-03-26T13:50:13","date_gmt":"2018-03-26T20:50:13","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=3843"},"modified":"2021-09-23T17:16:38","modified_gmt":"2021-09-24T00:16:38","slug":"switching-advanced-esp-idf-projects-between-different-idf-versions","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/esp32\/esp-idf\/multiple\/","title":{"rendered":"Switching Advanced ESP-IDF Projects Between Different IDF Versions"},"content":{"rendered":"<p>This tutorial shows how to install several independent ESP-IDF checkouts into your ESP32 toolchain and switch the advanced ESP-IDF projects between those IDF versions. We will create a basic project\u00a0based on the ESP-IDF 3.0 release and\u00a0show how to switch it to the experimental master branch of ESP-IDF from github.<\/p>\n<p>Before you begin, install VisualGDB 5.4 or later.<\/p>\n<ol>\n<li>Start Visual Studio and open the Advanced ESP-IDF Project Wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/01-prj1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3844\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/01-prj1.png\" alt=\"01-prj\" width=\"941\" height=\"653\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/01-prj1.png 941w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/01-prj1-300x208.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/01-prj1-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/01-prj1-130x90.png 130w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/a><\/li>\n<li>On the first page of the wizard select &#8220;Create a new project&#8221; and click &#8220;Next&#8221;: <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/02-create.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3845\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/02-create.png\" alt=\"02-create\" width=\"856\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/02-create.png 856w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/02-create-300x243.png 300w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/a><\/li>\n<li>On the next page select your ESP32 toolchain. VisualGDB will display the list of ESP-IDF checkouts\u00a0installed into that toolchain.\u00a0Select the default checkout and click &#8220;Next&#8221;:<br \/>\n<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/03-v3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3846\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/03-v3.png\" alt=\"03-v3\" width=\"856\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/03-v3.png 856w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/03-v3-300x243.png 300w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/a><\/li>\n<li>As\u00a0different ESP-IDF versions may not be 100%\u00a0compatible with each other, we will\u00a0use the most basic &#8220;blink&#8221; project to\u00a0demonstrate switching between IDF versions. Select it on the &#8220;Project Sample&#8221; page and click &#8220;Next&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/04-blink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3847\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/04-blink.png\" alt=\"04-blink\" width=\"856\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/04-blink.png 856w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/04-blink-300x243.png 300w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/a><\/li>\n<li>Finally select the debugging settings that match your project and click &#8220;Finish&#8221; to create it.<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/05-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3848\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/05-debug.png\" alt=\"05-debug\" width=\"856\" height=\"693\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/05-debug.png 856w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/05-debug-300x243.png 300w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/a><\/li>\n<li>VisualGDB will create a basic project. Note that the project itself doesn&#8217;t include a copy of ESP-IDF and only includes the following files:<br \/>\n<table>\n<tbody>\n<tr>\n<td>File<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Makefile<\/td>\n<td>Project-level\u00a0Make file\u00a0defining project name and other options.<\/td>\n<\/tr>\n<tr>\n<td>&lt;project&gt;.vgdbproj<\/td>\n<td>VisualGDB project file containing\u00a0debugging settings, basic build settings and the list of configurations.<\/td>\n<\/tr>\n<tr>\n<td>sdkconfig-&lt;configuration&gt;<\/td>\n<td>Per-configuration sdkconfig files. They will be created first time you open the corresponding configuration of the project.<\/td>\n<\/tr>\n<tr>\n<td>main\\component.mk<\/td>\n<td>Configuration file for the main project component.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/06-files.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3849\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/06-files.png\" alt=\"06-files\" width=\"786\" height=\"406\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/06-files.png 786w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/06-files-300x155.png 300w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/a><\/li>\n<li>Note that the ESP-IDF path is not\u00a0stored in any of the project-specific Makefiles. Instead VisualGDB will locate and substitute it dynamically when you open or build the project:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/07-prj.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3850\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/07-prj.png\" alt=\"07-prj\" width=\"1100\" height=\"767\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/07-prj.png 1100w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/07-prj-300x209.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/07-prj-1024x714.png 1024w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/07-prj-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/07-prj-130x90.png 130w\" sizes=\"(max-width: 1100px) 100vw, 1100px\" \/><\/a><\/li>\n<li>Now we will show how to change the\u00a0ESP-IDF version. Open VisualGDB Project Properties on the first page, select &#8220;Build Directory&#8221; -&gt; &#8220;Clone an ESP-IDF release&#8221;:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/08-clone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3851\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/08-clone.png\" alt=\"08-clone\" width=\"1021\" height=\"659\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/08-clone.png 1021w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/08-clone-300x194.png 300w\" sizes=\"(max-width: 1021px) 100vw, 1021px\" \/><\/a><\/li>\n<li>Pick the version you want to clone (VisualGDB will automatically load the list of release tags from the github repository) and click OK:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/09-runclone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3852\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/09-runclone.png\" alt=\"09-runclone\" width=\"522\" height=\"200\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/09-runclone.png 522w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/09-runclone-300x115.png 300w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/a><\/li>\n<li>VisualGDB will automatically launch git and create a recursive checkout of ESP-IDF and all related libraries:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/10-progress.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3853\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/10-progress.png\" alt=\"10-progress\" width=\"656\" height=\"358\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/10-progress.png 656w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/10-progress-300x164.png 300w\" sizes=\"(max-width: 656px) 100vw, 656px\" \/><\/a><\/li>\n<li>Once the checkout is complete, you will be able to select it in VisualGDB Project Properties or in the\u00a0ESP-IDF project wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/11-master.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3854\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/11-master.png\" alt=\"11-master\" width=\"1021\" height=\"659\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/11-master.png 1021w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/11-master-300x194.png 300w\" sizes=\"(max-width: 1021px) 100vw, 1021px\" \/><\/a><\/li>\n<li>Build the project again. Note how VisualGDB now\u00a0sets IDF_PATH to match the new checkout\u00a0location:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/12-buildmaster1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3860\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/12-buildmaster1.png\" alt=\"12-buildmaster\" width=\"1100\" height=\"767\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/12-buildmaster1.png 1100w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/12-buildmaster1-300x209.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/12-buildmaster1-1024x714.png 1024w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/12-buildmaster1-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/12-buildmaster1-130x90.png 130w\" sizes=\"(max-width: 1100px) 100vw, 1100px\" \/><\/a><\/li>\n<li>Once VisualGDB updates the code model, Solution Explorer will switch to showing files from the new ESP-IDF checkout as well:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/12-buildmaster.png\"><br \/>\n<\/a> <a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/13-built.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3856\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/13-built.png\" alt=\"13-built\" width=\"1100\" height=\"767\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/13-built.png 1100w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/13-built-300x209.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/13-built-1024x714.png 1024w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/13-built-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/13-built-130x90.png 130w\" sizes=\"(max-width: 1100px) 100vw, 1100px\" \/><\/a>You can always switch the checkout back and forth via VisualGDB Project Properties. As long as it is present in your toolchain directory, you don&#8217;t need to\u00a0re-clone it each time.<\/li>\n<li>VisualGDB doesn&#8217;t hardcode the absolute path of the checkout in the project properties file. Instead it\u00a0stores the git branch name and the subdirectory in the toolchain folder (in case multiple copies of the same branch are checked out to different locations):<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/14-refs.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3857\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/14-refs.png\" alt=\"14-refs\" width=\"1039\" height=\"559\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/14-refs.png 1039w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/14-refs-300x161.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/14-refs-1024x551.png 1024w\" sizes=\"(max-width: 1039px) 100vw, 1039px\" \/><\/a>If you open the same project on another machine, VisualGDB will first try locating a checkout by both version and subdirectory, and if\u00a0none is found, will fall back to using version only.<\/li>\n<li>The list of ESP-IDF checkouts is stored in the &lt;toolchain directory&gt;\\IDFCheckouts.xml file. If you decide to\u00a0work on a private fork of ESP-IDF, ensure you distribute the same\u00a0checkout (and the corresponding IDFCheckouts.xml file) to all your development machines:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/15-checkouts.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3858\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/15-checkouts.png\" alt=\"15-checkouts\" width=\"1039\" height=\"403\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/15-checkouts.png 1039w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/15-checkouts-300x116.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/15-checkouts-1024x397.png 1024w\" sizes=\"(max-width: 1039px) 100vw, 1039px\" \/><\/a><\/li>\n<li>You can delete the checkouts you don&#8217;t need anymore directly from\u00a0the checkout selector in VisualGDB Project Properties and the ESP-IDF project wizard:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/16-delete.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3859\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/16-delete.png\" alt=\"16-delete\" width=\"1100\" height=\"767\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/16-delete.png 1100w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/16-delete-300x209.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/16-delete-1024x714.png 1024w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/16-delete-392x272.png 392w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2018\/03\/16-delete-130x90.png 130w\" sizes=\"(max-width: 1100px) 100vw, 1100px\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to install several independent ESP-IDF checkouts into your ESP32 toolchain and switch the advanced ESP-IDF projects<\/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":[160,138],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3843"}],"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=3843"}],"version-history":[{"count":5,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3843\/revisions"}],"predecessor-version":[{"id":7509,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/3843\/revisions\/7509"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=3843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=3843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=3843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}