ESP32 IDF encrypting uploads

Is there an option to upload to an encrypted core partition?

This is the equivalent process in ESP IDF’s idf.py tooling that I’m trying to replicate in PlatformIO:

  1. I set up my ESP32 partition table so the code partition is encrypted. Easy in PlatformIO.
  2. I turn on device encryption with “idf.py menuconfig” - in PlatformIO this is done by simply editing the sdkconfig file and setting “CONFIG_SECURE_FLASH_ENC_ENABLED=y”. All good.
  3. Build the code with “idf.py build”. Easy in PlatformIO.
  4. Upload the code. In IDF you do this with “idf.py flash” the first time you are encrypting the device (in PlatforIO use “pio run -t upload”), and thereafter you use “idf.py encrypted-app-flash”. Is there an equivalent to the 2nd of those commands in PlatformIO? You can’t use the normal upload as it will not encrypt and thus the device will have garbage and not run, just reboot over and over.