Help with build error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with build error

1,816 Views
andrewweiss
Contributor II

Hello, I'm looking for insight to a build error when attempting to build a simple model using the MBDT from NXP.  I believe the Code Warrior installation is complete, and environmental variables are declared.  

=== Build (Elapsed: 16 sec) ===
### Starting build procedure for model: Simple
### Generating code into build folder: C:\MBDToolbox\mbdtbx_9s12zvc\Simple_mbd_rtw
### Invoking Target Language Compiler on Simple.rtw
### Using System Target File: C:\MBDToolbox\mbdtbx_9s12zvc\mbdtbx_s12zvc\mbdtbx_s12zvc\mbd_s12zvc.tlc
exception id Simulink:Engine:CallbackEvalErr message Error evaluating 'InitFcn' callback of block_diagram 'Simple'. ### Loading TLC function libraries
### Initial pass through model to cache user defined code
### Caching model source code
### Writing header file Simple.h
.
### Writing header file Simple_types.h
### Writing header file rtwtypes.h
### Writing source file Simple.c
### Writing header file Simple_private.h
.
### Writing source file mbd_main.c
### Writing header file tim_param.h
### Writing header file clk_init.h
### Writing header file vector.h
### Writing header file isr_lvl.h
.
### Writing source file isr_lvl.c
### Writing header file mc9s12zvc.h
### TLC code generation complete.
### Using toolchain: MinGW64 v4.x | gmake (64-bit Windows)
### 'C:\MBDToolbox\mbdtbx_9s12zvc\Simple_mbd_rtw\Simple.mk' is up to date
### Building 'Simple': C:\PROGRA~1\MATLAB\R2015b\bin\win64\gmake -f Simple.mk all

C:\MBDToolbox\mbdtbx_9s12zvc\Simple_mbd_rtw>cd .

C:\MBDToolbox\mbdtbx_9s12zvc\Simple_mbd_rtw>if "" == "" (C:\PROGRA~1\MATLAB\R2015b\bin\win64\gmake -f Simple.mk all ) else (C:\PROGRA~1\MATLAB\R2015b\bin\win64\gmake -f Simple.mk )
C:\PROGRA~3\MATLAB\SUPPOR~1\R2017b\3P778C~1.INS\MINGW_~1.INS\bin/gcc -c -ansi -pedantic -Wno-long-long -fwrapv -O0 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DMODEL=Simple -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/MBDToolbox/mbdtbx_9s12zvc/Simple_mbd_rtw -IC:/MBDToolbox/mbdtbx_9s12zvc -IC:/PROGRA~1/MATLAB/R2015b/extern/include -IC:/PROGRA~1/MATLAB/R2015b/simulink/include -IC:/PROGRA~1/MATLAB/R2015b/rtw/c/src -IC:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2015b/rtw/c/ert -o "Simple.obj" "Simple.c"
gmake: *** [Simple.obj] Error 1

C:\MBDToolbox\mbdtbx_9s12zvc\Simple_mbd_rtw>echo The make command returned an error of 2
The make command returned an error of 2

C:\MBDToolbox\mbdtbx_9s12zvc\Simple_mbd_rtw>An_error_occurred_during_the_call_to_make
'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: 'Simple' aborted due to an error.
MException with properties:
identifier: 'RTW:buildProcess:fatalBuildError'
message: 'Error(s) encountered while building "Simple":…'
cause: {}
stack: [20x1 struct]
Build process completed successfully

0 Kudos
Reply
1 Reply

1,547 Views
constantinrazva
NXP Employee
NXP Employee

Hello andrewweiss‌,

From what I can tell the problem is with the environment variable for CW.

Please run this command in matlab

         

setenv('CW_TOOL','C:\Freescale\CW MCU v11.0')

and then try again to build your model. If it works (like it did on my end), you will need to edit your environment variable to set it to C:\Freescale\CW MCU v11.0 instead of C:/Freescale/"CW MCU v11.0" (like it is now from what I can see from your screen capture).

Please let us know if you encounter further issues with this.

Kind regards,

Razvan.

P.S.: I have attached the log for the successful build.

0 Kudos
Reply