The greatest challenge facing embedded system developers is debugging software. Embedded systems have become highly complex, running real-time operating systems, connectivity stacks, USB, and security among a wide variety of other system code even before getting to the application. Yet a significant number of engineers that I encounter still only use breakpoints to debug their software, despite the many modern and advanced techniques available to engineers today. For this reason, I have created an opportunity to learn modern debugging techniques by developing an online course. The 45-minute per day free course will take place July 11-15, and will walk engineers through a hands-on approach to debugging real-time embedded software.
Why take a course? Reading about a debugging technique is one thing, but actually setting up and trying out the technique is a completely different experience. In order to get a real feel for how the techniques can be used, the course will be using an NXP K64F Freedom board that includes an ARM Cortex-M4 processor running at 120 MHz with 1 MB of flash space and 256 kB of RAM. The K64F board comes with Arduino R3 headers already populated along with a myriad of other features such as Ethernet, accelerometer, SD card slot, camera expansion header, on-board debugger, LEDs, and a few others. At only $35USD, the board is a very inexpensive, yet powerful development kit well suited for exploring debug techniques.
The course will start out by walking students through the steps required to setup the development kit and the tool chain. Because the development kit has a powerful ARM M4 processor onboard, attendees will also get a quick introduction to FreeRTOS and how to rapidly deploy it for use in an embedded system. The setup will form the foundation and basic framework from which the various development techniques will be explored.Before diving into the advanced topics, traditional techniques such as the use of printf and assert will be examined. Developers will typically tie printf to a MCU peripheral UART, which can cause problems with the real-time performance of the system if care isn't taken. We'll examine how to reduce the impact printf has on real-time performance while also examining the alternative of using the built-in core features to decrease its impact to near zero. Debugging an embedded system sometimes requires a detailed understanding of the processor, especially when faults within the core are at issue. We'll be diving into the details of the ARM Cortex-M exceptions and the debug modules and hardware available to assist in debugging software. This hardware includes the Serial Wire Debugger (SWD) and the Serial Wire Output (SWO) that have become indispensable.
The most exciting part about the course is going to undoubtedly be the setup and experimentation with real-time tracing tools such as System Viewer and Tracealyzer. The ability to visually explore how an embedded system is functioning and to retrieve information such as minimum, average, and maximum task execution times can be unprecedented. We will be exploring how these tools work and how as developers we can get the most from these technologies.
Debugging an embedded system is a necessary evil of the design cycle despite carefully crafted design and implementation. Understanding how to quickly and efficiently debug a system can save development costs and decrease time to market. What techniques are you using to debug your embedded system?
You can sign up for the course, which includes live Q&A, here, and if you can't attend the live classes, they will be archived for later reference.
Jacob Beningo is a Certified Software Development Professional (CSDP) whose expertise is in embedded software. He works with companies to decrease costs and time to market while maintaining a quality and robust product. He is an avid tweeter, a tip and trick guru, a homebrew connoisseur, and a fan of pineapple! Feel free to contact him at [email protected], at his website www.beningo.com, and sign up for his monthly Embedded Bytes Newsletter here.