FreeMASTER Segger RTT communication plugin

cancel
Showing results for 
Search instead for 
Did you mean: 

FreeMASTER Segger RTT communication plugin

Jump to solution
874 Views
lucabarbiero
Contributor IV

Hi,

I am trying to use the new Segger RTT communication plugin. Of course I am running the latest freemaster target driver with net transport and segger_rtt. This is my freemaster_cfg.h:

lucabarbiero_0-1645460809741.png

 

From the host I want to establish a connection in passive mode. Therefore I have an active J-Link debug session with the command line debugger:

lucabarbiero_0-1645460419982.png

But freemaster app says target unreachable:

lucabarbiero_1-1645460491243.png

What should I look into? Can it be a problem to establish a telnet connection to localhost:19021? Because I think telnet is not enabled in my computer (and I need to reach out to my IT to get it enabled). Or is there a telnet client embedded in freemaster?

Or do you think the problem is something else?

 

Regards,

Luca

0 Kudos
1 Solution
767 Views
MichalH
NXP Employee
NXP Employee

Dear Luca,

thanks for making the experiment. The error code says there was a timeout when waiting for the response. This means the TCP/telnet connection to JLink.exe was established well. The timeout occurs during the communication over RTT itself. It would need some more debugging of the MCU side to find out what is wrong.

It is okay if you do not want to spend more time with it. Still this forum thread may be helpful for someone trying to make the same connection.

Please close this thread.

Thanks,
Michal

View solution in original post

0 Kudos
6 Replies
763 Views
lucabarbiero
Contributor IV

Ok so there must be something in my embedded software application. For this experiment I was calling FMSTR_Poll() as the only task in my infinite loop. But I also have another fast interrupt where my control loop executes. Maybe that is interfering.  I am accepting your solution as there seems to be no issue with FreeMASTER desktop app, using SEGGER RTT communication channel in passive mode. Thanks for your support!

0 Kudos
772 Views
lucabarbiero
Contributor IV

Hi Michal, sorry for the delay. I can confirm all the settings on target side you mentioned. Now with the same setup as described before, but with your modified DLL, I get the error code displayed in the screenshot. What does it tell you?

lucabarbiero_0-1646640820996.png

 

From here I don't have interest in making this work, I don't think I will use it. It's not particularly fast as you confirm, and this communication channel  only works in poll mode, which not compatible with my application. In my use case I found that long interrupt is the way to go.

 

Regards,

Luca

 

0 Kudos
768 Views
MichalH
NXP Employee
NXP Employee

Dear Luca,

thanks for making the experiment. The error code says there was a timeout when waiting for the response. This means the TCP/telnet connection to JLink.exe was established well. The timeout occurs during the communication over RTT itself. It would need some more debugging of the MCU side to find out what is wrong.

It is okay if you do not want to spend more time with it. Still this forum thread may be helpful for someone trying to make the same connection.

Please close this thread.

Thanks,
Michal

0 Kudos
836 Views
lucabarbiero
Contributor IV

Hi @MichalH,

The telnet connectivity test is successful on my side as well, with the same output you get. At this point it is probably something on target side. The RS-232 comm works fine though.

Anyway I think I am loosing interest for this SEGGER RTT connectivity option. Do I read correctly here that it achieves 1 Mbps? That's not very fast actually. I was looking for a way to speed up large recorder downloads. Maybe I should focus on TCP/UDP instead. Would you agree?

 

Regards,

Luca

0 Kudos
828 Views
MichalH
NXP Employee
NXP Employee

Dear Luca,

I'm sorry for the issues with the RTT. Can you give it one more try with this patch of mcbpgi.dll copied over the existing file in "c:\NXP\FreeMASTER 3.1\FreeMASTER\mcbpgi.dll" ?  The failure Test Connection message will now also print an error code number. This number will tell if there is a problem with a localhost "telnet" connection or with the target interface.

Also, make sure you have the target side configured as 

#define FMSTR_TRANSPORT FMSTR_NET // Use network transport layer
#define FMSTR_NET_DRV FMSTR_NET_SEGGER_RTT // Use network driver for SEGGER RTT 

..and you have the RTT C files in project (src\support\segger_rtt\*.c) . There are fmstr_rtt examples available in MCUXPresso SDK packages for FRDM-K64F and i.MX-RT10xx. 

 

Anyway, the fastest options are definitely the USB-CDC and TCP/UDP options. 

Thank you for your cooperation,
Michal

 

 

0 Kudos
858 Views
MichalH
NXP Employee
NXP Employee

Dear Luca,

your steps and JLink.exe screenshot look correct. As soon as the JLink.exe connects to the device, it also starts the RTT server at port 19021 and is ready to accept connections.

FreeMASTER does not depend on having telnet installed in system. It uses an internal TCP connection directly. However, the telnet utility is quite useful to test if the RTT server is reachable. There are also other tools like TeraTerm which are able to connect by telnet/TCP link.

In my case, I'm able to connect with telnet and I get the following "welcome" message:

> telnet localhost 19021
SEGGER J-Link V7.56d - Real time terminal output
J-Link OpenSDA compiled May 27 2019 10:59:53 V1.0, SN=621000000
Process: JLink.exe

It would be good if you could verify the connectivity the same way. I think the local firewall or antivirus software may block the incoming connection even for localhost clients (like FreeMASTER). 

Regards,
Michal

0 Kudos