Live data from Hacker News

Setting serial baud rate on ESP-IDF does nothing

atomic14.substack.com

31–40 of 40 posts

Re: Setting serial baud rate on ESP-IDF does nothing

#31
post #30

Earlier quoted context omitted.

We never had problems as a small vendor with ST during the chip crisis and all distributors honored our delivery contracts. Even most big companies don't deal with ST directly when it comes to the last mile. Porting stuff to another microcontroller would be easy as we are not using too proprietary features... as long the uC has SPI/I2C and a bunch of timers the embedded developers will be happy. Thanks to Zephyr.

> Thanks to Zephyr. That only gets you proper support for a couple vendors (Nordic, ST), everything else is a nightmare. Even with better-supported vendors, there are whole swaths of things that aren't properly supported and you need to directly call code from underlying vendor SDK to make things work. That bodge makes the whole project non-portable. Even some simple things like ADC DMA on ST F1 series..

Can't share your experience.

Sometimes stuff is missing. But that's implemented and upstreamed quickly.

Re: Setting serial baud rate on ESP-IDF does nothing

#32
That's not ESP-IDF, that's the Arduino wrapper around ESP-IDF.

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.

Re: Setting serial baud rate on ESP-IDF does nothing

#33

Earlier quoted context omitted.

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.

> 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…

I won't even work with vendors like that. It's just not worth the time and hassle when you can get an equivalent part for the same or lower price from another vendor that lets you decide if the part will work for you before entering into negotiations

Re: Setting serial baud rate on ESP-IDF does nothing

#34

Earlier quoted context omitted.

ST doesn't want to make one because then you can do OTA firmware updates without their special $60 usb to serial adapter that won't work for non-st parts

All of the newer STM32s have ROM-bootloaders that support UART- or even USB-flash. For SWD you can one of the ST-Link clones or the free open implementations of it.

Except when they don't. Last time I tried an ST part, I specifically bought one that advertised UART bootloader.

It didn't. Every piece of documentation I could find said that it did, but it would never respond. Forums were full of people complaining about this problem for years with no response from ST. No datasheet or marketing update, no errata. You just get a useless chip and it's your problem now. They also never responded to any of my direct emails or messages.

Every time I've tried an ST part, it's been hell and I eventually gave up and used an Atmel part instead. Every time.

Re: Setting serial baud rate on ESP-IDF does nothing

#35

Earlier quoted context omitted.

All of the newer STM32s have ROM-bootloaders that support UART- or even USB-flash. For SWD you can one of the ST-Link clones or the free open implementations of it.

Except when they don't. Last time I tried an ST part, I specifically bought one that advertised UART bootloader. It didn't. Every piece of documentation I could find said that it did, but it would never respond. Forums were full of people complaining about this problem for years with no response from ST. No datasheet or marketing update, no errata. You just get a useless chip and it's your problem now. They also neve…

Please name the device.

Re: Setting serial baud rate on ESP-IDF does nothing

#36
post #5

Is it common for microcontrollers to lack comprehensive documentation, or is it just espressif?

There are very well documented uCs. I have to admit , is not like in the good old days, but there are decent documented uCs. 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.

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.

Re: Setting serial baud rate on ESP-IDF does nothing

#37

Is it common for microcontrollers to lack comprehensive documentation, or is it just espressif?

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 fi…

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.

Re: Setting serial baud rate on ESP-IDF does nothing

#38

Is it common for microcontrollers to lack comprehensive documentation, or is it just espressif?

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.

Re: Setting serial baud rate on ESP-IDF does nothing

#39

Earlier quoted context omitted.

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 fi…

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.

Yet they generally work.

In my experience all of the low level code on uC’s is just short of horrible. That’s ST, NXP, etc, are just full of terrible kludges. Then again some of the Linux kernel drivers can be rough too.

The only vendor I’ve heard has good code and documentation is Raspberry Pi Foundation on their silicon.

Re: Setting serial baud rate on ESP-IDF does nothing

#40
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).
Post reply on HN