Debugging methods for Arm Mbed OS applications
At the heart of Arm Mbed is the Online Compiler. While that is incredibly convenient for getting a project started or while prototyping, chances are that at some point you'll miss a debugger, or you'll want to develop while not having an active internet connection. Through debugging, you can do things such as set breakpoints, set watchpoints, view registers, view disassembly, browse memory and examine the callstack. These docs will help you debug your applications.
The simplest way to debug your code is to augment your code with printf statements, which you can observe from your PC using a serial terminal.
Debugging from an IDE
Mbed Studio and Keil uVision natively support debugging Mbed OS applications:
- To set up Mbed Studio, read Mbed Studio's documentation.
- To set up uVision, read Debugging with Keil uVision.
Mbed also supports debugging using any IDE that supports GDB. To set up the debugger, first read Setting up your local debug toolchain. Then read the section for your specific IDE. The same principles apply to any unlisted IDEs that supports GDB:
- Producing debug builds with Arm Mbed CLI.
- Debugging with Eclipse.
- Debugging with Visual Studio Code.
- Debugging with other IDEs that support GDB.