Arduino error: Cannot Using Arduino
7 views (last 30 days)
Show older comments
Hello,
When I put on arduino() to check the connection, this error showed up. I checked the Boards Manager and Port was showed as COM3. Add On package for Arduino hardward was added on MATLAB. I'm not sure what is missing. How do I fix this?

6 Comments
Answers (1)
Harsh
on 21 Jul 2025
Edited: Harsh
on 21 Jul 2025
From what I understand, you are using MATLAB to connect to an Arduino Due using the "arduino()" command. When this command is executed, MATLAB attempts to upload its server code to the board, but in your case, this process is failing.
The Arduino Due has two USB ports:
- Programming Port (labeled "Programming")
- Native Port (labeled "Native USB")
Please note that MATLAB only supports the Programming Port for uploading the server code.

Could you please confirm whether you are using the Programming Port on your Arduino Due (refer to the above image)? You can check this in Windows Device Manager, the Programming Port usually appears as "Arduino Due Programming Port (COMx)".
Also, make sure you are specifying the correct COM port in your MATLAB command (the same one shown in Windows Device Manager).
For additional reference, you may find the following thread helpful. Although it discusses the Arduino Uno, some of the workarounds mentioned there might also apply to your situation:
I hope this helps, thanks!
Edit: I just noticed in the screenshot, the Board Manager is showing that you are using the Native Port, change it Programming Port and try again.
See Also
Categories
Find more on Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!