Arduino error: Cannot Using Arduino

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

Walter Roberson
Walter Roberson 2025년 7월 11일
I notice that the arduino is configured to use 1.8.18 but that the support package is 1.6.12 .
There is potentially an incompatibility between those versions. You might need to configure your Due to 1.6.12 .
Trang
Trang 2025년 7월 12일
I'm new to arduino, so do I have to re-install it ?
Walter Roberson
Walter Roberson 2025년 7월 12일
Trang
Trang 2025년 7월 13일
I still receive the same error. When I came back to add on package and updated the server, this is what I received.
Dhruv
Dhruv 2025년 7월 15일
Could you please expand the complete error message that you're encountering while doing Hardware Setup?
Trang
Trang 2025년 7월 16일
I could not expand the messege. The box doesn't let me resize it. When I plug the Arduino in, MATLAB detects it, but I'm not sure why it does not connect Arduino. I think the red error below after I run is similar to the one above. arduino('COM3','Due','TraceOn',true) is similar to the one above.

댓글을 달려면 로그인하십시오.

답변 (1개)

Harsh
Harsh 2025년 7월 21일
편집: Harsh 2025년 7월 21일

0 개 추천

Hi @Trang,
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.

댓글 수: 2

Trang
Trang 2025년 7월 21일
I used the Programing Port one and also got the error. I also switched between 2 ports to see if it worked, but there was no luck. My Windows Device Manager shows that it is COM3.
Harsh
Harsh 2025년 7월 22일
Hi @Trang, I would recommend you to contact MathWorks Technical Support. Feel free to use the following link to create a ticket,

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Arduino Hardware에 대해 자세히 알아보기

태그

질문:

2025년 7월 11일

댓글:

2025년 7월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by