Installing MKRMotorCarrier and Arduino Libraries - failed Matlab Arduino package

6 views (last 30 days)
Hi team,
I have recently got the Arduino Engineering kit and trying to get a drawing robot going. I managed to get the Arduino MKR1000 running with the Motor Carrier library in the Arduino software itself.
I tried to get the Matlab Arduino package after the main install of the software, and I get an error (log attached below).
Then I tried to run a = arduino; but the second error shows the board on the right COM port, but then gives out some other error.
Help Appreciated. Kind regards
pic2.PNG
Jan 01, 2019 9:56:20 AM com.mathworks.hwservices.logging
INFO: Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\arduino-builder -dump-prefs -logger=machine -hardware C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\hardware -hardware C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages -tools C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\tools-builder -tools C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\hardware\tools\avr -tools C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages -built-in-libraries C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\libraries -libraries C:\Users\prav.DESKTOP-1QH1UND\Documents\Arduino\libraries -fqbn=arduino:samd:mkr1000 -vid-pid=0X2341_0X804E -ide-version=10801 -build-path C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\MW -warnings=null -prefs=build.path=C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\MW -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\bossac\1.7.0 -prefs=runtime.tools.openocd.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\openocd\0.9.0-arduino6-static -prefs=runtime.tools.CMSIS-Atmel.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\CMSIS-Atmel\1.1.0 -prefs=runtime.tools.CMSIS.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.arduinoOTA.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arduinoOTA\1.2.0 -verbose C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\ArduinoServer.ino
C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\arduino-builder -compile -logger=machine -hardware C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\hardware -hardware C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages -tools C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\tools-builder -tools C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\hardware\tools\avr -tools C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages -built-in-libraries C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\arduino-1.8.1\libraries -libraries C:\Users\prav.DESKTOP-1QH1UND\Documents\Arduino\libraries -fqbn=arduino:samd:mkr1000 -vid-pid=0X2341_0X804E -ide-version=10801 -build-path C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\MW -warnings=null -prefs=build.path=C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\MW -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\bossac\1.7.0 -prefs=runtime.tools.openocd.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\openocd\0.9.0-arduino6-static -prefs=runtime.tools.CMSIS-Atmel.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\CMSIS-Atmel\1.1.0 -prefs=runtime.tools.CMSIS.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.arduinoOTA.path=C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arduinoOTA\1.2.0 -verbose C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\ArduinoServer.ino
Using board 'mkr1000' from platform in folder: C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18
Using core 'arduino' from platform in folder: C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18
Detecting libraries used...
"C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON '-DUSB_MANUFACTURER="Arduino LLC"' '-DUSB_PRODUCT="Arduino MKR1000"' "-IC:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\CMSIS-Atmel\1.1.0/CMSIS/Device/ATMEL/" "-IC:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18\cores\arduino" "-IC:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18\variants\mkr1000" "C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\MW\sketch\ArduinoServer.ino.cpp" -o "nul"
"C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON '-DUSB_MANUFACTURER="Arduino LLC"' '-DUSB_PRODUCT="Arduino MKR1000"' "-IC:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\CMSIS-Atmel\1.1.0/CMSIS/Device/ATMEL/" "-IC:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18\cores\arduino" "-IC:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18\variants\mkr1000" "C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\MW\sketch\ArduinoServer.ino.cpp" -o "C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\MW\preproc\ctags_target_for_gcc_minus_e.cpp"
In file included from c:\programdata\matlab\supportpackages\r2018b_1\3p.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\cstddef:41:0,
from C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18\cores\arduino/Uart.h:25,
from C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18\variants\mkr1000/variant.h:161,
from C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18\cores\arduino/delay.h:23,
from C:\ProgramData\MATLAB\SupportPackages\R2018b_1\3P.instrset\arduinoide.instrset\idepkgs\packages\arduino\hardware\samd\1.6.18\cores\arduino/Arduino.h:81,
from C:\Users\prav.DESKTOP-1QH1UND\AppData\Local\Temp\ArduinoServer\MW\sketch\ArduinoServer.ino.cpp:1:
c:\programdata\matlab\supportpackages\r2018b_1\3p.instrset\arduinoide.instrset\idepkgs\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\arm-none-eabi\armv6-m\bits\c++config.h:429:30: fatal error: bits/cpu_defines.h: No such file or directory
#include <bits/cpu_defines.h>
^
compilation terminated.
exit status 1
  3 Comments
Walter Roberson
Walter Roberson on 31 Dec 2018
I find references to that file but only in connection to the esp8266 . One solution for that context is described at https://github.com/esp8266/Arduino/issues/1631
pravin vaz
pravin vaz on 2 Jan 2019
That's right. This has replaced the other issue.
If I do 'listArduinoLibraries' the MKRMotorCarrier shows up, however, now
if I try ' a = arduino(); ' It just says updating server code on board MKR1000 ....
and then 'Cannot program board MKR1000(COM6), Please make sure the board is supported and the port and board type are correct. For more information,
see Arduino Hardware Troubleshooting.

