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

RTT Viewer doesn't always work

Not really a question - I have had trouble with J-Link RTT Viewer for some time, when it works it's a very useful tool, but it was only working about 25% of the time. This evening I had a flash of inspiration, and plugged the J-Link lite into the main USB socket on the PC, rather than via a powered hub. J-Link RTT Viewer seems to work reliably now, although it's too early to tell if it will be perfect....

I don't know if this is a known problem, but thought it might help someone.

All I need now is for someone to tell me how to make J-Link RTT Viewer remember the serial number I type in between sessions.

Parents
  • I wanted to share the most reliable and efficient method I found, which also allows using the excellent Log Viewer Log4View. Simply create and launch 2 distinct batch files, open Log4view and start debugging!

    The first batch file starts the JLINK Commander that reliably connects (and reconnects) to a target, buffers and make log output available through telnet. Rename as "jlinkcommander.bat" and start it once only;

    REM this is to start JLINK Commander, that collects log stuff and make it available through telnet port 19021
    "C:\Program Files (x86)\SEGGER\JLink_V510d\JLink.exe" -device NRF52832_XXAA -if SWD -speed 4000 -autoconnect 1
    

    Then the 2nd batch file can be killed and restarted as desired to "cut" the log file, and store the previous log as an archive, which can be usefull for later reference. I called it "jlink_startlog.bat" :

    REM this script renames current log file, if any, to date-time format
    REM then move all logs to subfolder archive
    REM then starts a telnet receiver to localhost + stores output to a local file
    REM this file can then be read through Log4View (file receiver, log format = pattern, %m (dump all directly)
    REM Log4View could also be configured to track formatting like  UniversalTime (runtime in ms) log source, etc..
    @echo off
    echo wscript.echo year(date) ^& "-" ^& right(100+month(date),2) ^& "-" ^& right(100+day(date),2)^& "@" ^& right(100+hour(time),2) ^& "-" ^& right(100+minute(time),2) > "%temp%\dateparts.vbs"
    for /f "tokens=1 delims=" %%a in ('cscript //nologo "%temp%\dateparts.vbs"') do set yyyymmddhhmm=%%a
    echo Now you can use this in your filename: %yyyymmddhhmm%
    @echo on
    
    if EXIST rtt_debug.log (
    REN rtt_debug.log "%yyyymmddhhmm% - rtt_debug.log"
    )
    
    move %~dp0\*.log %~dp0\archive
    
    telnet localhost 19021 -f rtt_debug.log
    

    Finally I recommend viewing the log output using Log4View. Simply configure a File Receiver, using the pattern %s to output the whole file content. You can also standardize the output format of all your NRF_LOG to feed the uptime in millisecond, the log source, the severity, etc.

    [31761132] RFN0 >> [ForcedRxLoad] ignore (mode_site)
    [31761134] RFN0 >> [RxProcessRun] <<< scan >>> FreqBandIsmRxDefaultOverride
    [31770625] MODEM>> RX (12)
    [31770626] MODEM>> 0000: C3 00 00 06 6B 17 01 00 00 00 7D EE -- -- -- -- 
    [31770627] MODEM>> [ATRspProcess] app -> h_OnIpTunnelDataReceived (12)
    
Reply
  • I wanted to share the most reliable and efficient method I found, which also allows using the excellent Log Viewer Log4View. Simply create and launch 2 distinct batch files, open Log4view and start debugging!

    The first batch file starts the JLINK Commander that reliably connects (and reconnects) to a target, buffers and make log output available through telnet. Rename as "jlinkcommander.bat" and start it once only;

    REM this is to start JLINK Commander, that collects log stuff and make it available through telnet port 19021
    "C:\Program Files (x86)\SEGGER\JLink_V510d\JLink.exe" -device NRF52832_XXAA -if SWD -speed 4000 -autoconnect 1
    

    Then the 2nd batch file can be killed and restarted as desired to "cut" the log file, and store the previous log as an archive, which can be usefull for later reference. I called it "jlink_startlog.bat" :

    REM this script renames current log file, if any, to date-time format
    REM then move all logs to subfolder archive
    REM then starts a telnet receiver to localhost + stores output to a local file
    REM this file can then be read through Log4View (file receiver, log format = pattern, %m (dump all directly)
    REM Log4View could also be configured to track formatting like  UniversalTime (runtime in ms) log source, etc..
    @echo off
    echo wscript.echo year(date) ^& "-" ^& right(100+month(date),2) ^& "-" ^& right(100+day(date),2)^& "@" ^& right(100+hour(time),2) ^& "-" ^& right(100+minute(time),2) > "%temp%\dateparts.vbs"
    for /f "tokens=1 delims=" %%a in ('cscript //nologo "%temp%\dateparts.vbs"') do set yyyymmddhhmm=%%a
    echo Now you can use this in your filename: %yyyymmddhhmm%
    @echo on
    
    if EXIST rtt_debug.log (
    REN rtt_debug.log "%yyyymmddhhmm% - rtt_debug.log"
    )
    
    move %~dp0\*.log %~dp0\archive
    
    telnet localhost 19021 -f rtt_debug.log
    

    Finally I recommend viewing the log output using Log4View. Simply configure a File Receiver, using the pattern %s to output the whole file content. You can also standardize the output format of all your NRF_LOG to feed the uptime in millisecond, the log source, the severity, etc.

    [31761132] RFN0 >> [ForcedRxLoad] ignore (mode_site)
    [31761134] RFN0 >> [RxProcessRun] <<< scan >>> FreqBandIsmRxDefaultOverride
    [31770625] MODEM>> RX (12)
    [31770626] MODEM>> 0000: C3 00 00 06 6B 17 01 00 00 00 7D EE -- -- -- -- 
    [31770627] MODEM>> [ATRspProcess] app -> h_OnIpTunnelDataReceived (12)
    
Children
No Data
Related