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:

  1. Select the Primary project or set as the main project in the Projects window. Then debug the project
    .
  2. After the project has been running for a few seconds, Pause the execution
    . The execution should be stopped at the while loop while(1) {}.
  3. Set a breakpoint at line 57 and 63 by clicking in the left gutter near the line number.
  4. Click Reset
    and then Continue
    . The program execution should halt at the first breakpoint.
  5. 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.
  6. Click Continue
    again. The program execution should halt at the second breakpoint.
  7. Now that __xc32_LoadAllSecondarySections(); has been executed, the value of test_shared_variable should match that set in secondary.c. For more about __xc32_LoadAllSecondarySections(), see the next section.
  8. End program execution by clicking
    .