Hi Pascal & Ian,
We are aware of this (poor Windows build performance) and we're working on a solution, which will probably be available in IDF v3.1 (TBC). We'll announce it on here once it's available.
The root causes are that GNU make (which IDF currently uses for its build system) does a lot of fork() operations and also does a lot of scanning of the filesystem. These two operations are fast in Linux/OSX but slow in Windows. Plus, MSYS itself is a translation layer which adds some overhead.
Some things you can do to help Windows build performance right now are:
- Disable Windows Defender real-time scanning under the C:\MSYS2 directory and any other directories used in the build.(*)
- Run the build with "make -jN" where N is a large-ish number (try double the number of CPUs in your system).
- Install ccache with "pacman -S ccache" and configure IDF to use it (one way to configure it to set the "Compiler toolchain path/prefix" under "SDK tool configuration" to "ccache xtensa-esp32-elf-")
Still, you will probably not get the same performance as a Linux VM,. However these should help.
(*) Note that this is a risk you'll have to trade-off against. We don't plan to ship malware or viruses in the MSYS2-based environments we supply, but you'll have to make sure not to download anything untrusted into the MSYS2 directories.
But, on ubuntu, it's more difficult to configure, like COM1 is /dev/ttyS1 and I need to change access security. And I'm not able to setup openocd correctly, purhaps by misunderstanting.
In Ubuntu (and most Linux distros) by default, normal users don't have permissions for serial ports or generic USB devices (for openocd). You can run the following commands in a terminal to create the relevant permissions:
Code: Select all
sudo usermod -aG plugdev,dialout $USER
cd /path/to/openocd-esp32
sudo cp contrib/99-openocd.rules /etc/udev/rules.d
You'll need to log your out and also restart udev before these rules take effect. Exactly how to restart udev varies between Ubuntu versions I think, but rebooting will definitely get you there.
Once this is done, serial & openocd should work without any special steps.
(The first command adds your user to plugdev and dialout groups, "dialout" group is for serial access without "sudo". The last command copies some openocd-specific "udev" device rules. These rules make various debugger interfaces available to all users in the "plugdev" group without "sudo".)