Hi,
I just got my Xiao ESP32S3 sense and I manage to upload code only if I press BOOT while plugging it in the USB port
when trying to upload normally it gives the error “A serial exception error occurred: Write timeout”
driver details-
USB Serial Device (COM11)
If this is true, how come I didn’t find any mention in the tutorials? also, doesn’t make sense to do it this way. can anyone from Seeedstudio confirm this? I assume it is possible to upload code just like any other Dev board…
there are some ways to make it a little better, like lowering the serial baud rate to like 19200 range…
ps if you didnt need a boot button to boot… then of course they would have eliminated it…
even the official FAQ says that using the BOOT button is a “fallback” option when other methods fail. most ESP32 dev boards have BOOT button even when it is not usually necessary , because in some rare cases it is required. but not all the time.
Hi there,
Yes it is possible, However If the device is new and everything is set correctly , BSP, Device etc,
It will connect to the boot loader and flash without being in BL mode. YMMV. There isn’t any mention of it in the WiKi as it’s knowledge only learned through experience with ESP & Nrf series.
Based on your particular dev environment and the setup a lot of variables, add in if the code you send it is Experimental and writes or over writes the flash in a specific area, takes away the automatic stub location, then YOU will need to put it in BL mode(holding the buttons etc)
ALSO , the LOOP portion of your code can lock out that ability too, I always put a small delay in the loop (when Empty) so the MCU pauses there long enough to catch the BL mode.
Works for me , YMMV
In cases where there is nothing in the LOOP function almost always requires a Button Push ,hold, etc.(BL mode)
@PJ_Glasso: Could you share a small example with and without a delay where the boot button press is required and not.
I tried a touch based LED with a delay, it works without boot button press overhead, however without delay, again same annoying button press is required. We need to flash code 100 times in development. Button business makes it really annoying, especially when buttons are infinitesimaly tiny and inconvenient to press.
I don’t want to do any button press. I wish it should flash and run the code as we normal ESP32 dev wroom boards. Any workaround for this?
void setup()
{//Begin Main Setup Function
// Open serial communications and wait for port to open:
Serial.begin(19200);
while (!Serial)
{//Begin while()
Serial.print("\n Serial Setup..."); // wait for serial port to connect. Needed for native USB port only
}// End while()
}// End Main Setup Function
Hi there,
Sure I could . Which BSP are you using?
what tools configuration do you have?
what partition settings?
LMK and I can see what I have, and have you thought of making a “production bin” I have a demo on here as “how To” you can use a command line or batch programmer, lots of options.
Yea the button thing is a safety measure against garbage code. afaik.
HTH
GL PJ
fyi, to use OTA you would need the code stub already on the device.
Sketch uses 276529 bytes (8%) of program storage space. Maximum is 3342336 bytes.
Global variables use 18024 bytes (5%) of dynamic memory, leaving 309656 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port COM4
Connecting...
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 24:ec:4a:00:5f:90
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
A fatal error occurred: No serial data received.
A fatal error occurred: No serial data received.
The main problem is, after a couple of uploads, the board comes out of the bootloader mode, forcing me to use the Boot Reset Boot mechanism, post which the upload works easily, same code with no changes. What could be the issue? Why the board comes out of bootloader mode automatically? I am using Arduino.
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(19200);
while (!Serial)
{//Begin while()
Serial.print("\n Serial Setup..."); // wait for serial port to connect. Needed for native USB port only
}// End while()
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Hi there,
So that’s the wrong answer…
The Board Support Package is the one provided by the manufacture to allow compatibility with Libraries and Patches to hardware & firmware issues.
further;
WIKI say’s this:
In embedded systems, a board support package (BSP ) is the layer of software containing hardware-specific boot firmware, runtime firmware and device drivers and other routines that allow a given embedded operating system, for example a real-time operating system (RTOS), to function in a given hardware environment (a motherboard), integrated with the embedded operating system.[1][2][3] The board support package is usually provided by the SoC manufacturer (such as Qualcomm), and it can be modified by the OEM.
Recently Espressif updated there’s to be compatible with the new 5.1 IDF since 3.0 alpha.
currently it’s 3.0.5. I’m using 2.0.11 and I see NO issue requiring the use of the bootloader button push sequence.
The code snipit you provided , works with the loop empty or with code(blink LED) Uploads seamlessly can be presented and and run without issue or reset.
There are some known’s like, the “while Serial” will make it wait until the serial port is connected. so if on battery the program loaded will never go past that state.(waiting for serial port connection)
the other is the Hardware serial port your device is connected to.
You notice how after an upload it say’s
"
Leaving…
Hard resetting via RTS pin…
"
If the USB-C serial port or cable is not a true RS-232 port or Driver compatible then that can also effect the final step of the Arduino/BootLoader reset. (I have seen this with some 232<-> USB dongle’s)
Time permitting I can do the same testing on BSP 3.0.5 and see if there is anything unusual happening there.
HTH
GL PJ
Start with a factory bin restoration, Lower baud rate to 9600 and load BSP 2.0.11 and retry.