Com Port Error in Matlab Simulink RoTH function with Arduino Due

8 views (last 30 days)
I am using Matlab Simulink's Run on Target/Board function and trying to work with Arduino Due. However, 99% of the time, building stops because "Failed to connect to Arduino board.", and suggests to check the COM port and try again. I am sure I have selected the correct com port and device, and it is not a connection problem. I have also tried running the same program on an Arduino Uno and it works just fine. The main problem is with Arduino Due. Sometimes, the build would proceed correctly and I could use the device for a certain amount of time before getting the same error again. I have even bought a new Due and a new data cable in case the old one was faulty but the same Com Port error exists.

Answers (1)

Manikanta Aditya
Manikanta Aditya on 17 Mar 2023
Hi Chit,
As per my understanding, you are getting ‘COM Port’ error when you are using Arduino Due board with Run on target/Board function in Simulink.
Arduino drivers are not the same for all Arduino boards. The drivers required for an Arduino board depend on the type of microcontroller that is used on the board and the operating system of the computer that is being used to program the board. To resolve this issue, you need to install Hardware driver for Arduino Due and then retry the connecting the COM Port of Arduino Due to Run on target/Board Function in Simulink.
For more details on installing support package and drivers for Arduino Due, please go through this link:
I hope this resolves the issue you are facing.

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!