The great news is that the latest versions of Windows 10 support excellent integration between a Linux distribution and windows. Here are some of the core links:
https://msdn.microsoft.com/en-us/commandline/wsl/about
What this means for us in ESP32 land is that we can configure Windows Subsystem for Linux (WSL) and instantly open an shell prompt. In that shell prompt, we can install an ESP-IDF environment including the tool chain and build ESP-IDF applications. We can also access the COM/serial port and flash to the device. Within WSL we can access the Windows file system meaning that we can use Windows based editing tools (eg. Eclipse or Visual Studio ...) and perform our editing.
This appears to be first class integration between Windows and Linux and (opinion) should mean that there should be little use for tools that attempted to provide a Posix environment in windows on Windows itself.
In tests, no significant problems were found. The worst was attempting to perform parallel builds with "make -j5" which seemed to fail non-deterministically.
Notes on using Windows Subsystem for Linux with ESP-IDF
Notes on using Windows Subsystem for Linux with ESP-IDF
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
-
- Posts: 79
- Joined: Tue Apr 26, 2016 5:10 am
Re: Notes on using Windows Subsystem for Linux with ESP-IDF
I have tinkered with it before, and it seemed to work well for me.
The only major problem that i encountered is that when cloning all the source code, it needs to be cloned with Linux line endings (yes sounds obvious i know), as i found it would not build with the windows style line endings. (where the MSYS32 environment will).
Not really a big deal, but could be a trap for new people.
The only major problem that i encountered is that when cloning all the source code, it needs to be cloned with Linux line endings (yes sounds obvious i know), as i found it would not build with the windows style line endings. (where the MSYS32 environment will).
Not really a big deal, but could be a trap for new people.
Re: Notes on using Windows Subsystem for Linux with ESP-IDF
That's interesting, thanks Lucas. We actually run a test as part of our Continuous Integration (on Linux) that an example can be built with all of the IDF code switched to windows line endings. It seems odd that this doesn't carry over to the Linux Subsystem for Windows.Lucas.Hutchinson wrote: The only major problem that i encountered is that when cloning all the source code, it needs to be cloned with Linux line endings (yes sounds obvious i know), as i found it would not build with the windows style line endings. (where the MSYS32 environment will).
Not really a big deal, but could be a trap for new people.
Do you recall what the failure mode is?
Re: Notes on using Windows Subsystem for Linux with ESP-IDF
Im just starting to play with it. Most time took me to upgrade windows 10 before i could install ubuntu. I have windows 10 pro (bought legit genuin key for less than $8). First try was hello world example from esp-idf and compiled and flashed with no problem. One thing i have had to figured was serial port. Under WSL it will be /dev/ttySx, where x match comX under windows. But before we flash we need to change permissions on this port with sudo chmod 666 /dev/ttySx.
Compiling with make -j makes my CPU hurt, but my laptop with intel E3 can handle make -j3.
Compiling with make -j makes my CPU hurt, but my laptop with intel E3 can handle make -j3.
-
- Posts: 79
- Joined: Tue Apr 26, 2016 5:10 am
Re: Notes on using Windows Subsystem for Linux with ESP-IDF
I am not exactly sure what the failure mode was. It was about 2-3 months ago. I am not 100% sure it was line endings, it could have been something else. i just remember re-cloning m code and the idf using the WSL git to a new folder let me build.
I have since mostly just relied on the pre-compiled toolchain, or switching over to a full linux install and building in there.
One other thing to note: I find linux (and to a lesser extent WSL) to be much faster to do a full re-build than on the pre-compiled toolchain.
I have since mostly just relied on the pre-compiled toolchain, or switching over to a full linux install and building in there.
One other thing to note: I find linux (and to a lesser extent WSL) to be much faster to do a full re-build than on the pre-compiled toolchain.
Re: Notes on using Windows Subsystem for Linux with ESP-IDF
Yes, MSYS2's additional layers to support *nix APIs on Windows causes us a big performance hit. The main impacts seem to be forking new processes and filesystem access. We've been looking for better solutions to this.Lucas.Hutchinson wrote: One other thing to note: I find linux (and to a lesser extent WSL) to be much faster to do a full re-build than on the pre-compiled toolchain.
We've also noticed WSL is better but due to its filesystem translations it's not as fast as native Linux (or possibly even in Linux in a VM, depending.)
Who is online
Users browsing this forum: No registered users and 115 guests