Lowlevel Debugging with Ozone - michael-ring/mbf GitHub Wiki
Sometimes the Lazarus Debugger is not the right tool, for a more low-level approach that allows you to debug down to the processor registers the tool of choice is Ozone, a commercial debugger that if free to use for hobbists that own a J-Link Debug Probe or a Third party board that comes with a builtin J-Link debug probe or can be flashed to be J-Link compatible.
To use Ozone first install it for your platform from this Page:
Connect you device to the J-Link debugger and start Ozone. Select 'Create New Project' and then browse for a SVD-File that matches your CPU. MBF comes with a number of SVD Files to get you started, with a little luck you will find a matching file in the Samples/templates directory inside of you MBF installation
images/OzoneProjectSettings.png
In a later dialog select the compiled .elf file of your project and use 'Start Debug Session' to upload your binary and start debugging:
Ozone comes with some limitations, you need to set a breakpoint and then start debugging by issuing first a 'Step Over' and then use 'Continue' to properly start debugging and, the most severe limitation, you cannot watch local variables which is a pitty.
But nevertheless Ozone has already saved me hundreds of hours of low-level debugging time because it allows you to easily go down to the assembler level and is able to show you the actual values of all peripheral registers of your microcontroller when you provide a SVD-File for it.