Virtual com ports or USB CDC do not require a baud rate as it's not a real serial port. As mentioned ESP32 has native USB and Arduino/ESP-IDF use USB CDC over this port to communicate with a host computer. Serial.begin() is used for all kinds of serial ports including virtual serial ports. Those libraries probably require a baudrate argument for Serial.begin() which will be ignored. This is probably in the documentation for that function.
If the same function is used on a physical serial port (of which there are a few on ESP32 iirc) the baudrate argument will be used to set the baudrate setting in the peripheral by the library.
The purpose of baud and other control settings for CDC devices is so that they can serve as a pass-through for a real UART that will need to know what those settings are. Those control packets can be ignored if that never happens.
The screenshot shows a software called "WebSerial Audio Studio". I couldn't find it, only https://serial-studio.com/ which also looks great (and has an open source edition). Does anyone know if it is the same? Looks pretty handy. Microchip had something not so sophisticated years ago.
If you specify non-default pins for the serial output (i.e. you're opening a second serial connection to talk to another piece of hardware) the begin() method does influence the data rate.
Also, there are dev boards out there that do actually use a TTL converter and USB-to-serial converter to access the standard serial port, though they're not very common as far as I can tell, so I wouldn't just assume the baud rate setting does nothing on the standard pins either.
Since most of the comments seem to just restate the conclusion of the article, I'll go ahead and post it:
> What on earth is going on?
>
> Well, my board is based around an ESP32-S3. This has native USB support - and the serial connection is running over the USB connection.
>
> We don’t have a USB-to-serial converter on the board.
>
> There is no UART.
>
> Which means there’s no actual baud rate (this is not strictly true, it is possible to find out what the baud rate was set to - but that’s for another day).
My experience with microcontrollers is not up to date. Most of the stuff I did was 15 years ago.I remember, Espressif really disrupted the market. Things changed already with Advent of Arduino. Before that people wrote a lot of asm code inline and MCUs particularly from microchip had really good documentations (sure some quirks and errata always appeared later, but as I remember they found their ways into data sheets and application notes). Particularly as binary blobs e.g. for network appeared the API went from well defined hardware interfaces to libraries, etc. Today it is even common for some of those domain specific IC that typically rather contain an MCU that you have to sign NDAs to get access to documentation of some parts.
> MCUs particularly from microchip had really good documentation
Oh how the mighty have fallen. I've only worked on one major project with a Microchip MCU (PIC32MK), but their documentation and support were terrible. No detailed documentation, just a driver library with vague, sketchy API docs and disgustingly bug-ridden code. Deadlocking race conditions in the CAN driver, overflow-unsafe comparisons in timers, just intern-level dumbassery that you couldn't fix without reverse engineering the undocumented hardware. Oh, and of course what documentation did exist was split into dozens of separate PDFs, individually served, many of which were 404 unless you went hunting for older versions or other chips in the product line. It certainly cured me of any desire to touch another Microchip product.
Espressif has some of the most thorough documentation in the entire industry.
TI (a major American IC manufacturer) regularly shits out half baked datasheets missing important information or incomplete explanations of equations. All the American vendors have terrible documentation.
Wow and TI produces some of the better documentation, at least for their analog parts. Their chips seem much more closed. The GPU drivers for the 2 decade old Beagle Bones require an account and NDA IIRC.
I was troubleshooting some code of mine that talks to a product Adafruit has been selling for ten years. It turns out the documentation was just plain wrong. Thankfully Adafruit's source code was posted and I could quite confidently see the right way to do it, and submitted feedback on the documentation bug.
But I think this is a space where due to the relative ease and cheapness of putting out a product and often fixing it after the fact, there's less eyeballs on any given aspect of a board or the software loaded on it.
And a years younger me noticed the issue! But I worked around it instead of reporting it. This time I figured out the source of the problem... but the documentation has been wrong a long time in between. ;)
Adafruit's libraries are some of the worst code I've ever seen. And I recreationally dive into the low level esp-IDF code (I do not recommend if you value your sanity).
I found one just yesterday where the main entry point returns a byte value. It returns 'false' on error, and '0' on success. It may also sometimes return a non-zero error code. You can see why this design would be problematic.
Atmel has shockingly good documentation for their AVR CPUs. The datasheets are always thorough, usually include protocol timing diagrams, psuedocode examples for using peripherals, lots and lots of vital information. Their datasheets also link out to additional documentation like their instruction set manual. Now that is a good read.
Love Atmel. They're not perfect, but they're very good and they try pretty hard.
TI deleted all the I2C register programming information (40 pages!) from the docs for a widget I was using and it took them months to put it back. The device was literally unusable in any form without that information. Insane.
uh - you clearly misunderstood something. The video is about the port of the Arduino framework that is running on the ESP32. on the ESP32-S* that have native USB that has implications that makes the option of setting a baud rate for them using the Arduino Framework superfluous.
The ESP32 Variants have pretty good documentation themself.
If the same function is used on a physical serial port (of which there are a few on ESP32 iirc) the baudrate argument will be used to set the baudrate setting in the peripheral by the library.
Setting the baud rate does actually do something (just follow the baudRate parameter here: https://github.com/espressif/arduino-esp32/blob/master/cores...), it just doesn't affect the output speed of the USB serial output.
If you specify non-default pins for the serial output (i.e. you're opening a second serial connection to talk to another piece of hardware) the begin() method does influence the data rate.
Also, there are dev boards out there that do actually use a TTL converter and USB-to-serial converter to access the standard serial port, though they're not very common as far as I can tell, so I wouldn't just assume the baud rate setting does nothing on the standard pins either.
They still are.
No vendor until now was able to push out microcontrollers with a solid Wifi integration. Sometimes you can find weird 2-chip-solutions.
I still wonder why ST doesn't bring one. That device would be a multi-billion-business.
Oh how the mighty have fallen. I've only worked on one major project with a Microchip MCU (PIC32MK), but their documentation and support were terrible. No detailed documentation, just a driver library with vague, sketchy API docs and disgustingly bug-ridden code. Deadlocking race conditions in the CAN driver, overflow-unsafe comparisons in timers, just intern-level dumbassery that you couldn't fix without reverse engineering the undocumented hardware. Oh, and of course what documentation did exist was split into dozens of separate PDFs, individually served, many of which were 404 unless you went hunting for older versions or other chips in the product line. It certainly cured me of any desire to touch another Microchip product.
TI (a major American IC manufacturer) regularly shits out half baked datasheets missing important information or incomplete explanations of equations. All the American vendors have terrible documentation.
And half the time you don’t even find out until you’ve created an account and signed an NDA!
Nordic and espressif are some of the good ones, they’re showing up on a lot of my designs for this reason…
But I think this is a space where due to the relative ease and cheapness of putting out a product and often fixing it after the fact, there's less eyeballs on any given aspect of a board or the software loaded on it.
And a years younger me noticed the issue! But I worked around it instead of reporting it. This time I figured out the source of the problem... but the documentation has been wrong a long time in between. ;)
I found one just yesterday where the main entry point returns a byte value. It returns 'false' on error, and '0' on success. It may also sometimes return a non-zero error code. You can see why this design would be problematic.
This is more about the application running on that device.
One thing is happening: as uC (and ASIcs) are getting more complex and complicated, more features are added and not fully (or at all) documented.
Love Atmel. They're not perfect, but they're very good and they try pretty hard.
TI deleted all the I2C register programming information (40 pages!) from the docs for a widget I was using and it took them months to put it back. The device was literally unusable in any form without that information. Insane.