Debugging methods for Arm Mbed OS applications
At the heart of Arm Mbed is Keil Studio Cloud. 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
Keil Studio Cloud, Mbed Studio and Keil µVision natively support debugging Mbed OS applications:
- To set up Keil Studio Cloud, read the Keil Studio Cloud documentation.
- To set up Mbed Studio, read the Mbed Studio documentation.
- To set up µVision, read Debugging with Keil µVision.
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.