Closes https://github.com/espressif/esp-idf/issues/2553
As reported on forum. Requires a small CMake wrapper script to pick up environment variables at flashing time.