The old ones are being kept as long as I don’t use:
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip
But in the moment I use that platform all old Arduino framework directories from .platformio\packages are removed.
The old platforms are still kept in .platformio\platforms directory and are visible in the list of all installed platforms but the framework-arduinoespressif32 packages for the old platforms are not listed as installed anymore as were before using platform installed from pioplatformio as all their directories named framework-arduinoespressif32@x.xxxxx.xxxxxx have been deleted from .platformio\packages in the exact moment I configure any project to use platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip and save platformio.ini.
Yes, that works well. The platform installed via pioarduino is labeled as 55.3.35 in the list of all installed platforms and that platfom is used either when the project is configured with platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip or with platform = espressif32.
Let me describe step by step what exactly happens and how the problem can be reproduced:
1. Starting point:
Before configuring platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip for the first time I had the following platform versions listed as installed:
Espressif 32 6.7.0 <-- Arduino framework 3.20016.0 (2.0.16)
Espressif 32 4.2.0 <-- Arduino framework 3.20002.220503 (2.0.2)
Espressif 32 3.5.0 <-- Arduino framework 3.10006.210326 (1.0.6)
I installed 6.7.0 last year, I installed 4.2.0 in 2022. and I installed 3.5.0 this year because I had to compile old ESP32 CAM face recognition example which was later removed.
All these three versions were fully installed and I could configure any project with:
platform = espressif32 @ 6.7.0
or
platform = espressif32 @ 4.2.0
or
platform = espressif32 @ 3.5.0
at any time while nothing was downloaded and the project was ready in just two seconds.
Arduino Espressif frameworks belonging to these platform versions were present inside .platformio\packages directory in the following subdirectories:
framework-arduinoespressif32 <-- platform = espressif32 @ 6.7.0 (Arduino framework 2.0.16)
framework-arduinoespressif32@3.20002.220503 <-- platform = espressif32 @ 4.2.0 (Arduino framework 2.0.2)
framework-arduinoespressif32@3.10006.210326 <-- platform = espressif32 @ 3.5.0 (Arduino framework 1.0.6)
framework-arduinespressif32 entries were listed as installed for all these platform versions all the time as in the screenshot:
2. After using platform from pioplatformio:
When I configured the project with:
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip
Directory framework-arduinoespressif32 (735 MB) containing Arduino framework 2.0.16 was deleted.
Directory framework-arduinoespressif32@3.20002.220503 (436 MB) containing Arduino framework 2.0.2 was deleted.
Directory framework-arduinoespressif32@3.10006.210326 (117 MB) containing Arduino framework 1.0.6 was deleted.
Then a new framework-arduinoespressif32 directory was created containing Arduino framework 3.3.5 installed via pioplatformio.
The old 6.7.0, 4.2.0 and 3.5.0 platforms were kept but their Arduino Espressif frameworks were deleted and the Arduino frameworks were missing under Installed column as in the screenshot:
When I now wanted to compile old projects configured with:
platform = espressif32 @ 6.7.0
or
platform = espressif32 @ 4.2.0
or
platform = espressif32 @ 3.5.0
the project wasn’t ready after two seconds as before since old Arduino framewok was now missing so Platformio had to redownload hundreds of MBs and unpack the archive.
3. Trying one more time:
After compiling the project with platform = espressif32 @ 6.7.0 I noticed the directory containing Arduino framework installed via pioplatformio was renamed from framework-arduinoespressif32 to something like:
framework-arduinoespressif32@src-52f841c98ab7260d8a74b2ec8f40af42 <-- I changed the hex nums
and framework-arduinoespressif32 directory now contained Arduino framework 2.0.16 belonging to espressif32 @ 6.7.0.
Then I compiled an old project with platform = espressif32 @ 4.2.0 and another old project with platform = espressif32 @ 3.5.0 after which there were these Arduino frameworks in .platformio\packages:
framework-arduinoespressif32 <-- platform = espressif32 @ 6.7.0 (Arduino framework 2.0.16)
framework-arduinoespressif32@3.20002.220503 <-- platform = espressif32 @ 4.2.0 (Arduino framework 2.0.2)
framework-arduinoespressif32@3.10006.210326 <-- platform = espressif32 @ 3.5.0 (Arduino framework 1.0.6)
framework-arduinoespressif32@src-52f841c98ab7260d8a74b2ec8f40af42 <-- containing Arduino framework 3.3.5 installed via pioplatformio
In other words, the situation was now exactly as in 1. Starting point with the addition of the framework installed via pioplatformio and I could again configure the old 6.7.0, 4.2.0 and 3.5.0 platforms without Platformio downloading anything and in just two seconds - exactly as before!!
However, as soon as I configured the project with:
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip
all old Arduino framework directories were deleted again and the situation was again as in 2. After using platform from pioplatformio.
So the problem description in one sentence is:
Using platform from pioplatformio destroys all currently installed Arduino Espressif frameworks by deleting all framework-arduinoespressif32* directories from .platformio\packages except the one downloaded via pioplatformio.