Debug builds
After you've set up your local debug toolchain, you need firmware that includes program symbols (an .elf file). Because the Arm Mbed Online Compiler only produces binaries that omit the program symbols, you need to compile locally using Arm Mbed CLI.
Note: Make sure to do a clean build when switching to and from debug and release by removing the BUILD folder.
Compile command
$ mbed compile --profile mbed-os/tools/profiles/debug.json
Exporting with debug symbols
You can also enable debug symbols when exporting your project by using:
$ mbed export -i uvision -m K64F --profile debug
Make release builds by using:
$ mbed export -i uvision -m K64F --profile release