[Info] Building ESP32 applications on Windows using Visual Studio
Posted: Tue Oct 11, 2016 4:30 am
A recent post asked about using Microsoft Visual Studio to build ESP32 applications as opposed to command line or Eclipse. I thought I'd have a cursory look. I know nothing about Visual Studio as I haven't built Windows native applications in the longest time. There is a free version from Microsoft called "Visual Studio Community" that can be downloaded here.
https://www.visualstudio.com/downloads/
However, before you go down this path, let me cut to the chase as I currently understand it. You won't easily be able to use Visual Studio to build ESP32 applications. My thinking behind this is that Visual Studio is designed to build applications that run on Windows platforms and is probably excellent at that. If I was going to build an app that runs on Windows, IE or against other Microsoft products, it is likely that this is the perfect tool/product. However, our target here is an ESP32 device and not Windows.
To start with, there is only one known compiler that will build ESP32 binaries and that is the cross compiler that is based on "gcc" for the Xtensa architecture. Visual Studio provides its own compilers and doesn't appear to be obviously engineered to interact with others.
Next we have the ESP-IDF build environment. This is based on the "Makefile" concepts along with the "make" tool. While Visual Studio does appear to have a tool called "nmake", that is more of a side nod that a provision of a "make" environment. When we set include directories, libraries and other goodies, those don't appear to touch the make system.
Does that mean that we simply can't use Visual Studio to build ESP32 applications? The answer is no as evidenced by this product:
http://visualgdb.com/
VisualGDB appears to be all the tooling one needs to run Makefiles and cross compilers from within Visual Studio and if I were a developer with a world of experience in working in Visual Studio on a Windows platform and wanted to maintain that investment, then VisualGDB would be a no-brainer. However for a hobbyist, there is a catch. There is a modest ($89) license fee for the product. In the schemes of things, this is dirt cheap/inconsequential ... but if we are not professionals and are paying for the tools out of our own pockets ... one has to really want to use Visual Studio as opposed to command line or Eclipse.
https://www.visualstudio.com/downloads/
However, before you go down this path, let me cut to the chase as I currently understand it. You won't easily be able to use Visual Studio to build ESP32 applications. My thinking behind this is that Visual Studio is designed to build applications that run on Windows platforms and is probably excellent at that. If I was going to build an app that runs on Windows, IE or against other Microsoft products, it is likely that this is the perfect tool/product. However, our target here is an ESP32 device and not Windows.
To start with, there is only one known compiler that will build ESP32 binaries and that is the cross compiler that is based on "gcc" for the Xtensa architecture. Visual Studio provides its own compilers and doesn't appear to be obviously engineered to interact with others.
Next we have the ESP-IDF build environment. This is based on the "Makefile" concepts along with the "make" tool. While Visual Studio does appear to have a tool called "nmake", that is more of a side nod that a provision of a "make" environment. When we set include directories, libraries and other goodies, those don't appear to touch the make system.
Does that mean that we simply can't use Visual Studio to build ESP32 applications? The answer is no as evidenced by this product:
http://visualgdb.com/
VisualGDB appears to be all the tooling one needs to run Makefiles and cross compilers from within Visual Studio and if I were a developer with a world of experience in working in Visual Studio on a Windows platform and wanted to maintain that investment, then VisualGDB would be a no-brainer. However for a hobbyist, there is a catch. There is a modest ($89) license fee for the product. In the schemes of things, this is dirt cheap/inconsequential ... but if we are not professionals and are paying for the tools out of our own pockets ... one has to really want to use Visual Studio as opposed to command line or Eclipse.