So since B1 is just GPIO0
it seems you’re just rebooting it into UART / Bootloader mode. So it won’t run the firmware, but bootloader code. These addresses in the callstack when you halt the debugger, 0x40041a76
, that’s identified by the ESP32-S3 datasheet as being inside the “Internal ROM 1”.
Flash memory (where your firmware lives) would be in the instruction bus address range 0x4200_0000 to 0x43FF_FFFF.
Do you keep the B1 connected to GND all the time or only once to reboot into bootloader mode where the USB/JTAG controller is available? I think if PlatformIO / OpenOCD connects to the chip, uploads the firmware and triggers a CPU reset, the CPU will then run the bootloader again instead of the firmware, because B1 ↔ GND is still there. You should remove B1 ↔ GND connection again after the board was rebooted into bootloader mode.