XIAO ESP32 C3 not restarting

I ran a program on my XIAO espr32 c3 which was supposed to connect to my home wifi, and I logged a loading message into the serial monitor while it is supposed to connect. Now in an attempt to upload a new program it fails, and while i look at the port and serial monitor, I can see it is still running the old program from before. How am I able to restart the microcontroller? The restart button fails me.

Hello, would you mind posting the code you uploaded? Or did you clearly see the message that the upload was successful? Is the correct type of development board selected?
If you need to reset, you are asked to do so. You can first try to reset the board by clicking the RESET BUTTON once while the board is connected to your PC. If that does not work, hold the BOOT BUTTON , connect the board to your PC while holding the BOOT button, and then release it to enter bootloader mode .

#include <Arduino.h>
#include <WiFi.h>
#include <WebServer.h>

const char* wifi_name = "SECRET";
const char* wifi_password = "SECRET";

WebServer server(80);

void setup() {
  pinMode(8, OUTPUT);

void handle_index() {
  digitalWrite(8, HIGH);
  digitalWrite(8, LOW);

void loop() {

  WiFi.begin(wifi_name, wifi_password);

  while (!WiFi.isConnected()) {


  server.on("/", handle_index);


As you can see it got stuck in a while loop and it is simply just printing periods on the serial line when i open it up

Yes the correct development board is selected I tired clicking reset but it runs the same thing again, this is the code that I last uploaded to it, It never connected to wifi.

More specifically this is the error message

I took your bootloader advice, and it worked.
Clearly I wasn’t aware of this, and wanted to know what the purpose of the bootloader button is for. Compared to newer microcontrollers from different brands, this bootloading process is almost automated.

I need to explain to you that due to pin multiplexing, we will have conflicts with some pins in the reset function, so if you encounter the problem that the program cannot be uploaded, it is necessary for the user to initiate the reset.