Well it’s not realy a good solution but you can upload the binary after compiling it in PlatformIO with this command in the Terminal:
<Path to arduino IDE home>\hardware\tools\avr/bin/avrdude -C<Path to arduino IDE home>\hardware\tools\avr/etc/avrdude.conf -patmega328p -carduino -P<Port> -b115200 -D -Uflash:w:.pio\build\<env name>\firmware.hex:i
If you try this for your program replace the paths in <>
with the ones on your machine.
I got this by copying the command from the Arduino IDE with verbose upload.