Flash issue ESP32-PICO-MINI-02

Hello,
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

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
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
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:12812
load:0x40080400,len:3032
entry 0x400805e4

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

Connecting...................
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?