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:
Verify that your Arduino hardware is powered on and connected to your host computer.
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®:
In the Windows Start menu, select Devices and Printers.
If you find an Unknown Device under Other Devices or COM Ports, double click the Unknown Device.
In the Unknown Device Properties dialog box that opens, click the Hardware tab, and click Properties.
In the Unknown device Properties dialog box that opens, click Update Driver.
In the Update Driver Software - Unknown Device dialog box that opens, click Browse my computer for driver software.
Select the Include subfolders check box and click Browse.
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\
. For example:releasenumber
C:\ProgramData\MATLAB\SupportPackages\R2017b
.If prompted by Windows Security, choose Install this driver software anyway, and let Windows complete the process of installing the driver.
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:
Download and install the driver that matches your Apple Mac OS X or Linux hardware.
Update the COM port number.
Try running the model on the target hardware again.