How to lock to arduino-esp earlier version

Already discussed here on how to find out what platform-espressif32 version matches to what Arduino-ESP32 version.

Especially to be noted is that PlatformIO does not officially support Arduino-ESP32 3.x yet. The latest is 2.0.14, with the current platform = espressif32@6.5.0.