IPC Blinking Dual Core Debugging

Source code can be downloaded from IPC_Blinking_DualDebug


This simple demo shows communication between M4 and M0 cores. Two flags are used: first for commands from M4 to M0 and second for responses from M0 to M4. They both are located in shared memory. Inactive flags have zero value. So, when flag becomes non-zero, this means that command or response is received.


Algorithm for simple communication:

From M4 to M0:

  • Set command flag.
  • Wait for response flag becomes non-zero.
  • Clear response flag.
  • From M0 to M4:
  • Wait for command flag becomes non-zero.
  • Clear command flag.
  • Set response flag.
  • Execution

To run this projects you need:

  1. Open IPC_DualDebug_M4 project and build M4 program. IPC_Blinking_DualDebug__1_Build_M4_program.png
  2. Add a breakpoint to line 65 of main_4m.c source file, start debugging and run M4 program.IPC_Blinking_DualDebug__2_Add_a_breakpoint_start_debugging_and_run_M4_program.png
  3. Run second instance of IAR EWB, open IPC_DualDebug_M0 project and build M0 program.IPC_Blinking_DualDebug__3_Build_M0_program.png
  4. Add a breakpoint to line 59 of main_0m.c source file, start debugging and run M0 program.IPC_Blinking_DualDebug__4_Add_a_breakpoint_start_debugging_and_run_M0_program.png
  5. Press any button on the board and M4 program will stop in breakpoint.IPC_Blinking_DualDebug__5_Press_any_button_on_the_board_and_M4_program_will_stop_in_breakpoint.png
  6. Send command to M0 by running or stepping M4 program.IPC_Blinking_DualDebug__6_Send_command_to_M0_by_running_or_stepping_M4_program.png
  7. M0 program will receive command and stop in debugger.IPC_Blinking_DualDebug__7_M0_program_will_receive_command_and_stop_in_debugger.png