MATLAB Answers

Arduino Engineering Kit : Unable to run the model in external mode

1 view (last 30 days)
I am able to successfully run the dc motor characterization tutorial using MATLAB 2019a . But not able to run the Simulink tutorial(Chapter 2.3 Simulink getting started ) given : https://aek.arduino.cc/chapter/getting-started
Getting the following error in the diagnostic viewer:
C:/ProgramData/MATLAB/SupportPackages/R2019a/3P.instrset/arduinoide.instrset/idepkgs/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -std=gnu++11 -fno-threadsafe-statics -fno-rtti -fno-exceptions -Os -c -g -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -DARDUINO=10801 -MMD -MP -MF"MW_PWM.dep" -MT"MW_PWM.o" -MMD -mcpu=cortex-m0plus -fpermissive -DF_CPU=48000000L -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x824e -DUSBCON -DUSB_MANUFACTURER=\""Unknown\"" -DUSB_PRODUCT=\""Genuino MKR1000\"" -D_RUNONTARGETHARDWARE_BUILD_ -D_ROTH_MKR1000_ -DMODEL=myDCMotorControl -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DON_TARGET_WAIT_FOR_START=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DEXT_MODE=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DXCP_CUSTOM_PLATFORM -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DMW_TIMERID=9 -DMW_PRESCALAR=256 -DMW_TIMERCOUNT=18750 -DMW_SCHEDULERCOUNTER=1 -D_RTT_BAUDRATE_SERIAL0_=9600 -D_RTT_BAUDRATE_SERIAL1_=9600 -D_RTT_ANALOG_REF_=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DEXT_MODE=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=1 -DXCP_CUSTOM_PLATFORM -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -DRT -DMODEL=myDCMotorControl -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/xxxx/AppData/Roaming/MathWorks/MATLAB Add-Ons/Toolboxes/Arduino_Engineering_Kit_Project_Files/work -IC:/PROGRA~3/MATLAB/SupportPackages/R2019a/toolbox/target/shared/svd/include -IC:/Users/xxxx/AppData/Roaming/MathWorks/MATLAB Add-Ons/Toolboxes/Arduino_Engineering_Kit_Project_Files/work/myDCMotorControl_ert_rtw -IC:/PROGRA~1/MATLAB/R2019a/extern/include -IC:/PROGRA~1/MATLAB/R2019a/simulink/include -IC:/PROGRA~1/MATLAB/R2019a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2019a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2019a/rtw/c/ert -IC:/PROGRA~1/MATLAB/R2019a/toolbox/coder/rtiostream/src -IC:/PROGRA~1/MATLAB/R2019a/toolbox/coder/rtiostream/src/utils -IC:/ProgramData/MATLAB/SupportPackages/R2019a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include -IC:/ProgramData/MATLAB/SupportPackages/R2019a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL -IC:/ProgramData/MATLAB/SupportPackages/R2019a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.6.20/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2019a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.6.20/variants/mkr1000 -IC:/PROGRA~3/MATLAB/SupportPackages/R2019a/toolbox/target/supportpackages/arduinotarget/include -IC:/PROGRA~3/MATLAB/SupportPackages/R2019a/toolbox/target/supportpackages/arduinotarget/scheduler/include -IC:/PROGRA~3/MATLAB/SupportPackages/R2019a/toolbox/target/supportpackages/armcortexmbase/scheduler/include -IC:/PROGRA~3/MATLAB/SupportPackages/R2019a/toolbox/target/supportpackages/arduinobase/include -IC:/PROGRA~3/MATLAB/SupportPackages/R2019a/toolbox/target/shared/externalmode_daemon/include -IC:/PROGRA~3/MATLAB/SupportPackages/R2019a/toolbox/target/supportpackages/armcortexmbase/xcp/include -o MW_PWM.o C:/ProgramData/MATLAB/SupportPackages/R2019a/toolbox/target/supportpackages/arduinobase/src/MW_PWM.cpp
arm-none-eabi-g++: error: Add-Ons/Toolboxes/Arduino_Engineering_Kit_Project_Files/work: No such file or directory
arm-none-eabi-g++: error: Add-Ons/Toolboxes/Arduino_Engineering_Kit_Project_Files/work/myDCMotorControl_ert_rtw: No such file or directory
gmake: *** [MW_PWM.o] Error 1
The make command returned an error of 2
### Build procedure for model: 'myDCMotorControl' aborted due to an error.
The motor runs on the sinusoidal signal in the normal mode but I was unable to read from the encoder in external mode. I expect that the model should not work in normal mode.
Any suggestions?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Nov 2020
The error occurs due to a space present in the path of the project Folder:
C:/Users/xxxx/AppData/Roaming/MathWorks/MATLAB Add-Ons/Toolboxes/Arduino_Engineering_Kit_Project_Files/work/myDCMotorControl_ert_rtw
Usually Windows is able to resolve the spacing issue using the "8dot3" File Name Creation feature. However sometimes this feature may get disabled by some programs. Turning this feature on will hopefully resolve the issue.
Steps to turn the feature on:
1. Open Command Prompt (Admin mode).
Alternatively, you can try remove the space between "MATLAB Add-Ons" and thus modify the project folder path and try building the model again.
Alternate workaround:
If the above steps did not work, then it is possible that the short name for the working directory was never created, even though the "8 dot 3" feature is enabled. Reason could be that this feature was enabled after the long name folder path was created. To confirm this, try the following:
1. Open Windows Command Prompt in admin mode
2.  Traverse to MathWorks folder:
>> cd C:/Users/xxxx/AppData/Roaming/MathWorks
3. Then run the following :
>> dir /x
4. This will list all the folder within the directory along with the short names (If they exist). If the short name exists for "MATLAB Add-Ons", it will have the short name listed with something like this "MATLAB~1".
5. Most likely there won't be any short name. In this case please execute the following command to create one: 
fsutil file setshortname "C:/Users/xxxx/AppData/Roaming/MathWorks/MATLAB Add-Ons" MATLAB~8
Now re-build the model. This should hopefully resolve the issue.

More Answers (0)

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!