Continous reboot after flashing an esp32

I try to upload a sketch with PlatformIO (BasicOTA) to an esp32-WROOM-32 with espota. The upload works, but then the esp reboots appr. every second with error “Rst 0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)”. When I upload the sketch with Arduino IDE, everything works fine. (partition tables are the same). Can somebody help ?