Arduino Due error in Matlab

Hi
when I want to programming the arduino Due this error is showing:
>> arduino
Updating server code on board Due (COM10). Please wait (might take a few minutes).
Cannot program board Due (COM10). Please make sure the board is supported and the port and board type are correct. For more
information, see Arduino Hardware Troubleshooting.

 Risposta accettata

Madhu Govindarajan
Madhu Govindarajan il 14 Gen 2019

2 voti

Try the following and post any error messages that you get -
a = arduino('COM#','Due','TraceOn',true)
Remember the COM# should be the correct number of your Arduino Due. For instance - COM3, COM25 etc.

6 Commenti

john white
john white il 17 Gen 2019
ok thank you so much
I have written your code but it shows this error:
a = arduino('COM10','Due','TraceOn',true)
Updating server code on board Due (COM10). Please wait (might take a few minutes).
DPI detection failed, fallback to 96 dpi
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\arduino-builder -dump-prefs
-logger=machine -hardware
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\hardware -hardware
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages -tools
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\tools-builder -tools
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\hardware\tools\avr -tools
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages -built-in-libraries
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\libraries -libraries
C:\Users\leviusa90\Documents\Arduino\libraries -fqbn=arduino:sam:arduino_due_x_dbg -ide-version=10613 -build-path
C:\Users\LEVIUS~1\AppData\Local\Temp\ArduinoServer\MW -warnings=null
-prefs=build.path=C:\Users\LEVIUS~1\AppData\Local\Temp\ArduinoServer\MW -prefs=build.warn_data_percentage=75
-prefs=runtime.tools.bossac.path=C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\bossac\1.6.1-arduino
-prefs=runtime.tools.arm-none-eabi-gcc.path=C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1
-verbose C:\Users\leviusa90\AppData\Local\Temp\ArduinoServer\ArduinoServer.ino
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\arduino-builder -compile
-logger=machine -hardware
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\hardware -hardware
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages -tools
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\tools-builder -tools
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\hardware\tools\avr -tools
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages -built-in-libraries
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\arduino-1.6.13\libraries -libraries
C:\Users\leviusa90\Documents\Arduino\libraries -fqbn=arduino:sam:arduino_due_x_dbg -ide-version=10613 -build-path
C:\Users\LEVIUS~1\AppData\Local\Temp\ArduinoServer\MW -warnings=null
-prefs=build.path=C:\Users\LEVIUS~1\AppData\Local\Temp\ArduinoServer\MW -prefs=build.warn_data_percentage=75
-prefs=runtime.tools.bossac.path=C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\bossac\1.6.1-arduino
-prefs=runtime.tools.arm-none-eabi-gcc.path=C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1
-verbose C:\Users\leviusa90\AppData\Local\Temp\ArduinoServer\ArduinoServer.ino
Using board 'arduino_due_x_dbg' from platform in folder:
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7
Using core 'arduino' from platform in folder:
C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7
Detecting libraries used...
"C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++"
-c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param
max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb
-DF_CPU=84000000L -DARDUINO=10613 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341
-DUSB_PID=0x003e -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Due"'
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\system/libsam"
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\system/CMSIS/CMSIS/Include/"
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\system/CMSIS/Device/ATMEL/"
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\cores\arduino"
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\variants\arduino_due_x"
"C:\Users\LEVIUS~1\AppData\Local\Temp\ArduinoServer\MW\sketch\ArduinoServer.ino.cpp" -o "nul"
Generating function prototypes...
"C:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++"
-c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param
max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb
-DF_CPU=84000000L -DARDUINO=10613 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341
-DUSB_PID=0x003e -DUSBCON '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Due"'
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\system/libsam"
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\system/CMSIS/CMSIS/Include/"
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\system/CMSIS/Device/ATMEL/"
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\cores\arduino"
"-IC:\ProgramData\MATLAB\SupportPackages\R2017a\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\sam\1.6.7\variants\arduino_due_x"
"C:\Users\LEVIUS~1\AppData\Local\Temp\ArduinoServer\MW\sketch\ArduinoServer.ino.cpp" -o
"C:\Users\LEVIUS~1\AppData\Local\Temp\ArduinoServer\MW\preproc\ctags_target_for_gcc_minus_e.cpp"
exec:
"C:\\ProgramData\\MATLAB\\SupportPackages\\R2017a\\3P.instrset\\arduinoide.instrset\\idepkgs\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++":
file does not exist
Error compiling for board Arduino Due (Programming Port).
This looks like installation issue and something went wrong during download and install. Please try the following and if you still get the same error message reach out to MathWorks Technical support -
1) Uninstall MATLAB and SImulink Support package for Arduino.
2) Close MATLAB and reopen with administrator access. Right click on MATLAB icon and select Run as administrator.
3) Install MATLAB Support package for Arduino.
4) Try the command a = arduino('COM#','Due','TraceOn',true)
john white
john white il 17 Gen 2019
ok thank you so much for your answer and your spending time to answer me
madhan ravi
madhan ravi il 17 Gen 2019
Then accept his answer.
john white
john white il 17 Gen 2019
thanks for your notice , I have done

Accedi per commentare.

Più risposte (2)

madhan ravi
madhan ravi il 12 Gen 2019
Modificato: madhan ravi il 12 Gen 2019

1 voto

Make sure the proper board (Arduino Uno or mini for example) and the port are selected.

7 Commenti

john white
john white il 12 Gen 2019
thanks for your answer
I'm sure that both of the port and board are correct but I don't know why this error is showing!
madhan ravi
madhan ravi il 12 Gen 2019
Are you using mac ?
john white
john white il 12 Gen 2019
No, I'm using windows 7
madhan ravi
madhan ravi il 12 Gen 2019
Did you download arduino support package?
john white
john white il 12 Gen 2019
yes of course and I could program on the Uno board but, with the Due one I couldn't
madhan ravi
madhan ravi il 12 Gen 2019
Modificato: madhan ravi il 12 Gen 2019
Oh, I have experience with Uno and Mini but Due not , sorry
john white
john white il 12 Gen 2019
ok thank you so much

Accedi per commentare.

nguyen nhan tinh
nguyen nhan tinh il 25 Dic 2019
Modificato: nguyen nhan tinh il 26 Dic 2019
I have same this issue.
When i run cmd:
>> a = arduino('COM3','Due', 'TraceOn', true)
Updating server code on board Due (COM3). Please wait (might take a few minutes).
Loading configuration...
Initializing packages...
Preparing boards...
Error: sam: Unknown architecture
How to resolve it. I using Matlab 2017b with Win10 64bit
Thanks

3 Commenti

This means that the architecture necessary to program this board is missing. Try the following:
  1. Open Arduino IDE version supported by MATLAB. To open this IDE, type winopen(arduinoio.IDERoot) in MATLAB Command Window. Then open the Arduino Application in that folder.
  2. Go to Tools > Boards > Boards Manager.
  3. Search for ARduino Due here.
  4. The results should have Arduino SAM Boards. Check the version and install v 1.6.11 if not already done.
If this does not resolve your issue, contact MathWorks Technical Support.
Matlab worked.
Thanks for your support.
Thanks, Madhu Govindarajan .

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by