XIAO C# only starting when connected to computer but not with USB Powerbank

Hello folks,

I programmed my Seeeduino XIAO with C#. The XIAO starts when connected to my computer and the program runs fine after uploading on the XIAO.

BUT: When I unplug the USB cord from my computer and re-plug it into an external USB charger or powerbank, the green LED on the XIAO will light, but the C# program won’t start.
Same behaviour with my 4.2 V battery connected to the Vin & Ground contacts: The XIAO program won’t start.

I have already searched the internet and this forum for quite a while, but unfortunately haven’t found anything.

I have 2 devices running at 3.3 V connected via I2C directly to the XIAO, without any extension board.
The LED indicator on these devices flickers once when establishing the USB charger or powerbank or the 4.2V battery.

I used Arduino IDE V 1.18.3 to upload the C# to XIAO. Upload was successful, XIAO starts afterwards when connected to the PC (but as described above not with other energy source).

XIAO details:
BN: Seeeduino XIAO
VID: 2886
PID: 802F

Any help is appriciated. !

Regards,

Volker.

Hello,

I found the solution by myself.

It was a human error, I forget to comment out “while (!Serial)” which was somewhere at the beginning of my " void setup()". Without being connected to the PC, the seeeduino will certainly wait forever for the Serial connection.

Regards,

Volker.