[SOLVED] Problems communicating with RTT after flashing a device

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

  • [SOLVED] Problems communicating with RTT after flashing a device

    Hello everyone,


    I cannot connect with Segger's RTT to my device directly after flashing another device, using the same jlink adapter. I hope somebody can help me with this.


    We are creating a production tool to flash and test a product with 2 microcontrollers, using 1 Segger JLink base. The targets are:

    • EFR32FG14PxxxF256, Silicon Labs
    • PIC32MX440F128L, Microchip

    The production programmer performs the following steps

    Step 1:Flash the EFR32, we are using J-flash with SWD communication.

    Step 2:Flash the PIC32, we are using J-Link with ICSP communication. Unfortunately, we cannot use JFlash, cause JFlash does not support this chip.

    Step 3:After flashing the PIC32, we use JLink commander to create a telnet communication to communicate with the EFR32, using the RTT interface. We are using this communication to execute tests and receive the test results.


    These steps work great separated but combined we have got stuck at the following problem. After the PIC32 firmware is flashed, and the JLink commander program is closed, the following tasks stays active for about 7 seconds: “JLinkGUIServer.exe”. When this task is active, we open a new JLink Commander program trying to connect to the EFR32. We receive the following string with telnet:“J-Link GUI server; V6.80d;”


    In this situation we are not able to communicate with the EFR32FG14P over Segger’s RTT.


    If we connect to the EFR32 with jlink after “JLinkGUIServer.exe” has closed, we get the following string with telnet: “SEGGER J-Link V6.80d - Real time terminal output”. Now we can successful communicate over Segger’s RTT with telnet.


    How can we directly communicate with the EFR32 after the PIC32 is flashed? Is there a way to stop “JLinkGUIServer.exe” from starting, or to hide the GUI while flashing the device(-NoGui 1, does not work for this)? Is there a way to use JFlash instead of jlink, so we don’t have to use jlink to flash the PIC32?



    Kind Regards,


    Karel
  • Hi Karel,
    Thank you for your inquiry.

    Could you please tell us how exactly you are establishing the connection via TELNET?
    Do you connect via "localhost:19021"?
    If not, does it work if you do?

    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,

    We connect to telnet by first connecting the device with Jlink, using the following command:

    Source Code

    1. JLink.exe -device EFR32FG14PxxxF256 -if SWD -speed 12000 -autoconnect 1 -rtttelnetport 1234.

    when connected to jlink, we can setup a telnet communication to the address: localhost:19021.
    this works most of the time, it only doesn't work when “JLinkGUIServer.exe” is active. We setup the jlink communication directly after the PIC32 firmware flash.

    If we put a 10 seconds delay between the PIC32 firmware flash and the jlink communication with the EFR32, “JLinkGUIServer.exe” quits after about 7 seconds, and it also works. But 10 seconds is a lot of time if this delay is to be used for every device for production programming. So we hope we can directly communicate with the EFR32 after the PIC32 firmware flash is finished.


    Kind regards,


    Karel
  • Hi Karel,
    we were not able to recreate the issue.

    What we did:
    We used the same J-Link to successively:
    1) J-Link Commander: Connect to MCU 1
    2) J-Flash: program MCU 2
    3) J-Link Commander: Connect to MCU 1 again with the command line above
    4) Putty: Connect to localhost:1234

    We were always able to connect to the RTT telnet port immediately and instantly receive the data after the RTT control block is located.

    Are you sure, that you connected to the correct telnetport?
    In your example it should be localhost:1234

    If you made sure everything is setup correctly but the problem still persists, could you please provide us with a simple setup and
    step by step instructions on how to reproduce the behavior?

    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,

    The issue occurs when flashing the PIC32 with JLink, PIC32 flash with jflash is not possible with the current version, V6.80d. the situation is:

    MCU1 = EFR32FG14PxxxF256
    MCU2 = PIC32MX440F128L

    We do the following steps:
    1) JFlash to flash firmware MCU1
    2) JLink to flash firmware MCU2
    3) Jlink connect to MCU1
    4) Link to telnet "localhost:1234"

    We think the problem is the combination, flashing MCU2 with Jlink and after succesful flash, directly communicate with MCU1.

    1) JFlash to flash firmware MCU1

    Shell-Script

    1. JFlash -openprjEFR32.jflash -openEFR32_Firmware.hex -auto -startapp -exit -hide


    2) JLink to flash firmware MCU2

    Shell-Script

    1. JLink.exe -device PIC32MX440F128L -if ICSP -speed 4000 -autoconnect 1 -CommanderScript PIC_32.jlink

    Source Code: PIC_32.jlink

    1. erase
    2. loadfile "PIC32_Firmware.hex"

    3) Jlink connect to MCU1

    Shell-Script

    1. JLink.exe -device EFR32FG14PxxxF256 -if SWD -speed 12000 -autoconnect 1 -rtttelnetport 1234.
    Kind regards,

    Karel

    The post was edited 2 times, last by KarelDeKlein ().

  • Hi Karel,
    does it work if you add "exit" as last command in the .jlink file?

    Source Code

    1. erase
    2. loadfile "PIC32_Firmware.hex"
    3. exit

    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 Karel,
    we are still not able to reproduce this issue.
    On our side everything works as expected.
    Did you make sure that no other instance of the J-Link DLL is running on your side?

    I uploaded a small test setup for you here:
    download.segger.com/Fabian/EFRandPIC32_test.zip

    Included:
    - Test RTT application for EFR32FG14PxxxF128
    - Random test data for PIC32MX440F128L (0x1000 bytes at addr. 0x9D000000)

    - Commander script file
    - J-Flash project for EFR32FG14
    - .bat-file for for automated execution.

    Note:
    - This script file expects the J-Link Software and Documentation Pack at "C:\Program Files (x86)\SEGGER\JLink\"
    - As already mentioned, we used putty to display the RTT data from localhost:1234. The program call is commented out in the .bat-file, since you might want to use other means to connect to localhost:1234.
    - Please make sure that no other instance of the J-Link DLL is running when executing the .bat-file (indicated by a J-Link tray icon)

    Could you please give this a try?
    Could you please send us a J-Link log file? How to enable:
    wiki.segger.com/J-Link_DLL#Enable_J-Link_Log_File

    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,

    We have tested your example, it works great and I think we have found the problem. After looking more in our production software, we find out the production software sets the first telnet port to 19022; "-rtttelnetport 19022". We think this telnetport is linked to "JLinkGUIServer.exe".

    We have now set the telnet port in our production software to 1234, and it works perfect. I only have questions about the log, cause the log shows "TELNET listener socket opened on port 19022" when the telnet communication with jlink is successful and unsuccessful.

    Thank you very much for your time and information.

    Kind regards,

    Karel
  • Hi Karel,
    Good to hear that you are up and running again.

    KarelDeKlein wrote:

    I only have questions about the log, cause the log shows "TELNET listener socket opened on port 19022" when the telnet communication with jlink is successful and unsuccessful.
    I am sorry, but I do not quite understand your question.

    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.