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
github.com/artfulbytes/nsumo_...
interrupt.memfault.com/blog/a...
github.com/mpaland/printf
🌍 Find me here
GitHub - github.com/artfulbytes
Website - 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.
Негізгі бет Ғылым және технология Printf on a Microcontroller | Embedded System Project Series #19
Пікірлер: 28