Printf on a Microcontroller | Embedded System Project Series #19

Artful Bytes
Artful Bytes
2.9 هزار بار بازدید - پارسال - I add a printf implementation
I add a printf implementation suitable for microcontrollers so that I can print formatted strings to the terminal. Underneath, it calls the UART driver I implemented in the last video. I further wrap the printf function in a TRACE macro to prefix every trace with filename and line number. Finally, I add trace to my assert function, but only trace the program counter (PC) to save space and show how to get the corresponding file+line with addr2line.

0:00 What and Why
3:28 Add mpaland/printf
6:52 Implement _putchar
9:20 Call printf
11:40 TRACE macro
17:13 Verify TRACE
19:10 Avoid format and cppcheck
22:20 Commit
22:58 Fix mistake 1
23:25 Fix mistake 2
24:00 Add trace to ASSERT
28:30 Program counter assembly
29:53 UART polling in ASSERT
32:20 Fix mistakes
34:05 addr2line
36:25 Commit
37:20 Possible improvements

#embeddedsystems  #cprogramming #microcontroller

🌍 Related links
https://github.com/artfulbytes/nsumo_...
https://interrupt.memfault.com/blog/a...
https://github.com/mpaland/printf

🌍 Find me here
GitHub - https://github.com/artfulbytes
Website - https://www.artfulbytes.com

👨‍💻 About me
Hi and welcome. I'm Niklas, an embedded systems engineer from Sweden. On this channel, I make practical videos about embedded systems or, in general terms, about building and programming hardware.
پارسال در تاریخ 1401/12/23 منتشر شده است.
2,932 بـار بازدید شده
... بیشتر