Esp32 s3 "warning can't connect to esphome api" issue

I’m making a voice assistant from scratch using esp32 s3, inmp441 and max98357. I’ve encountered an issue, when I finished compiling the YAML file and started running esp32 s3, the log page showed" *warning can’t connect to esphome api". After my research, I found out that if I change the framework type to esp-idf this error message will jump out, but if I change the framework type to arduino, it works fine, what is the problem?

try adding the following to the esphome: block

  platformio_options:
    board_build.flash_mode: 'dio'
1 Like

This is correct. This option is needed when flashing using a cable, otherwise the esp will just boot loop.