This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Configuring SWO on nrf52

I'm trying to configure SWO properly, specifically to get the output in Eclipse. The following code is used to initialise the SWO.

const uint32_t current_config = static_cast<uint32_t>(NRF_CLOCK->TRACECONFIG
    & ~CLOCK_TRACECONFIG_TRACEPORTSPEED_Msk);
const uint32_t speed_config =
    static_cast<uint32_t>(CLOCK_TRACECONFIG_TRACEPORTSPEED_4MHz);
NRF_CLOCK->TRACECONFIG = current_config | speed_config;
ITM->TCR |= 1U;


I have a snippet that outputs a string to the SWO and I can read this correctly using this command

JLinkExe -if swd -device nrf52 -speed auto
connect
swoview 4000000

However, when I start the debug session in Eclipse, I'm not able to get the SWO output in the console. I can set breakpoints, step through code, etc. I'm attaching some screenshots from my configuration as well as the GDB Server output. Any help would be much appreciated!

macOS High Sierra (10.13.3)
Eclipse Neon.3 Release (4.6.3)

SEGGER J-Link GDB Server V6.22e Command Line Version

JLinkARM.dll V6.22e (DLL compiled Jan  8 2018 11:45:44)

Command line: -if swd -device nRF52832_xxAA -endian little -speed auto -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0
-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      localhost only
Generate logfile:              off
Verify download:               on
Init regs on start:            on
Silent mode:                   off
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 nRF52832_xxAA
Target interface:              SWD
Target interface speed:        auto
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OB-SAM3U128 V3 compiled Sep 21 2017 14:14:50
Hardware: V3.00
S/N: 483020034
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x20000400)
Read 2 bytes @ address 0x00000000 (Data = 0x0400)
Read 2 bytes @ address 0x00021128 (Data = 0xB508)
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x20000400)
Read 2 bytes @ address 0x00000000 (Data = 0x0400)
Received monitor command: reset
Resetting target
GDB closed TCP/IP connection
Connected to 127.0.0.1
Reading all registers
Read 2 bytes @ address 0x00021128 (Data = 0xB508)
Read 4 bytes @ address 0x000008E4 (Data = 0x47184B06)
Read 2 bytes @ address 0x000008E4 (Data = 0x4B06)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x000008E4)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20000400, MSP= 20000400, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 000008E4
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x000008E4 (Data = 0x47184B06)
Read 2 bytes @ address 0x000008E4 (Data = 0x4B06)
Received monitor command: speed auto
Select auto target interface speed (2000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (Handle on BKPT)
Received monitor command: semihosting IOClient 3
Semihosting I/O set to TELNET and GDB Client
Received monitor command: SWO DisableTarget 0xFFFFFFFF
SWO disabled successfully.
Received monitor command: SWO EnableTarget 0 0 0xFF 0
SWO enabled successfully.
Read 2 bytes @ address 0x00021128 (Data = 0xB508)
Read 4 bytes @ address 0x000008E4 (Data = 0x47184B06)
Read 2 bytes @ address 0x000008E4 (Data = 0x4B06)
Downloading 9780 bytes @ address 0x0001F000 - Verified OK
Downloading 8 bytes @ address 0x00021634 - Verified OK
Downloading 128 bytes @ address 0x20002C38 - Verified OK
Writing register (PC = 0x0001F46C)
Read 2 bytes @ address 0x00021128 (Data = 0xB508)
Read 4 bytes @ address 0x0001F46C (Data = 0x2B004B15)
Read 2 bytes @ address 0x0001F46C (Data = 0x4B15)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x000008E4)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Read 2 bytes @ address 0x00020878 (Data = 0xF7FF)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20000400, MSP= 20000400, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 000008E4
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x000008E4 (Data = 0x47184B06)
Read 2 bytes @ address 0x000008E4 (Data = 0x4B06)
Setting breakpoint @ address 0x00020878, Size = 2, BPHandle = 0x0001
Starting target CPU...
...Breakpoint reached @ address 0x00020878
Reading all registers
Read 4 bytes @ address 0x00020878 (Data = 0xFF5CF7FF)
Removing breakpoint @ address 0x00020878, Size = 2
Reading 64 bytes @ address 0x00020840
Reading 64 bytes @ address 0x00020880
Reading 64 bytes @ address 0x000208C0
Reading 64 bytes @ address 0x00020900
Reading 64 bytes @ address 0x00020940
Reading 64 bytes @ address 0x00020980
Reading 64 bytes @ address 0x000209C0
Reading 64 bytes @ address 0x2000FFC0
Read 4 bytes @ address 0x0001F4BA (Data = 0xFE4FF001)
Read 2 bytes @ address 0x0001F46C (Data = 0x4B15)
Read 4 bytes @ address 0x0001F4C4 (Data = 0x20010000)
Read 2 bytes @ address 0x0001F46E (Data = 0x2B00)
Read 2 bytes @ address 0x0001F470 (Data = 0xBF08)
Read 2 bytes @ address 0x0001F472 (Data = 0x4B13)
Read 4 bytes @ address 0x0001F4C2 (Data = 0x00000008)
Read 2 bytes @ address 0x0001F474 (Data = 0x469D)
Read 2 bytes @ address 0x0001F476 (Data = 0xF5A3)
Read 2 bytes @ address 0x0001F478 (Data = 0x3A80)
Read 2 bytes @ address 0x0001F47A (Data = 0x2100)
Read 2 bytes @ address 0x0001F47C (Data = 0x468B)
Read 2 bytes @ address 0x0001F47E (Data = 0x460F)
Read 2 bytes @ address 0x0001F480 (Data = 0x4813)
Read 4 bytes @ address 0x0001F4D0 (Data = 0x00018000)
Read 2 bytes @ address 0x0001F482 (Data = 0x4A14)
Read 4 bytes @ address 0x0001F4D6 (Data = 0x00000001)
Read 2 bytes @ address 0x0001F484 (Data = 0x1A12)
Read 2 bytes @ address 0x0001F486 (Data = 0xF001)
Read 2 bytes @ address 0x0001F488 (Data = 0xFEA9)
Reading 64 bytes @ address 0x2000FF00
Reading 64 bytes @ address 0x2000FF40
Reading 64 bytes @ address 0x2000FF80
Read 4 bytes @ address 0x2000FF20 (Data = 0x00021500)
Read 4 bytes @ address 0x000214F8 (Data = 0x00000000)
Read 4 bytes @ address 0x2000FF3C (Data = 0x00021500)
Read 4 bytes @ address 0x000214F8 (Data = 0x00000000)
Read 4 bytes @ address 0x2000FF58 (Data = 0x00021500)
Read 4 bytes @ address 0x000214F8 (Data = 0x00000000)
Read 4 bytes @ address 0x2000FF74 (Data = 0x00021424)
Read 4 bytes @ address 0x0002141C (Data = 0x00000000)
Read 4 bytes @ address 0x2000FF84 (Data = 0x000213D4)
Read 4 bytes @ address 0x000213CC (Data = 0x00000000)
Read 4 bytes @ address 0x2000FF90 (Data = 0x000215D0)
Read 4 bytes @ address 0x000215C8 (Data = 0x00000000)
Read 4 bytes @ address 0x2000FFD8 (Data = 0x0000FFFF)
Read 4 bytes @ address 0x2000FFE4 (Data = 0x0002080F)
Read 4 bytes @ address 0x2000FF0C (Data = 0x000214CC)
Read 4 bytes @ address 0x000214C4 (Data = 0x00000000)

