So far, we have learned about the past of embedded systems debugging. We came from rather rudimentary debug features and environments to rather sophisticated setups with plentiful features.
But what does a modern landscape in the 2020s look like, and what are the current challenges and trends?
One great development is that nearly all modern microcontrollers that are released these days have debug ports integrated, even with some advanced debug features that go along with it. This led to a great availability of all kinds of debug probes that offer solutions for a broad range of budgets and chip architectures.
There are even on-board variants available, so whole debug probes can be tightly integrated into your own board designs.
The broad availability of debug interfaces and probes with advanced debug features makes bug hunting as efficient as it has ever been before.
Features such as hardware and software tracing, live memory manipulation, various breakpoint types, and many more will be covered in this book in more detail, so you can make the most of these modern features that are available even on the cheapest microcontrollers these days.
However, we also see that target systems are becoming increasingly complex. Multi-core devices are becoming the norm, complex memory management schemes become necessary, and advanced safety features increase the learning curve for newcomers to the embedded domain. So, having advanced debug setups becomes a necessity at some point.
To counter the trend of more complex devices, we see an increasing trend of third-party hardware abstraction layers and code generators being used to reduce the initial complexity of a new system. The trade-off is, however, that third-party code blobs are added to your software, where the chain of trust may become watered down, which, in the worst case, may add unwanted security risks to your application.
We also see the rise of embedded frameworks such as Zephyr that take the abstractions even further. Whether eliminating hardware dependencies will be the cure for future complex embedded systems, only time will tell, but it is definitely an approach that you should use consciously, as program safety is also becoming a core factor of modern embedded systems.
Another popular trend is the rapid rise to fame of Visual Studio Code from Microsoft. Starting off as a feature-rich free text editor with a plugin interface and built-in community features, it quickly transformed into a one-size-fits-all platform for modern software development, even in the embedded domain, challenging market-leading IDEs.
A more classic approach to counter complexity that is gaining much ground in the embedded domain is automated unit testing on embedded systems. Typically, such tests are run in separate simulation environments, oftentimes in the form of digital twins. However, many have now painfully learned that nothing beats testing on the actual hardware. Due to short prototyping cycles, quick availability of PCBs is becoming the norm, thus allowing testing on hardware early in a development cycle.
Last but not least, there's artificial intelligence (AI) in the form of large language models (LLMs). It is here now, so we have to talk about the elephant in the room. It can already write mostly correct code. It can somewhat debug broken code, but what it excels at is being a valuable assistant to an experienced developer. Even in the embedded domain where the training data for AI models is quite scarce and not always easily machine-readable, many of the suggestions and help you can receive from AI can still boost your productivity, and most importantly, it saves precious time when digging through thousands of pages of documentation, because what LLMs do best is pattern recognition of language context.
But what current LLMs also do very well is hallucinate answers, since current AI companies tune their models to give the user answers that would make them happy to keep engagement with the platform high, instead of always providing accurate information.
That is, of course, not ideal if you are trying to get a correct answer in a mostly deterministic profession such as software engineering. But LLM companies promise that this will all be fixed soon, and we just have to wait a bit longer.
History seems to be on their side, as so far, anything that humans could think or dream of in the technical domain was at some point later realized, so the chances are good that this will also happen with AI. But whether it will happen during my lifetime, I do not know. I am still waiting for cold fusion and teleportation.
But let's focus on reality and on what we humans do best – teaching each other new things, which, hopefully, will be achieved by the end of this book.