[SOLVED] RTT with STM32L4

  • [SOLVED] RTT with STM32L4

    Hello:

    Our company has just started to use the RTT functionality of the JLink for terminal output. I have two issues that hopefully have answers and are not super hard to solve. We have tried fiddling with RTT for the past day or so.

    First question:
    We are using an STM32L476 with 128K RAM. There are two RAM banks: one starts at 0x10000000 (32K) the other starts at 0x20000000 (96K). When the JLink server starts up and we click the RTT tab and start it, the GDB server runs its scan process to try and find the RTT control block. It never finds it because the GDB server is only scanning RAM bank 2. Our control block is in RAM bank 1. Now to test the theory, we forced the control block into RAM bank 2 and it found it, and RTT worked fine. However, this is not an option in our end application; we cannot force the control block into a fixed location. Why is the GDB server not scanning the entire RAM memory map for the control block? I went poking around down into the segger installation directory to see if I could find a file where the MCU memory spaces are mapped out. There is a file called MCU.csv which seems to map out all of the memory spaces for all the supported MCUs. On the other hand... it looks like this file only supports a single bank of RAM and not multiple banks. If I scroll down to my selected MCU, it maps out bank 2 (the one that GDB was scanning) and not bank 1. Does this file control the memory map for the MCUs while scanning? If so... why does it not support multiple banks?

    Second question:
    We have tried going into low power modes while using RTT. We have tried to go into what is referred to as "sleep" and "stop2" on the STM32L4 MCU. RTT does not like either mode and the GDB server fails to read the RTT data memory if we go into either of these modes using the WFI instruction. We have resolved to the fact that this might be a necessary evil to not go into the low power modes while using RTT. Is this something that Segger is aware of? Is it not possible to go into low power modes with RTT, or do you think it is just a problem with the STM32L4 part?

    Thanks

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

  • Hello,

    The RTT Auto Detection might not always search the whole available RAM.
    The RAM banks are stored internally in the J-Link DLL, MCU.scv is used by J-Flash only.
    We will add additional search ranges for devices, but this takes its time for the mass of supported devices.
    Currently you can explicitly specify the search ranges. Have a look at segger.com/jlink-rtt.html for the exact commands to do this.

    It is recommended to not use low power modes when debugging.
    In most low power modes either the whole debug unit or access to memory is disabled.

    Best regards
    Johannes
    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.
  • Having multiple banks searched would be very useful. If we manually have to set the address range, this becomes a requirement on our end user to put in the custom command while debugging. This is not ideal, so we would appreciate the ability for the entire RAM memory to be searched based on the selected MCU.
  • So we finally got the macro file working with jlink GDB using eclipse and were able to specify the search ranges. We really want to make usage of the RTT viewer though. The RTT viewer as it is now takes no command line parameters. If this program was able to run from the command line that might be an easier alternative. Basically on the command line you could specify the CPU, jlink connection, memory address search range, etc.. Everything that requires user input via the popup on the UI when you start the RTT viewer should easily be able to move to the command line instead.

    This would be an extremely useful feature, because ultimately we would like to ship a batch file to our end user where they run it and it just goes straight to the RTT viewer terminal instead of having to configure via the popup box each time. Our production line would also make usage of this.
  • Hello,

    we have released a new beta version, containing a new version of the RTT viewer with support for command line parameters and some other improvements.

    Short description of command line parameters (manual update is still in progress):

    -d, --device: Select the connected target device.
    -ct, --connection: Sets the connection type
    -if, --interface: Sets the interface type
    -ip, --host: The IP address of the J-Link
    -s, --speed: Interface speed in kHz
    -sn, --serialnumber: Select the J-Link with a specific S/N
    -ra, --rttaddr: Sets the address of the RTT control block
    -rr, --rttrange: Specify RTT search range
    -a, --autoconnect: Automatically connect to target, suppress settings dialog

    Best regards
    Arne
    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.