Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Practical Debugging for Embedded ARM Systems

You're reading from   Practical Debugging for Embedded ARM Systems Core techniques for tracing, profiling, and fixing system-level faults

Arrow left icon
Product type Paperback
Published in Apr 2026
Publisher Packt
ISBN-13 9781806673117
Length 176 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Nino Vidović Nino Vidović
Author Profile Icon Nino Vidović
Nino Vidović
Arrow right icon
View More author details
Toc

Debugging with printf

In this section, we will learn how the classic approach of logging via printf is still one of our go-to debugging approaches. We will see how it holds up today, how it has evolved over the years, and how it can be used to our advantage.

What is printf?

printf is a C standard library function whose purpose is to print formatted text to some output interface or console. The principal idea of printf is pretty much available in every programming language. So, what is discussed in this section will apply to any programming language that is viable for embedded target devices and that has some sort of standard output function.

The standard definition of printf is as follows:

int printf ( const char * format, ... );

The function takes a string or char array as an input parameter, which can have format specifiers applied. The return value will output how many characters were written on success. On error, it will return a negative number, and depending on the library implementation...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Practical Debugging for Embedded ARM Systems
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at R$50/month. Cancel anytime
Modal Close icon
Modal Close icon