Semihosting with Concurrent Debugging

About this task

In the traditional work flow, when you enable semihosting, the output is printed in the Eclipse Console. When using the co-debug method, the spawned openOCD is an independent process, so Eclipse Console cannot capture the stdout output. Instead, we can use Telnet to see the semihosting output.

Follow these steps:
  1. Open Run > Run Configurations....
  2. Select the target attach launch configuration. Click on Startup tab.
  3. Add the command monitor arm semihosting_redirect tcp 50051 all in the Run/Restart Commands.
  4. Click Apply and close the editor.
  5. Set ENABLE_SEMIHOSTING_PRINT to 1.
  6. Use a Telnet client to connect to the TCP port.
Figure 1. Edit Run Configurations (Step 1)

Figure 2. Add Semihosting Commands (Step 2 - 3)
Figure 3. Enable Semihosting Printing (Step 5)
Figure 4. Connect to TCP Port (Step 6)
Figure 5. Semihosting Printing Displayed