I cannot flash bootloader onto my board

I previously flashed micropython onto my board, and now I'm trying to flash the default bootloader in the arduino IDE. When I try to do this I get the following error:

A fatal error occurred: Failed to connect to ESP32-S3: No serial data received.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool.py latest documentation
Failed chip erase: uploading error: exit status 2

I've searched for like 20 minutes on how to fix it, but I can't find anything.

Have you made sure you have the right serial port and if you do is it the only one open?

It's connected to COM6 which is the only port open

Have you made sure you have no other windows open from previous attempts.

I've closed and re-opened the IDE and I still get the same error

There is a button sequence you can push and hold to reboot the board I don't off hand know what it is but you can search it up and try that.

Ok, I'll try that

Let me know how it goes.

I successfully got it into the flash mode, but I'm getting a new error now:

A serial exception error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool.py latest documentation
Failed chip erase: uploading error: exit status 1

is it an Arduino Nano ESP32 or another ESP32 board?
If that's the case we have a guide for it

I've solved the problem, this is the guide I used: