ESP Gives Boot:0x13 error after I upload a code

Hi everyone,
I have an esp that when I install home assistant it works perfectly, and I can connect to it. but when I upload a code to it it gives this message in de logs:

[13:08:38]rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]ets Jul 29 2019 12:21:46

I have tried to power it with a seperate powersupply. there is nothing connected to the esp when I upload the code. does anybody know what is wrong? and how I can fix this?

Already Thanks!

Hello Lars,

Is this related to Home Assistant?

Showing your esp yaml might spark more interest.
Could you also explain what you mean by power it with a seperate powersupply?

Hi.
Maybe this is indeed better to ask on the esphome forum (if there is one😅) thanks though!

I Will upload my code in a few minutes. With sepperated power I mean that I have a 5v powersuply on de vin, so that it isn’t powered by the usb port.

You didn’t mention espHome at all. so ok here, might get advanced help: