There's a recurring claim that 1-Wire is convenient to do over UART: 1 bit = 1 UART byte, and the hardware shift register takes care of the timing itself. It sounds nice, so I went through the public implementations that specifically use DMA. The result: the approach works, but there are no production-grade implementations, and it's not because nobody finished one -- the approach itself doesn't promise anything good.
What actually exists
- taburyak (STM32, HAL) -- UART+DMA: 8+8 bytes of RX/TX per 1-Wire byte. Problems: infinite loop waiting on the HAL driver status, UART re-init with a baud change on every reset and transfer, reading an uninitialized variable in the conversion-complete check, strong pull-up on a separate pin, alarm search stubbed out.
- shpegun60 -- a rework of taburyak: state machine, 5 ms timeouts, 4 retries. Problems: blocking ROM search, inverted conversion wait (the condition is effectively always true), manual DMA stop; identical bit-packing functions and comments reveal the common ancestor.
- foxhounddm (C++/HAL) -- a single TX+RX DMA for the whole transaction. Problems: reset via blocking transmit and receive with a 1 ms timeout, while a byte at 9600 takes 1.04 ms; custom non-standard search; GPL-3.0.
- controllerstech (STM32 HAL) -- a tidy multi-sensor example, but no DMA at all: RX interrupt plus a blocking wait for TX completion. That's not UART+DMA.
- lwow (MaJerle) -- 281 stars, MIT, actively maintained. The README promises DMA, but the STM32 backends have none: the HAL variant is Receive_IT + blocking Transmit + RxState wait, the LL variant polls TXE/RXNE/TC byte by byte. So in practice it's UART without DMA.
A GitHub search for "onewire uart dma" returns literally a handful of repos: three small ones (0-10 stars, half of them derived from each other) and lwow, whose DMA exists only in the README. So there's simply no sample to build a "best practice" from.
Why the architecture can't reach production
- 1 bit = 1 UART byte. An 8-byte DMA buffer carries exactly 1 byte of data. DMA saves interrupts, but not the number of slots or the time: a 9-byte scratchpad is 72 slots of ~87 us each, i.e. about 6.3 ms regardless of DMA.
- Reset requires switching baud 9600 <-> 115200. DMA is useless here, and reinitializing UART on every reset is expensive and fragile.
- Fixed sampling point. UART samples at 1.5 bit times, i.e. 13.02 us at 115200, while the DS18B20 window is 15 us. That leaves ~2 us of margin: baud, clock or filter error eats it up.
- Overdrive is impractical. ~1 Mbit/s UART over real wires with framing errors is a project of its own, not "just set a different baud rate".
- DMA remains a transport with synchronous waiting. For every slot or byte, someone has to wait for a flag; so you end up with blocking waits (taburyak), a state machine with timeouts (shpegun60), or interrupts. The advantage over bit-banging melts away.
Bottom line
The lack of good UART+DMA implementations is not a conspiracy or laziness, it's a niche: the approach only wins on peripheral availability (no free timer or pin), and it pays with a fixed sampling point, a baud switch on reset, an external strong pull-up and manual error handling. For a narrow case (short line, DS18B20, standard speed) you can build a production version, but it means rewriting about 70% of the transport: transactional DMA, callbacks, BRR, error policy, HIL, and it still won't be a universal 1-Wire master.
If anyone knows a production-grade UART+DMA implementation, please share -- I'd be glad to take a look.