Originally published on Maker.io (DigiKey).

Two RTOS threads calling printf at the same time will interleave their characters. Two ISRs doing the same can corrupt UART peripheral state. The naive fix — wrapping every printf in a critical section — works but blocks all other interrupts for as long as it takes to format and transmit the message, which at 3 Mbaud and 22 characters is still tens of microseconds.
Three progressively better approaches: disable interrupts around the entire call (simple, correct, blocks everything); use an RTOS mutex (correct for thread-to-thread communication, but mutexes can’t be acquired from ISRs); use a double buffer that separates formatting from transmission so the critical section only covers the memory copy, not the UART write. The double buffer is the most capable solution but introduces its own race conditions — which Part 2 addresses.