[SOLVED] Printf on ARM9 on Keil uVision 4.13a with Real Time Agent using J-Link Pro doesn't work

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

  • [SOLVED] Printf on ARM9 on Keil uVision 4.13a with Real Time Agent using J-Link Pro doesn't work

    I'm debugging a STR912FAZ47 (ARM966E-S) chip on Keil uVision 4.13a with a JLink Pro and printf is not showing anything on my debug window. The printf was working on a Keil ULink 2 debugger with RTA. It is using an interrupt routine that is configured to the debug TX in the core (VIC0.3 CPU Core Debug Transmit Command). I see the interrupt triggers when I use the ULink 2 but it doesn't trigger with the JLink Pro. RTA allows the software to redirect the printf to another function. Are there any sample code that has printf working? I switched over to JLink Pro for the unlimited breakpoints but printf is a very important feature to have. Does Real Time Terminal work with ARM9? I didn't see it on the support list so I'm assuming it is not.
  • Hi,

    thanks for your inquiry.

    As Alex mentioned via E-Mail, RTT cannot be supported on the ST STR912 (ARM966E-S core) because on
    ARM9 based devices, the memory cannot be accessed by the debug probe, while the CPU is running.
    This limitation is caused by the CPU architecture, not by the debug probe.


    On ARM9 targets, printf() can be used with J-Link and Keil uVision via either DCC or Semihosting.
    RTA is a technology developed by Keil that uses one of the above internally.


    I do not know if the old versions of Keil uVision come with a modified standard library that supports semihosting.

    Best regards,
    Niklas
    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.
  • I got it to work. You must use term in JLink commander and choose D) Segger DCC terminal. Then you have to change the fputc function in RT_Agent.c. Instead of RTA_TermPutChar, the function JLINKDCC_SendChar should be used. You can get that from the source code in .\Samples\DCC. Make sure to define the external functions and put the correct assembly code for them. I disabled the Debug TX interrupt and place the function JLINKDCC_Process in a timer interrupt. I used a define to separate the ULink and JLink debug so I can switch between the two. The Keil uVision debug printf window and JLink doesn't work together. Everytime you want to view printf, you have time open a JLink commander, type term, press enter, type D and press enter. I made a .bat file to automate this but it still stops at the D selection.