Flash issue ESP32-PICO-MINI-02

I recently switched from TTGO-Micro32-v2 to ESP32-PICO-MINI-02
But I can’t make it work; basically, I can’t run any code on the chip!
Most likely it is not anything to do with PlatformIO

When I connect the MCU to the PC (USB bridge) in the terminal MCU endlessly prints this

invalid header: 0xffffffff

After burning a very simple code (I use PlatformIO), I get slightly different errors as follows

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, SPIWP:0xee
mode:DIO, clock div:1
entry 0x400805e4

When I try to erase the flash, it seems everything is working just fine!

Chip is ESP32-PICO-V3-02 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, Embedded PSRAM, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 30:83:98:d0:1c:b0
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 5.1s
Hard resetting via RTS pin...

Could you please help me to find out what would be wrong?

Does it work in the Arduino IDE? Under which settings if yes?

What is your platformio.ini?

I seem to have a similar issue.

@rezza - did you try to setup you platform.io with 8MB flash size?