Main Content

Troubleshoot Running Models on Arduino Hardware

“Could not automatically set host COM port”

If you try to run a model on your Arduino® hardware and Simulink® generates an error message similar to this one: “The call to realtime_make_rtw_hook, during the entry hook generated the following error: Could not automatically set host COM port for your Arduino hardware. This may be due to a disconnected or unrecognized board. If the board is not connected to your host computer, connect it and let the operating system install the board driver.”

Resolve Connection Issues

To resolve connection issues:

  1. Verify that your Arduino hardware is powered on and connected to your host computer.

  2. Try running the model again on your Arduino hardware.

Resolve Driver Issues

If you get the error message while your board is powered on and connected to your host computer, resolve any issues with Arduino drivers in Windows®:

  1. In the Windows Start menu, select Devices and Printers.

  2. If you find an Unknown Device under Other Devices or COM Ports, double click the Unknown Device.

  3. In the Unknown Device Properties dialog box that opens, click the Hardware tab, and click Properties.

  4. In the Unknown device Properties dialog box that opens, click Update Driver.

  5. In the Update Driver Software - Unknown Device dialog box that opens, click Browse my computer for driver software.

  6. Select the Include subfolders check box and click Browse.

  7. Navigate to the Installation folder that Support Package Installer used when you installed support for your Arduino hardware, and then click Next. By default, this folder location is C:\ProgramData\MATLAB\SupportPackages\releasenumber. For example: C:\ProgramData\MATLAB\SupportPackages\R2017b.

  8. If prompted by Windows Security, choose Install this driver software anyway, and let Windows complete the process of installing the driver.

  9. Try running the model again on your Arduino hardware.

If you get the error message after resolving issues with Arduino drivers, set the host COM port and baud rate manually. The drivers for some Arduino board revisions do not identify the board as an Arduino device in Windows. In that case, set the COM port number and Serial 0 baud rate manually, as described in Configure Host and Bootloader COM Port Manually.

“Invalid port name. COM port must start with”

Some Apple Mac OS X and Linux® platforms require you to install a driver before you can connect to Arduino hardware.

Suppose you cannot download and run a model on the Arduino hardware because the COM port is not set correctly, and trying to change the COM port number produces an error message such as:

Invalid port name. COM port must start with '/dev/cu.usb' like /dev/cu.usbmodemfa131 on MAC OS X

or

Invalid port name. COM port must start with '/dev/ttyACM' like /dev/ttyACM0 on Linux platform.

To resolve this issue:

  1. Visit https://ftdichip.com/drivers/vcp-drivers/.

  2. Download and install the driver that matches your Apple Mac OS X or Linux hardware.

  3. Update the COM port number.

  4. Try running the model on the target hardware again.