# Exploring printf on Cortex-M

DevFeed: [Exploring printf on Cortex-M](<https://devfeed.tech/articles/exploring-printf-on-cortex-m-47346.md>)

Original publisher: [Read original article](<https://interrupt.memfault.com/blog/printf-on-embedded>)

Author: Noah Pendleton

Published: 2023-09-20T00:00:00Z

Content type: tutorial

Language: en

Sources: [Interrupt](<https://devfeed.tech/sources/interrupt.md>)

Topics: [C](<https://devfeed.tech/topics/c.md>), [Microcontroller](<https://devfeed.tech/topics/microcontroller.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Streams](<https://devfeed.tech/topics/streams.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [bare-metal](<https://devfeed.tech/tags/bare-metal.md>), [c](<https://devfeed.tech/tags/c.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [embedded](<https://devfeed.tech/tags/embedded.md>), [libc](<https://devfeed.tech/tags/libc.md>), [logs](<https://devfeed.tech/tags/logs.md>), [microcontrollers](<https://devfeed.tech/tags/microcontrollers.md>), [processes](<https://devfeed.tech/tags/processes.md>), [terminal](<https://devfeed.tech/tags/terminal.md>)

## AI overview

This article explains how C's printf function works on Cortex-M microcontrollers, including how formatted output reaches a host terminal through libc, system calls, or UART drivers. It also covers using newlib-nano in bare-metal applications, redirecting output, buffering, and reentrancy across interrupt or thread contexts.

## Source excerpt

The C printf function is a staple of embedded development. It's a simple way to get logs or debug statements off the system and into a terminal on the host. This article explores the various ways to get printf on Cortex-M microcontrollers. Continue reading...