MATLAB Answers

0

Problem with creating Protected Model - "### Failed to generate all binary outputs."

Asked by Magnus Axelson-fisk on 28 Aug 2019
Latest activity Answered by Urmila Rajpurohith on 13 Sep 2019
I'm having a problem with creating a protected model in simulink. I have created a model to upload to arduino using simulink, it depends on both Simulink arduino support package and RASPlib (https://se.mathworks.com/matlabcentral/fileexchange/62702-rensselaer-arduino-support-package-library-rasplib).
I am able to build and upload the model to a arduino uno without any problems, but when I try to export this model to a protected model I get the following errors
"C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/gcc" -c -pedantic -Wno-long-long -fwrapv -O0 -DSLMSG_ALLOW_SYSTEM_ALLOC -D_RTT_USE_SERIAL0_ -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMATLAB_MEX_FILE -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DSLMSG_ALLOW_SYSTEM_ALLOC -DMATLAB_MEX_FILE -DTID01EQ=1 -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3 -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/blocks/sfcn/include -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/positionProcessPIDSerial -IC:/Users/Lenovo/Dropbox/Jobb_UU/Control_Lab -IC:/PROGRA~1/MATLAB/R2017a/extern/include -IC:/PROGRA~1/MATLAB/R2017a/simulink/include -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/ert -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/_sharedutils -o "positionProcessPIDSerial.obj" "positionProcessPIDSerial.c"
"C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/gcc" -c -pedantic -Wno-long-long -fwrapv -O0 -DSLMSG_ALLOW_SYSTEM_ALLOC -D_RTT_USE_SERIAL0_ -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMATLAB_MEX_FILE -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DSLMSG_ALLOW_SYSTEM_ALLOC -DMATLAB_MEX_FILE -DTID01EQ=1 -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3 -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/blocks/sfcn/include -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/positionProcessPIDSerial -IC:/Users/Lenovo/Dropbox/Jobb_UU/Control_Lab -IC:/PROGRA~1/MATLAB/R2017a/extern/include -IC:/PROGRA~1/MATLAB/R2017a/simulink/include -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/ert -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/_sharedutils -o "positionProcessPIDSerial_capi.obj" "positionProcessPIDSerial_capi.c"
"C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/gcc" -c -pedantic -Wno-long-long -fwrapv -O0 -DSLMSG_ALLOW_SYSTEM_ALLOC -D_RTT_USE_SERIAL0_ -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMATLAB_MEX_FILE -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DSLMSG_ALLOW_SYSTEM_ALLOC -DMATLAB_MEX_FILE -DTID01EQ=1 -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3 -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/blocks/sfcn/include -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/positionProcessPIDSerial -IC:/Users/Lenovo/Dropbox/Jobb_UU/Control_Lab -IC:/PROGRA~1/MATLAB/R2017a/extern/include -IC:/PROGRA~1/MATLAB/R2017a/simulink/include -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/ert -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/_sharedutils -o "../../../slprj/sim/_sharedutils/rtGetInf.obj" "../../../slprj/sim/_sharedutils/rtGetInf.c"
"C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/gcc" -c -pedantic -Wno-long-long -fwrapv -O0 -DSLMSG_ALLOW_SYSTEM_ALLOC -D_RTT_USE_SERIAL0_ -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMATLAB_MEX_FILE -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DSLMSG_ALLOW_SYSTEM_ALLOC -DMATLAB_MEX_FILE -DTID01EQ=1 -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3 -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/blocks/sfcn/include -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/positionProcessPIDSerial -IC:/Users/Lenovo/Dropbox/Jobb_UU/Control_Lab -IC:/PROGRA~1/MATLAB/R2017a/extern/include -IC:/PROGRA~1/MATLAB/R2017a/simulink/include -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/ert -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/_sharedutils -o "../../../slprj/sim/_sharedutils/rtGetNaN.obj" "../../../slprj/sim/_sharedutils/rtGetNaN.c"
"C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/gcc" -c -pedantic -Wno-long-long -fwrapv -O0 -DSLMSG_ALLOW_SYSTEM_ALLOC -D_RTT_USE_SERIAL0_ -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMATLAB_MEX_FILE -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DSLMSG_ALLOW_SYSTEM_ALLOC -DMATLAB_MEX_FILE -DTID01EQ=1 -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3 -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/blocks/sfcn/include -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/positionProcessPIDSerial -IC:/Users/Lenovo/Dropbox/Jobb_UU/Control_Lab -IC:/PROGRA~1/MATLAB/R2017a/extern/include -IC:/PROGRA~1/MATLAB/R2017a/simulink/include -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/ert -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/_sharedutils -o "../../../slprj/sim/_sharedutils/rt_nonfinite.obj" "../../../slprj/sim/_sharedutils/rt_nonfinite.c"
"### Creating shared utilities library "../../../slprj/sim/_sharedutils/rtwshared.lib" ..."
"C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/ar" ruvs ../../../slprj/sim/_sharedutils/rtwshared.lib ../../../slprj/sim/_sharedutils/rtGetInf.obj ../../../slprj/sim/_sharedutils/rtGetNaN.obj ../../../slprj/sim/_sharedutils/rt_nonfinite.obj
a - ../../../slprj/sim/_sharedutils/rtGetInf.obj
a - ../../../slprj/sim/_sharedutils/rtGetNaN.obj
a - ../../../slprj/sim/_sharedutils/rt_nonfinite.obj
C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/ar: creating ../../../slprj/sim/_sharedutils/rtwshared.lib
"### Created: ../../../slprj/sim/_sharedutils/rtwshared.lib"
Could Not Find C:\Users\Lenovo\AppData\Local\Temp\tp90c5a2a6_1533_4434_a3e6_af7e393070e3\slprj\sim\positionProcessPIDSerial\-f
C:/PROGRA~1/MATLAB/R2017a/sys/perl/win32/bin/perl.exe C:/PROGRA~1/MATLAB/R2017a/rtw/c/tools/mkvc_lnk.pl positionProcessPIDSerial.lnk positionProcessPIDSerial.obj positionProcessPIDSerial_capi.obj
"C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/ar" ruvs positionProcessPIDSeriallib.lib @positionProcessPIDSerial.lnk
a - positionProcessPIDSerial.obj
a - positionProcessPIDSerial_capi.obj
C:\PROGRA~3\MATLAB\SUPPOR~1\R2017a\3P778C~1.INS\MINGW_~1.INS\bin/ar: creating positionProcessPIDSeriallib.lib
"### Creating MEX function "../../../positionProcessPIDSerial_msp.mexw64" ..."
"C:/PROGRA~1/MATLAB/R2017a/bin/mex" -f "C:/PROGRA~1/MATLAB/R2017a/bin/win64/mexopts/mingw64.xml" -MATLAB_ARCH=win64 -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3 -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinobase/blocks/sfcn/include -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/positionProcessPIDSerial -IC:/Users/Lenovo/Dropbox/Jobb_UU/Control_Lab -IC:/PROGRA~1/MATLAB/R2017a/extern/include -IC:/PROGRA~1/MATLAB/R2017a/simulink/include -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2017a/rtw/c/ert -IC:/Users/Lenovo/AppData/Local/Temp/tp90c5a2a6_1533_4434_a3e6_af7e393070e3/slprj/sim/_sharedutils COPTIMFLAGS="-pedantic -Wno-long-long -fwrapv -O0 -DSLMSG_ALLOW_SYSTEM_ALLOC -D_RTT_USE_SERIAL0_ -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMATLAB_MEX_FILE -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DTERMFCN=1 -DONESTEPFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DSLMSG_ALLOW_SYSTEM_ALLOC -DMATLAB_MEX_FILE -DTID01EQ=1 -DNDEBUG -DMODEL=positionProcessPIDSerial -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMDL_REF_SIM_TGT=1" -silent -outdir ../../.. positionProcessPIDSerial_msp.c positionProcessPIDSeriallib.lib ../../../slprj/sim/_sharedutils/rtwshared.lib -LC:/PROGRA~1/MATLAB/R2017a/bin/win64 -LC:/PROGRA~1/MATLAB/R2017a/extern/lib/win64/mingw64 -llibfixedpoint -llibmwmathutil -llibmwipp -llibmwsl_AsyncioQueue -lsf_runtime -llibmwcoder_ToAsyncQueueTgtAppSvc -llibmwsl_simtarget_instrumentation -llibmwsl_simtarget_core -llibmwslio_core -llibmwslio_clients
C:\Users\Lenovo\AppData\Local\Temp\tp90c5a2a6_1533_4434_a3e6_af7e393070e3\slprj\sim\positionProcessPIDSerial\positionProcessPIDSerial_msp.c: In function 'mdlInitializeSizes':
C:\Users\Lenovo\AppData\Local\Temp\tp90c5a2a6_1533_4434_a3e6_af7e393070e3\slprj\sim\positionProcessPIDSerial\positionProcessPIDSerial_msp.c:89:1: warning: string length '660' is greater than the length '509' ISO C90 compilers are required to support [-Woverlength-strings]
ssSetAcceptsFcnCallInputs ( S ) ; ssSetModelReferenceNormalModeSupport ( S ,
^
positionProcessPIDSeriallib.lib(positionProcessPIDSerial.obj):positionProcessPIDSerial.c:(.text+0x72b): undefined reference to `writeDigitalPin'
positionProcessPIDSeriallib.lib(positionProcessPIDSerial.obj):positionProcessPIDSerial.c:(.text+0x7e3): undefined reference to `writeDigitalPin'
positionProcessPIDSeriallib.lib(positionProcessPIDSerial.obj):positionProcessPIDSerial.c:(.text+0x85b): undefined reference to `writeDigitalPin'
collect2.exe: error: ld returned 1 exit status
gmake: *** [../../../positionProcessPIDSerial_msp.mexw64] Error -1
The make command returned an error of 2
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.
### Build procedure for model: 'positionProcessPIDSerial' aborted due to an error.
Error(s) encountered while building "positionProcessPIDSerial":
### Failed to generate all binary outputs.
I have removed all spaces in folder names but that did not help.
Also when I go to the temporary folder all I can find is a mex-file.
If anyone can help I'ld be very thankful!

  0 Comments

Sign in to comment.

1 Answer

Answer by Urmila Rajpurohith on 13 Sep 2019

Assuming that there is a problem while creating Protected model, you can follow the below documentation for how to create protected models.
There are multiple things which can abort the building procedure for the model.
you can have look at similar question

  0 Comments

Sign in to comment.