This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F28069M: External Mode is not running in SImulink

Part Number: LAUNCHXL-F28069M


Hello,

 I have been trying since 2 days to run simulink model in External mode. Everytime I do this, Error is appeared as below.

Build process completed successfully
Attempting to establish connection with hostname '127.0.0.1' through port 17725.
Error occurred while executing External Mode MEX-file 'ext_comm':
Failed to connect to the target. Possible reasons for the failure:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.

Caused by:
An error occurred attempting to open an rtIOStream. More detail may be reported in the MATLAB command window

 

I have tried almost everything that i could.

Set the correct COM port (one can see in attachement). It is building correctly and uploading to HW.But after that it is giving above error.

Please help me to fix it.

Thank you

regards

Rahul

  • Hi Rahulkumar,

    The thread below might give you some information and Mathworks experts will give you a reply soon. Thanks.
    e2e.ti.com/.../2090278

    Best regards,
    Chen
  • Hi Chen,

    I have read the thread that you have suggested and I have tried to set the parameters(SCI_A and clock freq.) which are being suggested in that thread but still i am getting same error.

    I dont know if that thread has been solved or not. If someone has the solution then please help me.

    Thank you

    regards
    Rahul
  • Hi Rahul,

    Why do you have 2 XDS100 ports (COM6 and COM7)? How do you know you need COM7 (vs COM6)? 

    I'd suggest cleaning this up, as maybe it is possible board is connected to CCS via COM6, and MATLAB cant access via COM7.  Note MATLAB does invisible calls to CCS for connection and download with the board, so you should not have CCS connected in advance as this may lock out MATLAB from being able to talk to the board.

    HTH,

    -Brian

  • Hi,

    As Brian mentioned,

    we need to have only COM port and be sure that it corresponds to Auxiliary port of the emulator.

    The emulation port labeled “XDS100 Class Auxiliary Port” corresponds to PORTB of the emulator. On some PC’s, the label could be “TI XDS100 ChannelB” and this port is used for external mode.

    Right-click on this emulation port and select tab Advanced. Make sure the option Load VCP is checked and click OK to save any changes.

    Optionally you can check this option is not selected for channel labeled “XDS100 Class Debug Port”/ “TI XDS100 ChannelA” (so JTAG emulation works correctly).

    Still from within the Device Manager, expand the section Ports and locate the entry USB Serial Port (COMnn). The value nn is the number of the serial port configured by Windows for your emulator. Other COM ports may be available in your computer, therefore make sure you check the correct one.

    Regards,

    Venkatesh C

  •   Hello,

    I have done what you have instructed. You can also find it in the screenshots that i have attached.

    I did not start CCS(v7) even after restarting my Laptop and I dont know how this port error comes from?

    Any help to solve this?

    Thank you

    regards

    Rahul

  •  Hi,

    Can you verify once if the mux selection is a issue. You need have UART enabled on GPIO29 and 28. that is option 2 from table and the jumper settings for JP6 and JP7.

    And the same GPIO needs to selected under SCI_A pane in simulink.

    Regards,

    Venaktesh C

  • Hello Venaktesh,

    Thank you for fast reply.

    I tried tpo put proper jumper on but still the same error. Actually I tried all the 4 possibility that is in the table but still same error.

    is it something to do with port and hostname? I do not undestand

    regards

    Rahul

  • Hi,

    We could re-produce this error by launching putty.exe to listen on this COM port which Simulink is configured for external mode.
    Since the COM port is pre-occupied by an application like putty, we throw the above error.
    Could you please check if the COM port is busy by some other application? You can check this easily by launching putty and try to connect to this COM port. IF putty refuses to connect, then there is a application in background which is already using it.

    Regards,
    Venkatesh C
  • Hello,

    I have opened putty and connected COM6  port via serial. It did not throw any error and instead it is connected.

    Thank you .

    But still the same error.

    Regards

    Rahul

  • Hi,

    Can you please do the following:

    1. Reproduce the error once more in MATLAB.
    2. Windows key+R and type - %temp%
    3. Get the content of file where we log the status of connection. The file name for example could be similar to this pattern 'tp2ed0a200_334d_490c_bb64_078d370ebc85'
    The content of this file when I was able to reproduced the error was:

    'Serial Delay : 0s
    TCP/IP Timeout : 60s

    COM Port COM11 is currently owned by some other application. Please close that and try again.
    Could not bring up serial communications properly.. Check the errors above.. Quitting'

    Please send us the content from your file.

    Regards,
    Venkatesh C
  • HI,

    the following is the content from file.


    Serial Delay : 0s
    TCP/IP Timeout : 60s


    Serial Port Settings Verify:-----------------------------------------
    Port : //./COM7
    Baud Rate : 114796
    Serial Communications Up. Listening...

    Starting server on - localhost/127.0.0.1
    Waiting for client on localhost/127.0.0.1:17725
    Time out, client did not respond within the time window. Quitting now...


    Thank you

    regards

    Rahul Lukhi

  • Hi,

    Please can you contact Mathworks technical support to be able to further assist you.

    We may need your model and be able to have couple of WebEx sessions with you.

    Regards,

    Venkatesh C

  • Hi,

    Okay. I will contact MathWorks for further Assistance.

    Thank you

    Regards

    Rahul Lukhi