6.3.5.6 Debug the Primary and Secondary Project
How to Debug the Primary and Secondary Project - Video (NO AUDIO)
To debug the Primary and Secondary project:
- Select the Primary project or set as the main project in the Projects window. Then debug the project .
- After the project has been running
for a few seconds, Pause the execution . The
execution should be stopped at the while loop
while(1) {}
. - Set a breakpoint at line 57 and 63 by clicking in the left gutter near the line number.
- Click Reset and then Continue . The program execution should halt at the first breakpoint.
- Click on the
Watches window to see the value of
test_shared_variable
. As the line where the breakpoint caused a halt was not executed, the variable value should match the value set in the previous line of the primary.c file. - Click Continue again. The program execution should halt at the second breakpoint.
- Now that
__xc32_LoadAllSecondarySections();
has been executed, the value oftest_shared_variable
should match that set in secondary.c. For more about__xc32_LoadAllSecondarySections()
, see the next section. - End program execution by clicking .