[SOLVED] RTT Viewer automatic connect when device powers on

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

  • [SOLVED] RTT Viewer automatic connect when device powers on

    Hi,

    is there a way within the RTT Viewer to do an automatic re/connect, when the microcontroller gets powered on?

    The reason behind my question is that I'm currently working on a project with 2 microcontrollers.
    My part is the ble communication via an nRF52832. Most of the time the nRF is powered off till an action is performed on the other controller. The nRF than gets powers on, does some work (controlling other ble devices, receiving configs, etc.) and is powered off again.
    The problem I'm facing right now is that I'm losing quite some log messages while testing because I need to manually reconnect the RTT Viewer everytime the nRF gets powered on.
    It would be a great help if something like "rising edge on VTarget detected" would lead to a reconnect. Is there a way to do something like that?

    The J-Link version I'm using is V6.94a.

    Regards,
    Johannes
  • Hi Johannes,
    there is currently no way to do this with the J-Link RTT Viewer.

    I will bring this up in our next internal meeting and we will probably put this on the feature request list.

    Please note that we are currently pretty much booked out with pressing projects.
    As you are the first customer to request such a feature, we can not give this a high priority.

    Unfortunately, this means that we cannot provide any fixed timeline.

    Best regards,
    Fabian
    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 Fabian,
    thanks for the fast reply.

    That's what I thought.
    Is there a way to get VTarget via the command line? If so I could write my own skript, which starts the rtt logger or something like that.

    Regards,
    Johannes
  • Hi Johannes,

    In general:
    The best option would be to extend your RTT buffer size on target side, so you do not lose data so quickly.

    Regarding checking VTref:
    The best option would probably to acquire the J-Link SDK and use it to check VTreff + handle the RTT data:

    Without the SDK you could probably do the following:
    1) Start the J-Link Comander (JLink.exe) with command line options via e.g. Python controlling the I/O.
    2) Start the J-Link RTT Viewer and select "Connection to J-Link" > "Existing Session" + check "Auto Reconnect".
    3) Poll the command "st" which shows the Hardware Status. The first line returned is VTreff.
    4) Connect to the device as soon as VTreff shows the desired value ("connect" command).
    Instead of steps 3) and 4) you could probably also spam the "connect" command,
    as long as the "Cannot connect to target" message is shown and stop as soon as it does not.

    Even though the "non-SDK-option" will probably work,
    it is a pretty untidy solution.

    Also, neither of the options guarantee that you do not lose data in the process.
    The reason is that the connect sequence takes some time (< 1 sec), in which the device could already write more data via RTT then fits the device side buffer.

    Best regards,
    Fabian
    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 Fabian,
    I was finally able to try the methode your wrote in your last post and test it for a few days. It works to a certain degree.

    Sometimes the RTT Viewer throws the error message "Could not connect to J-Link." but since this a workaround I expected that something like this could happen.
    The only thing missing is performing "exit" if VTref reaches 0 again, but this might be a result of my missing batch file and j-link command file coding knowledge.

    But at least I get all RTT messages.
    Oh and before I forget I've already increased the RTT buffer size as far as I can.

    Best regards,
    Johannes
  • Your initial request was about auto-connect in case of power-on.
    Auto-exit was not a requirement in your initially described setup.

    There is no auto-exit option as you are looking for. We may add it in a future version but I cannot promise anything at this point.
    We still recommend to go with the SDK.

    BR
    Alex
    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 Alex,

    I know that there isn't such an option.
    It was just a thought of mine what's still missing so that my workaround works without a user input and that it's something I need to figure out myself.

    And as you can imagine I can't just say "Let's buy the SDK." I need to get the permission from higher ups and this may take a while.

    Anyway have a great start in your week.
    Best Regards,
    Johannes
  • Hi Johannes,

    It should not really be an issue to get your hands of the SDK. It’s a very small one-time fee, for a company-wide license of the SDK.
    And as you are asking for super-special stuff here, it should not be a problem to get a specialized tool (the SDK) for the very specific work.
    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.