XIAO ESP32C3 doesn't work with only external +5V on the +5v pin

First, there is no need to have a Diode in series with the external +5v source IFF there is no connection on
the USB-C port.
In my application, after programming the XIAO (via the USB-C), it is placed on a board where it is powered by a regulated +5V source connected to pin +5V.
I can see the regulated 3v3 output from the XIAO is working (also schematic shows that it should work), but
the ESP32C3 doesn’t boot the code from the flash.

Is this behavior intended? That is, to work the XIAO must be powered via the USB-C port OR the battery pads under the board?

Any ideas will be welcomed.

Thanks

Is there a “while(!Serial);” in the sketch?

Yes, there is. It is
while (!Serial && (counter < 5)) { counter++; delay(100);}

With your code, it looks like the code will not wait forever in while() when there is no USB!
What happens if I remove the while line to try it out?

Correct. The code doesn’t wait for the Serial connection as when deployed, there isn’t one.
The rest of the code is still not executed, which leads me to believe that it isn’t being loaded.
Same code when run on an Adafruit QT Py ESP32-C3 works.

If I rig a USB-C connector with only the +5v/gnd pins connected to the same regulator, the XIAO boots and
works.

it is placed on a board where it is powered by a regulated +5V source connected to pin +5V…the ESP32C3 doesn’t boot the code from the flash.

a USB-C connector with only the +5v/gnd pins connected to the same regulator, the XIAO boots and works.

Confirmation.
No USB, external 5V power supply to XIAO’s 5V/GND pin does not work. But it works when only 5V/GND of USB cable is connected to XIAO’s 5V/GND pin.
What is the same regulator?
If delete the while line, does it not work?

Update. It doesn’t work from powering via the USB-C. It only executes once. The last lines of the code are:
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);

Serial.println(“Shutting down to deep sleep”);
delay(100);
digitalWrite(SOIL_PWR_EN, LOW); //-- Turn Off Power
Serial.flush();
esp_deep_sleep_start();
delay(100); //not executed likely
}

Since it only executes once and never wakes up, Is the issue related to the Serial code?
Why this dependency? As mentioned before, I’ve not found this issue with any other maker of ESP32C3, ESP32S(2,3). Only with the XIAO.

Commenting the Serial.flush() makes the XIAO to work, when powered either from +5V pin OR the USB-C power pins only.

the USB-C power pins only

Do you mean to connect a USB-C power cable without data lines(don’t use a serial monitor) to the XIAO USB connector?
If you post the code, I can try to reproduce the experiment.