[SOLVED] RTT on MacOSX, TI CodeComposerStudio, Tiva LaunchPad

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] RTT on MacOSX, TI CodeComposerStudio, Tiva LaunchPad

    On Mac OSX (OSX 10.10) I have J-Link (V10) working with TI's CodeComposerStudio (CCS 7.3) and the Tiva launchpad TM4C123GH6PM (Tiva) - no problems there. I can run and debug the Tiva thru CCS or run standalone (powered through the J-Link).

    By using the workaround in this Segger-forum post, I can get my simple blinky/RTT program to compile in CCS, and per the terminal output I see, can seemingly connect from a Mac Terminal to this running code via JLinkEXE and/or JLinkRTTClient but I cannot see any RTT output.

    I have tried various combinations of the Tiva running under CCS debug and/or simply standalone (powered by the J-Link).

    I will be happy to post any number of dumps for the various JLinkEXE and JLinkClient configurations I have tried, but first I thought I should verify some fundamentals:
    1. Am I missing some compiler setting and/or fundamental concept? (why didn't my simple RTT program compile right out of the box? that is, why did I have to use the above-linked work around posted for SystemView?)
    2. Is RTT supposed to work under OSX when the Tiva is flashed via the J-Link from the CCS IDE?
    Thanks for any help,
    JJ
  • Hello,

    Thank you for your inquiry.
    Am I missing some compiler setting and/or fundamental concept? (why didn't my simple RTT program compile right out of the box? that is, why did I have to use the above-linked work around posted for SystemView?)

    SystemView has only been used with CCS in combination with embOS, therefore the default combination used the embOS locking mechanism.
    That is why you need to apply the workaround from the other post to make sure no unknown functions from embOS are used.

    Is RTT supposed to work under OSX when the Tiva is flashed via the J-Link from the CCS IDE?

    RTT should be generally working on OSX with that device family.

    Where are you placing the RTT control block? Make sure it is within RAM boundaries that are known to J-Link. This would be starting at 0x20000000 and size 0x8000.

    To set another address you can specify it either per command line with the JLinkRTTViewer with command --rttaddr or with Command string SetRTTAddr in J-Link Commander.
    More information can be found in the J-Link User Manual.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Nino,
    Thanks for responding.
    In case there are any Mac OSX/Tiva/CodeComposerStudio(CCS) people following, especially anyone new to the world of SEGGER, here is what finally worked for me.

    On the Mac, there is no JLinkRTTViewer; these notes are centered around using JLinkExe and JLinkRTTClient. I also punched through to JLinkRTTLogger but won't say much more about that here.

    I got the JLinkRTTClient to work with and without the CCS Debugger running. The auto-location of the control block did not work at all for me - for example, within JLinkExe, I tried variations of the

    J-Link> exec SetRTTSearchRanges 0x20000000 0x800

    command, but could never make it work.

    In hindsight, I spent too much time thinking i just had to get the address *close* since the documentation suggests that the controlBlock address is *usually* found automatically (JLink scanning for the id in certain memory spaces).
    No.
    Within my setup anyway, close didn't matter at all; 1 byte off wasn't close enough.

    Nor could I ever get the SetRTTSearchRanges command to work.

    Finally I focused on exactly specifying the address of the control block.
    For anyone reading these notes, it can easily be found a few ways:
    • The map file: CCS has it as (.common:_SEGGER_RTT)
    • Looking at address of _SEGGER_RTT within debugger. Note that _SEGGER_RTT is instantiated within SEGGER_RTT.c
    • Or more perversely you could even loop through memory yourself, searching for the initialized string "SEGGER RTT" in memory, as long as you make sure SEGGER_RTT_Init() has been called previously.

    In any case, once you have the exact address, you can enter it within JLinkExe. For me, the control block was at 0x20000400.

    J-Link> exec SetRTTAddr 0x20000400

    Note that JLink provides no feedback about whether or not your JLink 'exec command' is good or bad, ie if it thinks there is actually an initialized control block at your address. It only complains on a parsing error.

    So, in summary:

    1) Ascertain the address of _SEGGER_RTT variable (the RTT control block).

    2) In CCS, flash the Tiva via the JLink

    3) In an OSX terminal shell, run the JLinkExe program, and connect. For example,
    JLinkExe -device TM4C123GH6PM -speed 4000 -if SWD
    _________ here's a shot from my screen _____________

    OSX:/Applications/SEGGER/JLink_V622d> ./JLinkExe -device TM4C123GH6PM -speed 4000 -if SWD
    SEGGER J-Link Commander V6.22d (Compiled Dec 14 2017 18:33:52)
    DLL version V6.22d, compiled Dec 14 2017 18:33:43

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V10 compiled Dec 12 2017 16:37:47
    Hardware version: V10.10
    S/N: 260105980
    License(s): FlashBP, GDB
    OEM: SEGGER-EDU
    VTref = 3.296V

    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Device "TM4C123GH6PM" selected.

    Connecting to target via SWD
    Found SW-DP with ID 0x2BA01477
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    Cortex-M4 identified.
    J-Link>

    4) Run the exec command from within JLinkExe
    J-Link> exec SetRTTAddr 0x20000400

    5) In another OSX terminal shell, start the JLinkRTTClient (no command line args)
    you should see your output from RTT writes in your code. For example:

    SEGGER_RTT_Init();
    // .... other code
    SEGGER_RTT_WriteString(0, "blahblah WriteString(0,...) blahblah \n");
    SEGGER_RTT_TerminalOut(1, "blah blah TerminalOut(1,..) blahblah \n");

    Note that variations on (4) above can be tried while OSX Terminal processes (3) and (5) continue running... the JLinkRTTClient output will start and stop accordingly.

    Cheers,
    JJ
  • Hi,

    Great to hear that you are up and running again.
    We will consider this case as closed then.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.