Dear friend
I am developing a target specific to the stm32f429disc1 card, I am following the steps described in the pages "Implement a Target for arm cortex M of the help mathworks page". I'm stuck in step 5 "Activate the Application Deployment Feature"
I wrote the following code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% close all
% clear all
%deleteTarget(tgt);
%% create target
tgt = createTarget('My ARM','ARM Cortex-M','c:/myhardcard')
% saveTarget(tgt);
% testTarget(tgt,'framework');
%% create hardware STM32F429-Dicovery
hw = createHardware ( 'STM32F429-Dicovery' );
hw.DeviceID = 'ARM Cortex-M4F' ;
map(tgt,hw,'STM32F429-Dicovery');
show(tgt);
io = addNewSerialInterface(hw,'My interface')
%saveTarget(tgt);
% testTarget(tgt,'hardware');
%%
dep = addNewDeployer(tgt,'My New Deployer');
show(tgt);
map(tgt,hw,dep);
show(tgt);
toolchain = dep.addNewToolchain('GNU Tools for ARM Embedded Processors');
buildConfiguration = toolchain.addNewBuildConfiguration('My Build Configuration');
buildConfiguration.IncludePaths ='$(ARM_CORTEX_M_ROOT_DIR)/include';
buildConfiguration.CompilerFlags = '-mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork ';
buildConfiguration.LinkerFlags = '-mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork -T STM32F429xI.ld'
buildConfiguration.AssemblerFlags = '-mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork '
buildConfiguration.Defines = {'ARM_MATH_CM4=1', 'NULL=0', 'EXIT_FAILURE=1'}
dep.Tokens{1} = struct('Name', 'ARM_CORTEX_M_ROOT_DIR', 'Value', 'codertarget.arm_cortex_m.internal.getSpPkgRootDir');
loader = dep.addNewLoader('My Loader');
loader.LoadCommand = 'matlab:codertarget.arm_cortex_m.internal.loadAndRun';
loader.LoadCommandArguments ='-f board/stm32f429disc1.cfg';
saveTarget(tgt);
testTarget(tgt,'deployer');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
and the error message is as follows
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
val =
'Running matlabshared.targetsdk.verify.Deployer
### Starting build procedure for model: modelBasicBuild
### Generating code and artifacts to 'Model specific' folder structure
### Generating code into build folder: C:\Users\ramzi\AppData\Local\Temp\tp99fb16ab_b020_4469_99d7_51462ecc07b1\modelBasicBuild_ert_rtw
### Invoking Target Language Compiler on modelBasicBuild.rtw
### Using System Target File: C:\Program Files\MATLAB\R2018b\rtw\c\ert\ert.tlc
### Loading TLC function libraries
......
### Initial pass through model to cache user defined code
### Caching model source code
.........................
### Writing header file modelBasicBuild_types.h
### Writing header file modelBasicBuild.h
.
### Writing header file rtwtypes.h
### Writing source file modelBasicBuild.c
### Writing header file modelBasicBuild_private.h
### Writing source file modelBasicBuild_data.c
### Writing header file rtmodel.h
.
### Writing source file ert_main.c
### TLC code generation complete.
### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: GNU Tools for ARM Embedded Processors v7.2.1 | gmake (64-bit Windows)
### Creating 'C:\Users\ramzi\AppData\Local\Temp\tp99fb16ab_b020_4469_99d7_51462ecc07b1\modelBasicBuild_ert_rtw\modelBasicBuild.mk' ...
### Building 'modelBasicBuild': "C:\PROGRA~1\MATLAB\R2018b\bin\win64\gmake" -f modelBasicBuild.mk all
MW_GNU_ARM_TOOLS_PATH = C:/PROGRA~3/MATLAB/SUPPOR~1/R2018b/3P778C~1.INS/GNUARM~1.INS/win/bin
C:\Users\ramzi\AppData\Local\Temp\tp99fb16ab_b020_4469_99d7_51462ecc07b1\modelBasicBuild_ert_rtw>cd .
C:\Users\ramzi\AppData\Local\Temp\tp99fb16ab_b020_4469_99d7_51462ecc07b1\modelBasicBuild_ert_rtw>if "" == "" ("C:\PROGRA~1\MATLAB\R2018b\bin\win64\gmake" -f modelBasicBuild.mk all ) else ("C:\PROGRA~1\MATLAB\R2018b\bin\win64\gmake" -f modelBasicBuild.mk )
C:/PROGRA~3/MATLAB/SUPPOR~1/R2018b/3P778C~1.INS/GNUARM~1.INS/win/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -MMD -MP -MF"modelBasicBuild.dep" -MT"modelBasicBuild.o" -c -O0 -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork -DMODEL=modelBasicBuild -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DARM_MATH_CM4=1 -DNULL=0 -DEXIT_FAILURE=1 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=0 -DARM_MATH_CM4=1 -DNULL=0 -DEXIT_FAILURE=1 -DSTACK_SIZE=64 -DRT -DMODEL=modelBasicBuild -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1 -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1/modelBasicBuild_ert_rtw -IC:/PROGRA~1/MATLAB/R2018b/extern/include -IC:/PROGRA~1/MATLAB/R2018b/simulink/include -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/src -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/ert -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1/slprj/ert/_sharedutils -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2018b/toolbox/target/SUPPOR~1/ARM_CO~1/include @modelBasicBuild_comp.rsp -o modelBasicBuild.o modelBasicBuild.c
C:/PROGRA~3/MATLAB/SUPPOR~1/R2018b/3P778C~1.INS/GNUARM~1.INS/win/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -MMD -MP -MF"modelBasicBuild_data.dep" -MT"modelBasicBuild_data.o" -c -O0 -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork -DMODEL=modelBasicBuild -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DARM_MATH_CM4=1 -DNULL=0 -DEXIT_FAILURE=1 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=0 -DARM_MATH_CM4=1 -DNULL=0 -DEXIT_FAILURE=1 -DSTACK_SIZE=64 -DRT -DMODEL=modelBasicBuild -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1 -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1/modelBasicBuild_ert_rtw -IC:/PROGRA~1/MATLAB/R2018b/extern/include -IC:/PROGRA~1/MATLAB/R2018b/simulink/include -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/src -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/ert -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1/slprj/ert/_sharedutils -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2018b/toolbox/target/SUPPOR~1/ARM_CO~1/include @modelBasicBuild_comp.rsp -o modelBasicBuild_data.o modelBasicBuild_data.c
C:/PROGRA~3/MATLAB/SUPPOR~1/R2018b/3P778C~1.INS/GNUARM~1.INS/win/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -MMD -MP -MF"ert_main.dep" -MT"ert_main.o" -c -O0 -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork -DMODEL=modelBasicBuild -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DARM_MATH_CM4=1 -DNULL=0 -DEXIT_FAILURE=1 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=0 -DARM_MATH_CM4=1 -DNULL=0 -DEXIT_FAILURE=1 -DSTACK_SIZE=64 -DRT -DMODEL=modelBasicBuild -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1 -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1/modelBasicBuild_ert_rtw -IC:/PROGRA~1/MATLAB/R2018b/extern/include -IC:/PROGRA~1/MATLAB/R2018b/simulink/include -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/src -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2018b/rtw/c/ert -IC:/Users/ramzi/AppData/Local/Temp/tp99fb16ab_b020_4469_99d7_51462ecc07b1/slprj/ert/_sharedutils -IC:/PROGRA~3/MATLAB/SUPPOR~1/R2018b/toolbox/target/SUPPOR~1/ARM_CO~1/include @modelBasicBuild_comp.rsp -o ert_main.o ert_main.c
"### Creating standalone executable "../modelBasicBuild.elf" ..."
C:/PROGRA~3/MATLAB/SUPPOR~1/R2018b/3P778C~1.INS/GNUARM~1.INS/win/bin/arm-none-eabi-g++ -Wl,--gc-sections -Wl,-Map="modelBasicBuild.map" -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork -T STM32F429xI.ld -o ../modelBasicBuild.elf @modelBasicBuild.rsp -lm
c:/progra~3/matlab/suppor~1/r2018b/3p778c~1.ins/gnuarm~1.ins/win/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot open linker script file STM32F429xI.ld: No such file or directory
collect2.exe: error: ld returned 1 exit status
gmake: *** [../modelBasicBuild.elf] Error 1
C:\Users\ramzi\AppData\Local\Temp\tp99fb16ab_b020_4469_99d7_51462ecc07b1\modelBasicBuild_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2
C:\Users\ramzi\AppData\Local\Temp\tp99fb16ab_b020_4469_99d7_51462ecc07b1\modelBasicBuild_ert_rtw>An_error_occurred_during_the_call_to_make
'An_error_occurred_during_the_call_to_make' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
### Build procedure for model: 'modelBasicBuild' aborted due to an error.
================================================================================
Error occurred in matlabshared.targetsdk.verify.Deployer/checkBuildDownload and it did not run to completion.
---------
Error ID:
---------
'RTW:buildProcess:fatalBuildError'
--------------
Error Details:
--------------
Error using coder.make.Builder/coder_diagnose
Error(s) encountered while building "modelBasicBuild":
### Failed to generate all binary outputs.
Error in coder.make.Builder/coder_build
Error in coder.make.Builder/run
Error in coder.make.invokeBuilder
Error in RTW/genMakefileAndBuild
Error in RTW/genMakefileAndBuildWrapper
Error in coder.internal.compileStage
compileResult = coder.internal.compileStage...
buildResult = buildProcedure...
buildResult = obj.make_rtw(varargin);
buildResult = h.make_rtw(buildArgs, varargin{:});
Error in build_target
Error in build_target
Error in build_standalone_rtw_target
Error in slbuild_private
Error in slbuild_private
[varargout{1:nargout}]=feval(varargin{:});
sl('slbuild_private', mdl, target, varargin{2:end});
slbuild(sys, 'StandaloneRTWTarget', ...
Error in matlabshared.targetsdk.verify.Deployer/checkBuildDownload
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I believe that the problem is in these four lines of code, but unfortunately I cannot solve it
buildConfiguration.LinkerFlags = '-mcpu = cortex-m4 -mthumb -mlittle-endian -mthumb-interwork -T STM32F429xI.ld'
i think the stm32f429xl.ld file link declaration is wrong but I don't know how to declare it correctly
dep.Tokens {1} = struct ('Name', 'ARM_CORTEX_M_ROOT_DIR', 'Value', 'codertarget.arm_cortex_m.internal.getSpPkgRootDir');
I don't know if this command is the right one to put ('codertarget.arm_cortex_m.internal.getSpPkgRootDir')
loader.LoadCommand = 'matlab: codertarget.arm_cortex_m.internal.loadAndRun';
I don't know if this command is the right one to put ('matlab: codertarget.arm_cortex_m.internal.loadAndRun')
loader.LoadCommandArguments = '- f board / stm32f429disc1.cfg';
is this the correct file for the stm32f429disc1 card?
please can you help me and thank you.
Best regards