In this section we'll demonstrate how to debug your Peripheral that was made by Modeling Framework.
Debugging your code
In order to debug your peripheral re-run the firmware with
--debug-peripheral flag, for example lets take the bin file of the ad7798 firmware sample and run it on a virtual nRF52832:
jumper run -u --fw ad7798.bin --debug-peripheral --platform nrf52832
You should now see the following lines:
In order to debug your peripheral attach to process pid: XXXXX Press enter after connection...
When the XXXXX changes according to the current process id.
From here it's pretty simple:
- Place a breakpoint in your Main() method.
- Your debugger probably has the ability to attach to a running process. In your debugger configuration, feed the printed process id to the debugger.
- If the debugger also requires a program executable or symbols file, provide an executable called jemu located in your HOME_FOLDER/.jumper folder (you can use ~/.jumper/jemu but only if your debugger knows how to work with ~. For example, Visual Studio Code requires a full path).
- After your debugger connected to the process, hit enter in the terminal where you typed the jumper run command.