Difference between revisions of "How to use SWO with GDB"
(→SWO Example project) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | GDB does not |
+ | Generally a GDB client does not support SWO. But luckily, the J-Link GDB server is able to work around this and send SWO data to a socket. |
− | This article is a step-by-step guide about how to use SWO with GDB. |
+ | This article is a step-by-step guide about how to use SWO with J-Linkg and a GDB client. |
− | If not set differently, J-Link GDB Server will use default settings. |
||
__TOC__ |
__TOC__ |
||
=Default settings= |
=Default settings= |
||
+ | If not set differently, J-Link GDB Server will use default settings: |
||
− | Default port for SWO via GDB is: |
||
*Telnet port: 2331 |
*Telnet port: 2331 |
||
*SWO data port: 2332 |
*SWO data port: 2332 |
||
=Example with a MK22FN512xxx12 device using putty (default ports)= |
=Example with a MK22FN512xxx12 device using putty (default ports)= |
||
− | This example shows how to setup GDB for SWO. |
+ | This example shows how to setup J-Link GDB Server, a GDB client and Putty for SWO. |
It was created by using default port settings. |
It was created by using default port settings. |
||
Further information about setting different ports and more can be found in UM08001. |
Further information about setting different ports and more can be found in UM08001. |
||
In this example the following applications were used: |
In this example the following applications were used: |
||
− | *J-Llink GDB Server |
+ | *J-Llink GDB Server V6.54a |
− | *ARM GDB |
+ | *ARM GDB client (V7.3.1) |
− | *Putty |
+ | *Putty (V0.70) |
==Setting up the J-Link GDB Server== |
==Setting up the J-Link GDB Server== |
||
# Open the J-Link GDB Server |
# Open the J-Link GDB Server |
||
# Set all options as required:<br>[[File: SetupSWO_GDBServer.PNG]] |
# Set all options as required:<br>[[File: SetupSWO_GDBServer.PNG]] |
||
− | # Start the GDB |
+ | # Start the J-Link GDB Server |
==Setting up the GDB client== |
==Setting up the GDB client== |
||
# Open a command line GDB client |
# Open a command line GDB client |
||
− | # Connect to the GDB Server. This can be achieved via these commands: |
+ | # Connect to the J-Link GDB Server. This can be achieved via these commands: |
target remote :2331 |
target remote :2331 |
||
monitor SWO EnableTarget 0 0 1 0 |
monitor SWO EnableTarget 0 0 1 0 |
||
Line 33: | Line 32: | ||
==Example output== |
==Example output== |
||
[[File: SetupSWO_PuttyOutput.PNG]] |
[[File: SetupSWO_PuttyOutput.PNG]] |
||
+ | =SWO Example project= |
||
+ | SEGGER Embedded Studio (V4.30a or later) SWO example for MK22FN512xxx12: [[File: NXP_K22_SWOExample.zip]] |
Latest revision as of 17:40, 21 November 2019
Generally a GDB client does not support SWO. But luckily, the J-Link GDB server is able to work around this and send SWO data to a socket. This article is a step-by-step guide about how to use SWO with J-Linkg and a GDB client.
Contents
Default settings
If not set differently, J-Link GDB Server will use default settings:
- Telnet port: 2331
- SWO data port: 2332
Example with a MK22FN512xxx12 device using putty (default ports)
This example shows how to setup J-Link GDB Server, a GDB client and Putty for SWO. It was created by using default port settings. Further information about setting different ports and more can be found in UM08001. In this example the following applications were used:
- J-Llink GDB Server V6.54a
- ARM GDB client (V7.3.1)
- Putty (V0.70)
Setting up the J-Link GDB Server
Setting up the GDB client
- Open a command line GDB client
- Connect to the J-Link GDB Server. This can be achieved via these commands:
target remote :2331 monitor SWO EnableTarget 0 0 1 0 c
Setting up putty
Example output
SWO Example project
SEGGER Embedded Studio (V4.30a or later) SWO example for MK22FN512xxx12: File:NXP K22 SWOExample.zip