Debugging starts but it doesn't work properly

It could also be a possibility that the reset is not working correctly and when GDB does the continue to setup() it has already executed setup() so it can’t reach there. And then pressing reset fixes it by making the program run from the start again. That, or it somehow entered bootloader mode due to the strapping pins.

But it’s not properly uploaded the firmware. Can you do an Upload again?

I’m uploading the code from Arduino IDE because of I’m facing with issues while trying to upload code from VsCode PlatformIO.

And then pressing reset fixes it by making the program run from the start again.

Yes that makes sense. Now I’ll try to upload new and simple sketch. Let’s see debug works perfect or not :smiley:

That’s not good at all. The Arduino IDE will build its own firmware.elf and even if the C/C++ source is the same it will build an entirely different firmware image than PlatformIO. It has to be done within the same IDE.

What’s the error when uploading? Is upload_protocol = esp-prog properly set?

Now I uploaded this code with Arduino IDE and debugged with VsCode PlatformIo. I changed the saniye value so changed the LED delay while debugging.

#include <Arduino.h>

int saniye = 100;
void setup() {
  // put your setup code here, to run once:
pinMode(4,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(4,HIGH);
delay(saniye);
digitalWrite(4,LOW);
delay(saniye);
}

What’s the error when uploading? Is upload_protocol = esp-prog properly set?

Thanks a lot. I solved my Upload and Debug issues. I just tried again the code uploading and it’s done.