I write this since these practices have been useful for me, and hope that someone might benefit from these. This may be a bit off-topic since it relates to using PlatformIO.
We have multiple tools that are developed actively and updated frequently, like Platform IO, ESP-IDF/Arduino framework, Visual Studio Code, OS drivers, etc. These updates sometimes impact your software build for your specific hardware environment in an undesired way, which is practically impossible for anybody to test in a bulletproof manner. Even I want to use the new tools, I do want to be forced to start figuring out tool issues while working on my application.
So I need way to bring in the updates in controlled manner so that I can choose to do updates when there is time to test those and to have an up to date back up to return to if things do not work out just right, so that project which I actually work on doesn’t get delayed.
To use a virtual machine (VMware or VirtualBox) for development, and install development tools on that. Then disable automatic updates, on Visual Studio Code, PlatformIO, so one can choose the time when these are done. I use Linux Mint as a host machine and Linux Deepin in a virtual machine for development (Ubuntu would probably be the safest choice for VM). When I plan for tool update, I simply make a copy of the whole virtual machine folder as a backup, and then run the tool updates. This way tool updates never put me offline.
- Virtual machines are always less responsive than the host machine. This typically is not a big deal, but might be annoying.
- Running virtual machines requires a relatively powerful host computer. Better to have plenty of RAM and HDD space.
- Switching USB devices between host and virtual machines and selecting a network for the virtual machines may cause a bit of confusion in beginning.
- Sometimes one needs to disable (blacklist) USB drivers which communicate with a debugger or with dev board in the host system side to use these from the virtual machines.
- Linux virtual machine images can be published in net and copied from developer to another. If someone prepares a good quality development image for a specific purpose, this would have great value for those getting started. It could be used as-is or as a reference how to make things work.
- In a commercial setting, products often need to be supported for ten years after initial product development. Virtual machines with disabled updates can be used to “freeze a project for specific HW version” and burn it into long term storage. So that new people, perhaps after years, can do modification to application code, build the microcontroller code and package it.