As reported on forum. Requires a small CMake wrapper script to pick up environment variables at flashing time.