9 Serial Output on the STM

We’re now back to “Hello World,” only this time we’ll use our Nucleo board, which presents several challenges. The first is where to write the message. There is no display. Fortunately, the chip has a serial port that’s nicely connected to a USB/serial port on the top half of the board.

The next challenge is the writing itself. We need to initialize the device and create a procedure to actually write a character. The device is designed to accept one character at a time, and we must keep that limitation in mind when writing our program.

We’ll simulate the process before working with the device. C has a great deal ...

Get Bare Metal C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.