SEGGER J-Link GDB Server V6.22e - Terminal output channel

Parents
  • In the screenshots above, you have left the CPU freq and SWO freq fields empty, can you fill those values and see if it works?

    SWO freq is the 4MHz (which is what is passed in to the swoview as well - swoview 4000000)

    CPU freq - what ever is the freq you are running your cpu at.

  • Hi Guru,

    GDB Server accepts the changes, but still no output.

    GDB Server output: (abridged)

    Received monitor command: SWO DisableTarget 0xFFFFFFFF
    SWO disabled successfully.
    Received monitor command: SWO EnableTarget 64000000 4000000 0xFF 0
    SWO enabled successfully.

  • Hi Obbe,

        its always tricky to get the frequencies correct, its a pain and I messed up the first time as well.

    If I look at the nrf52_bitfields.h

    #define CLOCK_TRACECONFIG_TRACEPORTSPEED_32MHz (0UL) /*!< 32 MHz Trace Port clock (TRACECLK = 16 MHz) */
    #define CLOCK_TRACECONFIG_TRACEPORTSPEED_16MHz (1UL) /*!< 16 MHz Trace Port clock (TRACECLK = 8 MHz) */
    #define CLOCK_TRACECONFIG_TRACEPORTSPEED_8MHz (2UL) /*!< 8 MHz Trace Port clock (TRACECLK = 4 MHz) */
    #define CLOCK_TRACECONFIG_TRACEPORTSPEED_4MHz (3UL) /*!< 4 MHz Trace Port clock (TRACECLK = 2 MHz) */

    So if we are setting a trace port clock of 4MHz its actually 2Mhz trace clock.

    now getting back to the solution

    1) Set all the clock to 4 MHz

    Debugger Tab

    Initial Speed Fixed: 4000 KHz

    Startup Tab

    Initial Reset and Halt Type: Low Speed: 4000 KHz

    JTAG/SWD Speed Fixed: 4000 KHz

    2) In your 2nd screenshot (Startup tab of eclipse debug configuration) set the cpu freq and swo freq back to 0 (allow the JLinkGDBServer to figure out the swo freq (which is the trace port clock i.e. 4 MHz)

    3) And then I also found out that the latest version of the JLink software requires a separate special command to actually start the SWO data collection. Insert the following two commands in the big edit box after Run/Restart commands

    monitor SWO Stop
    monitor SWO Start 0 2000000

    the 2000000 corresponds to the 2 MHz Trace Clock (Refer to the macros I pasted above from the nrf52_bitfields.h)

    Eclipse JLink Debug Config - Startup Tab

    Let me know if you are able to succeed in getting the SWO output in the Eclipse Console.

  • Hi Guru,

    Thanks for your reply! Yeah, I've seen and read that there is a difference between trace port clock and trace clock, but I never fully understood which values I were supposed to give to GDB Server. Unfortunately however, still no output. Disappointed I'm attaching the output from GDB Server.

    I started the session from terminal as well, and same output (i.e. none). I also tried connecting to port 2332, which would give me garbage as its the raw SWO output, and there I'm getting output, but obviously nothing readable. So maybe there's a connection, but the clocks are still misconfigured somehow that garbles the decoding?

    SEGGER J-Link GDB Server V6.22e Command Line Version
    
    JLinkARM.dll V6.22e (DLL compiled Jan  8 2018 11:45:44)
    
    Command line: -if swd -device nRF52832_xxAA -endian little -speed 4000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0
    -----GDB Server start settings-----
    GDBInit file:                  none
    GDB Server Listening port:     2331
    SWO raw output listening port: 2332
    Terminal I/O port:             2333
    Accept remote connection:      localhost only
    Generate logfile:              off
    Verify download:               on
    Init regs on start:            on
    Silent mode:                   off
    Single run mode:               on
    Target connection timeout:     0 ms
    ------J-Link related settings------
    J-Link Host interface:         USB
    J-Link script:                 none
    J-Link settings file:          none
    ------Target related settings------
    Target device:                 nRF52832_xxAA
    Target interface:              SWD
    Target interface speed:        4000kHz
    Target endian:                 little
    
    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link Lite-Cortex-M V8 compiled Sep 15 2016 12:05:01
    Hardware: V8.00
    S/N: 518005256
    Feature(s): GDB
    Checking target voltage...
    Target voltage: 3.27 V
    Listening on TCP/IP port 2331
    Connecting to target...Connected to target
    Waiting for GDB connection...Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x20000400)
    Read 2 bytes @ address 0x00000000 (Data = 0x0400)
    Read 2 bytes @ address 0x00021630 (Data = 0xB508)
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x20000400)
    Read 2 bytes @ address 0x00000000 (Data = 0x0400)
    Received monitor command: reset
    Resetting target
    GDB closed TCP/IP connection
    Connected to 127.0.0.1
    Reading all registers
    Read 2 bytes @ address 0x00021630 (Data = 0xB508)
    Read 4 bytes @ address 0x000008E4 (Data = 0x47184B06)
    Read 2 bytes @ address 0x000008E4 (Data = 0x4B06)
    Received monitor command: speed 4000
    Target interface speed set to 2000 kHz
    Received monitor command: clrbp
    Received monitor command: reset
    Resetting target
    Received monitor command: halt
    Halting target CPU...
    ...Target halted (PC = 0x000008E4)
    Received monitor command: regs
    R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    R12= 00000000, R13= 20000400, MSP= 20000400, PSP= 00000000
    R14(LR) = FFFFFFFF, R15(PC) = 000008E4
    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x000008E4 (Data = 0x47184B06)
    Read 2 bytes @ address 0x000008E4 (Data = 0x4B06)
    Received monitor command: speed 4000
    Target interface speed set to 2000 kHz
    Received monitor command: flash breakpoints 1
    Flash breakpoints enabled
    Received monitor command: semihosting enable
    Semi-hosting enabled (Handle on BKPT)
    Received monitor command: semihosting IOClient 3
    Semihosting I/O set to TELNET and GDB Client
    Received monitor command: SWO DisableTarget 0xFFFFFFFF
    SWO disabled successfully.
    Received monitor command: SWO EnableTarget 0 0 0xFF 0
    SWO enabled successfully.
    Read 2 bytes @ address 0x00021630 (Data = 0xB508)
    Read 4 bytes @ address 0x000008E4 (Data = 0x47184B06)
    Read 2 bytes @ address 0x000008E4 (Data = 0x4B06)
    Downloading 16064 bytes @ address 0x0001F000 - Verified OK
    Downloading 6032 bytes @ address 0x00022EC0 - Verified OK
    Downloading 8 bytes @ address 0x00024650 - Verified OK
    Downloading 132 bytes @ address 0x20002C38 - Verified OK
    Writing register (PC = 0x0001F46C)
    Read 2 bytes @ address 0x00021630 (Data = 0xB508)
    Read 4 bytes @ address 0x0001F46C (Data = 0x2B004B15)
    Read 2 bytes @ address 0x0001F46C (Data = 0x4B15)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x0001F678 (Data = 0xF001)
    Read 2 bytes @ address 0x0001F68E (Data = 0x687B)
    Received monitor command: clrbp
    Received monitor command: reset
    Resetting target
    Received monitor command: halt
    Halting target CPU...
    ...Target halted (PC = 0x000008E4)
    Received monitor command: SWO Stop
    SWO stopped.
    Received monitor command: SWO Start 0 2000000
    SWO started.
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Read 2 bytes @ address 0x00020B3A (Data = 0xF7FF)
    Received monitor command: regs
    R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    R12= 00000000, R13= 20000400, MSP= 20000400, PSP= 00000000
    R14(LR) = FFFFFFFF, R15(PC) = 000008E4
    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x000008E4 (Data = 0x47184B06)
    Read 2 bytes @ address 0x000008E4 (Data = 0x4B06)
    Setting breakpoint @ address 0x0001F68E, Size = 2, BPHandle = 0x0001
    Setting breakpoint @ address 0x00020B3A, Size = 2, BPHandle = 0x0002
    Starting target CPU...
    ...Breakpoint reached @ address 0x00020B3A
    Reading all registers
    Read 4 bytes @ address 0x00020B3A (Data = 0xFF57F7FF)
    Removing breakpoint @ address 0x0001F68E, Size = 2
    Removing breakpoint @ address 0x00020B3A, Size = 2
    Reading 64 bytes @ address 0x00020B00
    Reading 64 bytes @ address 0x00020B40
    Reading 64 bytes @ address 0x00020B80
    Reading 64 bytes @ address 0x00020BC0
    Reading 64 bytes @ address 0x00020C00
    Reading 64 bytes @ address 0x00020C40
    Reading 64 bytes @ address 0x00020C80
    Reading 64 bytes @ address 0x00020CC0
    Reading 64 bytes @ address 0x2000FFC0
    Read 4 bytes @ address 0x0001F4BA (Data = 0xF835F004)
    Read 2 bytes @ address 0x0001F46C (Data = 0x4B15)
    Read 4 bytes @ address 0x0001F4C4 (Data = 0x20010000)
    Read 2 bytes @ address 0x0001F46E (Data = 0x2B00)
    Read 2 bytes @ address 0x0001F470 (Data = 0xBF08)
    Read 2 bytes @ address 0x0001F472 (Data = 0x4B13)
    Read 4 bytes @ address 0x0001F4C2 (Data = 0x00000008)
    Read 2 bytes @ address 0x0001F474 (Data = 0x469D)
    Read 2 bytes @ address 0x0001F476 (Data = 0xF5A3)
    Read 2 bytes @ address 0x0001F478 (Data = 0x3A80)
    Read 2 bytes @ address 0x0001F47A (Data = 0x2100)
    Read 2 bytes @ address 0x0001F47C (Data = 0x468B)
    Read 2 bytes @ address 0x0001F47E (Data = 0x460F)
    Read 2 bytes @ address 0x0001F480 (Data = 0x4813)
    Read 4 bytes @ address 0x0001F4D0 (Data = 0x00018000)
    Read 2 bytes @ address 0x0001F482 (Data = 0x4A14)
    Read 4 bytes @ address 0x0001F4D6 (Data = 0x00000001)
    Read 2 bytes @ address 0x0001F484 (Data = 0x1A12)
    Read 2 bytes @ address 0x0001F486 (Data = 0xF004)
    Read 2 bytes @ address 0x0001F488 (Data = 0xF88F)
    Reading 64 bytes @ address 0x2000FF00
    Reading 64 bytes @ address 0x2000FF40
    Reading 64 bytes @ address 0x2000FF80
    Read 4 bytes @ address 0x2000FF18 (Data = 0x000242C0)
    Read 4 bytes @ address 0x000242B8 (Data = 0x00000000)
    Read 4 bytes @ address 0x2000FF34 (Data = 0x000242C0)
    Read 4 bytes @ address 0x000242B8 (Data = 0x00000000)
    Read 4 bytes @ address 0x2000FF50 (Data = 0x000242C0)
    Read 4 bytes @ address 0x000242B8 (Data = 0x00000000)
    Read 4 bytes @ address 0x2000FF6C (Data = 0x000241B4)
    Read 4 bytes @ address 0x000241AC (Data = 0x00000000)
    Read 4 bytes @ address 0x2000FF7C (Data = 0x00024164)
    Read 4 bytes @ address 0x0002415C (Data = 0x00000000)
    Read 4 bytes @ address 0x2000FF88 (Data = 0x0002421C)
    Read 4 bytes @ address 0x00024214 (Data = 0x00000000)
    Read 4 bytes @ address 0x2000FFC0 (Data = 0x2000FFC8)
    Read 4 bytes @ address 0x2000FFD8 (Data = 0x0000FFFF)
    Read 4 bytes @ address 0x2000FFE4 (Data = 0x00020AC7)
    Read 4 bytes @ address 0x2000FF04 (Data = 0x0002428C)
    Read 4 bytes @ address 0x00024284 (Data = 0x00000000)
    Reading 64 bytes @ address 0x2000FEC0
    Read 4 bytes @ address 0x2000FEFC (Data = 0x00024138)
    Read 4 bytes @ address 0x00024130 (Data = 0x00000000)
    

  • I can see the output in my eclipse swo terminal with the settings I mentioned in my post earlier Slight smile

    As per your GDB Server logs, the interface clock speed is set to 2MHz even when you try to set it to 4MHz - I am not sure why (may be the on-board jlink in nRF52-DK can only work with lower speeds???). And I am also not sure if the SWO clock can be higher than the interface clock.

    Try setting a breakpoint in your code and when the breakpoint is hit, try executing the below 2 commands in your GDB Console window. (No code changes) - Please note that commands you execute on the GDB Console for SWO, will only print its output in the GDB Server Console and not on the GDB Client Console - so you may have to switch between the 2 console windows to see the commands output.

    monitor SWO Stop
    monitor SWO Start 0 1000000

    And then resume the code execution.

    I won't get chance to test this until tomorrow. But check if you are able to succeed.

  • Same result. :/

    Not sure what the onboard JLink supports and doesn't. Also have a Segger JLink LITE that I've tried (max frequency 2MHz), with the same result.

    But would JLinkExe work if GDBServer doesn't? (If its hardware dependent)

Reply Children
  • I have updated JLinkGDBServer to V6.30i, as V6.22f has the following release note: "Firmware: Read in from SWO of external devices with J-Link OB on Nordic Semiconductor nrF52-DK, fixed."

    Now I'm getting SWO output to the telnet channel, but Eclipse is still silent...

    In order to get telnet output I'm using the following commands. (I've update Eclipse to reflect the changes, but no change there)

    mon SWO EnableTarget 0 0 1 0
    mon SWO Start 0 4000000

Related