[SOLVED] Using RTT in an automated setup

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

  • [SOLVED] Using RTT in an automated setup

    Hello,

    I'm investigating using RTT as output for gcov results. We intend to use this setup to get coverage results of continuous integration tests executed by our build environment.

    Using gcov means we need a way to create the .gcda files on the host machine. It is my understanding that this is not currently possible to do directly using RTT.

    - Has any plans been made for letting RTT support retargeting of syscalls (open, read, write etc.) to be able to interact with files on the host machine?

    - How do we implement the RTT tools on the PC (JLinkRTTLogger.exe etc.) in an automated setup? We need to be able to specify which RTT channel to listen to, debugger interface, MCU type etc. I haven't been able to find any way to specify this.

  • Automate RTT

    RTT is fairly easy to integrate with Windows using the Segger supplied dlls and SDK. We used it to automate production testing of a M4 based device at an offshore CM. The EOL PC ran a C# program - I had to add a few p/invoke signatures to use the RTT calls in the dll ...

    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public struct JLINK_RTTERMINAL_START_t {
    public UInt32 ConfigBlockAddress;
    public UInt32 Dummy0;
    public UInt32 Dummy1;
    public UInt32 Dummy2;
    }

    [DllImport("JLinkARM.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
    unsafe public static extern int JLINK_DownloadFile(sbyte[] sFileName, UInt32 Addr);
    [DllImport("JLinkARM.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
    unsafe public static extern int JLINK_RTTERMINAL_Control(UInt32 Cmd, ref JLINK_RTTERMINAL_START_t rtt_info);
    [DllImport("JLinkARM.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
    unsafe public static extern int JLINK_RTTERMINAL_Read(UInt32 BufferIndex, sbyte[] sBuffer, UInt32 BufferSize);
    [DllImport("JLinkARM.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
    unsafe public static extern int JLINK_RTTERMINAL_Write(UInt32 BufferIndex, sbyte[] sBuffer, UInt32 BufferSize);

    The beauty of using RTT is leveraging the JTAG bed-of-nails fixture for both programming and board test - no cables or connectors are installed until the board is proved out.

    The post was edited 1 time, last by rmilne ().

  • Hi,

    sorry for the delay in response.
    Has any plans been made for letting RTT support retargeting of syscalls (open, read, write etc.) to be able to interact with files on the host machine?

    Similar to semihosting?
    Currently, there are no plans on our side to implement anything like this in RTT.
    However, it is of course possible to use the J-Link SDK (Part No 8.08.06 on the price list) in order to write an application that interprets the data send by the target and does what ever you would like it to do on the host machine.
    Would it help if i would provide you with an excerpt of the SDK documentation (UM8002)?

    - How do we implement the RTT tools on the PC (JLinkRTTLogger.exe etc.) in an automated setup? We need to be able to specify which RTT channel to listen to, debugger interface, MCU type etc. I haven't been able to find any way to specify this

    There are plans to update the tools available for RTT (among other features and changes) with command line parameters for automation, but there is no fixed release date yet. This can also be done using the SDK.

    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.
  • Hi,

    Thanks for the response Niklas and rmilne!

    I will look into the SDK - the example shown by rmilne indicates that it will be rather simple to implement. However, an excerpt from the documentation would definitely help me along :)


    I still would vote for semihosting-like RTT features.


    /Rals
  • Hi Rals,

    Unfortunately, the excerpt we give out to the public (As the SDK is not available to the public) contains actually less information than the information rmilne provided.

    However,
    the example shown by rmilne indicates that it will be rather simple to implement
    I can confirm the assumption.

    Short summary of the SDK terms:
    One license fee provides / allows to:
    • 6 Months of support
    • Company-wide-license (Company wide usage of applications using the SDK)
    • Unlimited number of developers of the licensed company can use the SDK
    • Authorization to distribute and ship software [outside the licensed company] which uses the J-Link SDK or parts of it can be permitted by SEGGER upon request.
    If there are further questions regarding SEGGER RTT, do not hesitate to ask me.

    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.