Sign in to comment.

Answers (3)

Madhu Govindarajan
Madhu Govindarajan on 2 Jan 2019
Attempt reinstalling the MATLAB and Simulink Support Package for Arduino with MATLAB opened as administrator. You can right click on MATLAB icon and select this option in windows machines. If this does not resolve the issue, uninstall any other Arduino IDEs that you might have and attempt to download the support packages again.
  4 Comments
pravin vaz
pravin vaz on 7 Jan 2019
Hi Madhu,
I realised that windows had created a new profile for me after I used a registry cleaner which wiped out some important files. Since then, all my installs are still going in my original profile but I have been logged into the new profile. C:\Users\prav.DESKTOP-1QH1UND
So my profile usually just says prav, but as above its changed since I used the cleaner.
I am currently using Matlab r2018a on my Macbook and it works absolutely fine. I will most likely wipe clean my windows and do a clean install before trying again.
THanks so much for your help.
Madhu Govindarajan
Madhu Govindarajan on 8 Jan 2019
Glad you now know how to fix the issues and have an alternate way of moving forward.
Madhu

Sign in to comment.


Jose Anaya
Jose Anaya on 21 Jun 2019
Hello,
can anyone help me with this, I have a similar problem but with matlab version 2019a. I have done everything in mention in here and in other pages on how to figure it fix but no luck. I have follow and repeated the steps mention in the Arduino Engineering Kit very closely and still no luck. When trying to load the MKRMotorCarrier.h to the MKR1000 I get the following error message:
C:\Users\jmanu\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\Arduino_Engineering_Kit_Hardware_Support_19a(2)\matlab\MATLABAddon\+arduinoioaddons\+arduino\src\MKRMotorCarrierBase.h:11:29: fatal error: MKRMotorCarrier.h: No such file or directory
  2 Comments
Madhu Govindarajan
Madhu Govindarajan on 21 Jun 2019
Two thoughts that come to my mind:
1) The downloaded hardware support toolbox is getting overwritten several times (hence the (2) in your path). I would recommend doing a clean reinstall, meaning uninstall, delete all the related folders then reinstall.
2) Ensure that the instructions below which are on the file exchange submission as well, are followed correctly. Copy pasted below -
-----------------------------------------------------------------------------------------
1) After installing this toolbox, type the following command in MATLAB to open the ReadMe
>> edit ArduinoKitHardwareSupportReadMe.txt
2) Be sure to follow the steps in this file, as it provides instructions on downloading the Arduino library for the MKR Motor Carrier. This library is required for some of the functionality to work.
-----------------------------------------------------------------------------------------
Dexter Smith
Dexter Smith on 5 Jan 2020
Hi,
This was frustrating to me also. The Arduino 2560 worked great, the MKR motor carrier had this problem.
The readme.txt file helps but did not match my windows 10 setup at all. The key is
5) Move the MKRMotorCarrier folder into the "libraries" folder inside your Arduino sketchbook folder On Windows, the default path is "arduinoio.IDERoot\portable\sketchbook\libraries\" Note: arduinoio.IDERoot is a MATLAB command.
Use this MATLAB command to find where the libraries are.
arduinoio.IDERoot ans = 'C:\ProgramData\MATLAB\SupportPackages\R2019b\3P.instrset\arduinoide.instrset'
Following the readme.txt file beginning I then moved the unzipped MKRMotorCarrier folder here and everything worked great - C:\ProgramData\MATLAB\SupportPackages\R2019b\3P.instrset\arduinoide.instrset\libraries\MKRMotorCarrier

Sign in to comment.


Nicola Cesari
Nicola Cesari on 3 Apr 2020
Hi
I'm a newbie in using arduino engineering kit. I have almost the same problem but I managed to setup the libraries, in fact if I assign an arduino project I obtain:
arduino with properties:
Port: 'COM6'
Board: 'MKR1000'
AvailablePins: {'D0-D14', 'A0-A6'}
AvailableDigitalPins: {'D0-D14', 'A0-A6'}
AvailablePWMPins: {'D0-D8', 'D10', 'A3-A4'}
AvailableAnalogPins: {'A0-A6'}
AvailableI2CBusIDs: [0]
AvailableSerialPortIDs: [1]
Libraries: {'I2C', 'MKRMotorCarrier', 'RotaryEncoder', 'SPI', 'Servo'}
Show all properties
But if I try to add-on library, this error appear, even if I have 'MKRMotorCarrier' in 'listArduinoLibraries':
carrier = addon(a, 'MKRMotorCarrier')
No add-on library uploaded to the board. Clear and recreate the current arduino object to include the appropriate library. For a list of available libraries, type 'listArduinoLibraries'.
Hope I managed to explain clearely
Thanks in advance

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!