ESP32-c6 fails to boot, bootloop

I installed the vs code extension, Generated new Project and opened it.

platformio.ini

[env:esp32-c6-devkitc-1]
platform = espressif32
board = esp32-c6-devkitc-1
framework = espidf

i upload, all fine, but then a bootloop occurs:

ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x3 (LP_SW_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001974a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c110,len:0xe80
load:0x4086e610,len:0x3058
load:0x40875720,len:0x16b8
entry 0x4086c110
I (22) boot: ESP-IDF 5.4.1 2nd stage bootloader
I (23) boot: compile time Jun  5 2025 17:37:26
I (24) boot: chip revision: v0.0
I (24) boot: efuse block revision: v0.2
I (26) boot.esp32c6: SPI Speed      : 80MHz
I (30) boot.esp32c6: SPI Mode       : DIO
I (34) boot.esp32c6: SPI Flash Size : 8MB
I (37) boot: Enabling RNG early entropy source...
I (42) boot: Partition Table:
I (44) boot: ## Label            Usage          Type ST Offset   Length
I (51) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (57) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (64) boot:  2 factory          factory app      00 00 00010000 00100000
I (70) boot: End of partition table
E (74) esp_image: Failed to fetch app description header!
E (79) boot: Factory app partition is not bootable
E (83) boot: No bootable app partitions in the partition table

I found no special config/troubleshooting on platform io esp32-c6 dev kit docs.

build log

CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-c6-devkitc-1.html
PLATFORM: Espressif 32 (6.11.0) > Espressif ESP32-C6-DevKitC-1
HARDWARE: ESP32C6 160MHz, 320KB RAM, 8MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf @ 3.50401.0 (5.4.1) 
 - tool-cmake @ 3.16.4 
 - tool-esp-rom-elfs @ 0.0.1+20241011 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - tool-mkfatfs @ 2.0.1 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - tool-ninja @ 1.7.1 
 - tool-riscv32-esp-elf-gdb @ 12.1.0+20221002 
 - tool-xtensa-esp-elf-gdb @ 12.1.0+20221002 
 - toolchain-esp32ulp @ 1.23800.240113 (2.38.0) 
 - toolchain-riscv32-esp @ 14.2.0+20241119
Reading CMake configuration...
Warning! Flash memory size mismatch detected. Expected 8MB, found 2MB!
Please select a proper value in your `sdkconfig.defaults` or via the `menuconfig` target!
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio/build/esp32-c6-devkitc-1/firmware.elf
Checking size .pio/build/esp32-c6-devkitc-1/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   3.0% (used 9828 bytes from 327680 bytes)
Flash: [=         ]  15.0% (used 156801 bytes from 1048576 bytes)
Configuring upload protocol...

I thought, just flashing a fresh empty new project should work right?

I tested a Arduino IDE example, and that did work and produced a flashing LED.
So I dont think, both my esp32-c6 are broken.

The default ESP32-C6-DevKitC-1 is a 8MB Flash version - See platform-espressif32/boards/esp32-c6-devkitc-1.json at develop · platformio/platform-espressif32 · GitHub. But your board seems to have only 2 MB of flash. Therefore the used board settings does not match your board.

Try these additional settings in your platformio.ini which limits the available space down to 2MB and applies a 2MB partition-layout:

board_upload.flash_size = "2MB"
board_upload.maximum_size = 2097152
board_build.partitions = minimal

Thanks for the quick help, i thought i did that, but the warning didnt go away…
Maybe i made a mistake with menuconfig?
Anyway, its working now with the .ini settings.