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-F28379D: Matlab Simulink External Mode

Part Number: LAUNCHXL-F28379D

#matlab #simulink #R2017b #externalmode #launchpad #F28379D

Hello LaunchPad-Fans,

right now I have a challenging problem and I wonder if someone can support me with this tricky issue.

I want to run my F28379D LaunchPad with Matlab/Simulink but I receive the error message below:

Error: Error occurred while executing External Mode MEX-file 'ext_comm':
    Failed to connect to the target. A time-out occurred while waiting for the connection response from the target. Possible reasons for the time-out:
    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.
    Error:Unable to connect to the 'TI Delfino F2837xD' target for 'test_led'.

I have already set the required configurations in Simulink Hardware Configuration:

-   Code Generation: Toolchain = Texas Instruments Code Composer Studio 

-   Hardware Board: F28379D

-  Target hardware resources:

-  Build options: Device Name = F28379D; don't boot from flash; CPU1; don't use custom linker

- External mode: Serial; COM10

 

Can you please help me with that issue so I can use the LaunchPad to scope signals in real time and tune parameters online.

Thank you for your valuable time and advice.

Johannes

 

 

 

 

  • Hello Johannes,

    This issue can be a couple of things:

    - COM port assignment issue (make sure you are selecting correct port)

    - COM port lock issue (CCS, or a prior abandoned run from MathWorks tools may have locked and not released the PC COM port, preventing additional communication). A reboot usually fixes this.

    - Additional issues already discussed here in E2E. One such thread; you can search for "external mode" to see others. https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/569793/2319744

    If you are still having issues, and for more immediate response, please contact MathWorks Technical Support.

    HTH,

    -Brian

  • Hello Brian,

    thank you for your fast reply. I really appreciate that.
    I'm sorry, but you couldn't help me with your advice out of several reasons.

    To your advice No. 1:
    Of course, I have already alligned the COM-port configurations and checked all the available tutorials and blog posts on the internet for that issue.

    To your advice No. 2:
    A reboot hasn't changed anything and I haven't opend CCS or any other TI software on my computer - just Matlab Simulink and also just a simple model; nothing else. Also, why may your software CCS installed on my PC locks the PC COM while running the model with Matlab? That doesn't make sense to me and shouldn't happen when TI advertise the development with Simulink which was the reason my organization bought several LaunchPad F28379D. And why does this not happen with the Experimenter Kit F28379D which has the same chip on its board? With the experimenter kit external mode works perfectly with exactly the same settings and configurations. I guess this is not a problem of Matlab but more a problem of the LaunchPad or CCS and can't be solved by myself easily after I spent more than 4 days for that problem.

    To your advice No. 3: I can see that this problem hasn't been solved before from anyone else and there was no concrete advice on the internet of a working solution from TI as the provider of the LaunchPad and close partner of Mathworks.

    Would you please find a solution for that often occuring problem with the LaunchPad F28379D and External Mode in Simulink R2017b?
    My organization was about to buy many LaunchPad F28379D boards as our new microcontroller development platform because of the offered features but right now, the development with Simulink in External Mode seems not possible.
    Also, can you please tell me what I can do to accelerate the building procedure in Simulink. It takes almost a minute each time I build the model and flash it to the board.

    I really hope that you or your Mathworks contact person can help me with a working solution so I can finally run the board in external mode as it is possible with the experimenter kit F28379D.
    Thank you for your valuable time and efforts.

    Best regards
    Johannes
  • Hi Johannes,

    Fastest way to get help is to contact MathWorks Tech Support (as per link above). It is likely you are close to getting this working and one minor issue needs to be fixed, but I cant tell from here what that may be. MathWorks Technical Support does not monitor the TI forums, which is why you should contact them directly - they have many resources at their disposal to assist.

    Also, 1 minute to generate and download code seems normal in my experience. You could see better performance with a high-end PC, but I only have a basic Win10 laptop with SSD, so I have never been able to test this. There are probably some performance limitations due to the download link, but I've never directly investigated.

    Cheers,

    -Brian

  • !!! SOLVED !!!

    (with the excellent help of Mathworks Technical Support)

    Both points are necessary to change:

    1.Pins GPIO42 and GPIO43 must support SCI_A. For this board, we expect that pins GPIO42 (TX) and GPIO43 (RX) have been configured for SCI_A communication (TX and RX, respectively). Can you please confirm that this is the case?

    2. The oscillator frequency must match the LaunchPad's external oscillator frequency. While the F28379D has an internal crystal that oscillates at 20MHz, the LaunchPad also has an external oscillator that runs at 10MHz. Simulink's default value is 20MHz. This setting is appropriate when working with the F28379D alone. However, this frequency value can cause problems when using external mode on a LaunchPad. Please go to Hardware Implementation -> Device details -> Clocking and change the value of "Oscillator clock (OSCCLK) frequency in MHz" from 20 to 10.

    _______________________________________________________________________________________________________________________

    Working external mode example project in Matlab/Simulink.

    Type in the following command in the Matlab command window:

    >> c28x_serial_ext

    and set the  hardware configurations in Simulink:

    1. Choose Hardware Board: TI Delfino F2837xD and set the Build options as below

    2. Clocking configuration

    3. Set SCI_A GPIO ports according to the TMS320F2837xD Dual-Core Delfino Microcontrollers Technical Reference Manual (sec. 7.7)

    4. Register: External mode (according to the used COM port in the device manager from the XDS100 USB Serial Port)

    Also, the baudrates have to be set to the same value.

    Everything should work now.

    Enjoy!