Simulink build error

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

Simulink build error

2,846 Views
bhanu_kassel
Contributor II

Hi,

When I build FOC_TC file. I am getting 'FOC_TC' aborted due to an error. Error is like below


### Generating code into build folder: C:Users49159DownloadsM7_2018.R1M7_2018.R1FOC_TC_mbd_rtw
Failure in mbd_s32k_config_target_cbk: Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
Parameter precision loss occurred for 'UpperLimit' of 'FOC_TC/S32K14x EVB/FastLoopControl/ D-Axis Current Controller/Saturation/Enabled/Saturation'. The parameter's value cannot be represented exactly using the run-time data type. A small quantization error has occurred. To disable this warning or error, in the Configuration Parameters > Diagnostics > Data Validity pane, set the 'Detect precision loss' option in the Parameters group to 'none'. [19 similar]
Component:Simulink | Category:Block warning Suppress
Converting 'Reusable function' setting of subsystem 'FOC_TC/S32K14x EVB/FastLoopControl' to 'Nonreused function' because a child system has either been explicitly marked as nonreused, or is used in a configuration that must be nonreused. Please generate the HTML report during code generation and see the "Subsystems" section for more information
Component:Simulink | Category:Block warning
### Invoking Target Language Compiler on FOC_TC.rtw
### Using System Target File: C:Users49159AppDataRoamingMathWorksMATLAB Add-OnsToolboxesNXP_MBDToolbox_S32K1xx(4)mbdtbx_s32kmbd_s32k.tlc
### Using Model-Based Design Toolbox for S32K1xx Series 4.1.0 (R2017b-R2019a) 22-Jul-2019
### Loading TLC function libraries
### Generating TLC interface API for custom data
### Initial pass through model to cache user defined code
### Caching model source code
...............................................................................
...............................................................................
...............................................................................
.................................
### Writing header file FOC_TC_types.h
### Writing source file FOC_TC.c
.
### Writing header file FOC_TC_private.h
### Writing header file FOC_TC.h
### Writing header file rtwtypes.h
### Writing source file FOC_TC_data.c
### Writing source file mbd_main.c
### TLC code generation complete.
........### Creating HTML report file FOC_TC_codegen_rpt.html
Warning: Directory already exists. [5 similar]
.
### Processing Template Makefile: C:Users49159AppDataRoamingMathWorksMATLAB Add-OnsToolboxesNXP_MBDToolbox_S32K1xx(4)mbdtbx_s32kmbd_s32k.tmf
### FOC_TC.mk which is generated from C:Users49159AppDataRoamingMathWorksMATLAB Add-OnsToolboxesNXP_MBDToolbox_S32K1xx(4)mbdtbx_s32kmbd_s32k.tmf is up to date
### Building FOC_TC: .FOC_TC.bat

C:Users49159DownloadsM7_2018.R1M7_2018.R1FOC_TC_mbd_rtw>set MATLAB=C:Program FilesMATLABR2018b

C:Users49159DownloadsM7_2018.R1M7_2018.R1FOC_TC_mbd_rtw>"C:Program FilesMATLABR2018bbinwin64gmake" -f FOC_TC.mk COPY_MDLREF_INCLUDES=0 GENERATE_ERT_S_FUNCTION=0 INCLUDE_MDL_TERMINATE_FCN=1 COMBINE_OUTPUT_UPDATE_FCNS=1 MULTI_INSTANCE_CODE=0 INTEGER_CODE=0 ISPROTECTINGMODEL=NOTPROTECTING
Cleaning...
RELATIVE_PATH_TO_ANCHOR is ..
==== Removing object files from build directory ====
Compiler details : "C:Users49159DocumentsMATLABAdd-OnsToolboxesNXP_MBDToolbox_S32K1xxcodetoolsgcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O1 -g -gstrict-dwarf -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -DSTART_FROM_FLASH -D__FPU_USED=1 -D__NVIC_PRIO_BITS=FEATURE_NVIC_PRIO_BITS -DERRATA_E9527 -o SetupFiles -DCPU_S32K144HFT0VLLT -I. -I.. -I.. -I"C:Program FilesMATLABR2018bsimulinkinclude" -I"C:Program FilesMATLABR2018bexterninclude" -I"C:Program FilesMATLABR2018brtwcsrc" -I"C:Program FilesMATLABR2018brtwclibsrc" -I"C:Program FilesMATLABR2018brtwcsrcext_modecommon" -I"C:Program FilesMATLABR2018brtwcsrcext_modetcpip" -I"C:Program FilesMATLABR2018brtwcsrcext_modeserial" -I"C:Program FilesMATLABR2018brtwcsrcext_modecustom" -IC:Users49159DownloadsM7_2018.R1M7_2018.R1 -IC:Users49159DownloadsM7_2018.R1M7_2018.R1FOC_TC_mbd_rtw -IC:PROGRA~1MATLABR2018bexterninclude -IC:PROGRA~1MATLABR2018bsimulinkinclude -IC:PROGRA~1MATLABR2018brtwcsrc -IC:PROGRA~1MATLABR2018brtwcsrcext_modecommon -IC:PROGRA~1MATLABR2018brtwcert -I"C:Users49159DocumentsMATLABAdd-OnsToolboxesNXP_MBDToolbox_S32K1xxcodetoolsgcc-6.3-arm32-eabi/arm-none-eabi/include" -I"./common" -I"./inc" -I"./src/clock/S32K1xx" -I"./src/sim/S32K144" -I"./src/power/S32K1xx" -I"./S32K144/include" -I"../common" -I"../inc" -I"../src/clock/S32K1xx" -I"../src/sim/S32K144" -I"../src/power/S32K1xx" -I"../S32K144/include" -I"../instrumented/common" -I"../instrumented/inc" -I"../instrumented/src/clock/S32K1xx" -I"../instrumented/src/sim/S32K144" -I"../instrumented/src/power/S32K1xx" -I"../instrumented/S32K144/include"
Assembler details : "C:Users49159DocumentsMATLABAdd-OnsToolboxesNXP_MBDToolbox_S32K1xxcodetoolsgcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -x assembler-with-cpp -DSTART_FROM_FLASH -o SetupFiles
Product: FOC_TC.mot
Build product type: executable
Building file startup_S32K144.o...
"C:Users49159DocumentsMATLABAdd-OnsToolboxesNXP_MBDToolbox_S32K1xxcodetoolsgcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -x assembler-with-cpp -DSTART_FROM_FLASH -o startup_S32K144.o startup_S32K144.s
Building file FOC_TC.o...
"C:Users49159DocumentsMATLABAdd-OnsToolboxesNXP_MBDToolbox_S32K1xxcodetoolsgcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O1 -g -gstrict-dwarf -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -DSTART_FROM_FLASH -D__FPU_USED=1 -D__NVIC_PRIO_BITS=FEATURE_NVIC_PRIO_BITS -DERRATA_E9527 -o FOC_TC.o -DCPU_S32K144HFT0VLLT -I. -I.. -I.. -I"C:Program FilesMATLABR2018bsimulinkinclude" -I"C:Program FilesMATLABR2018bexterninclude" -I"C:Program FilesMATLABR2018brtwcsrc" -I"C:Program FilesMATLABR2018brtwclibsrc" -I"C:Program FilesMATLABR2018brtwcsrcext_modecommon" -I"C:Program FilesMATLABR2018brtwcsrcext_modetcpip" -I"C:Program FilesMATLABR2018brtwcsrcext_modeserial" -I"C:Program FilesMATLABR2018brtwcsrcext_modecustom" -IC:Users49159DownloadsM7_2018.R1M7_2018.R1 -IC:Users49159DownloadsM7_2018.R1M7_2018.R1FOC_TC_mbd_rtw -IC:PROGRA~1MATLABR2018bexterninclude -IC:PROGRA~1MATLABR2018bsimulinkinclude -IC:PROGRA~1MATLABR2018brtwcsrc -IC:PROGRA~1MATLABR2018brtwcsrcext_modecommon -IC:PROGRA~1MATLABR2018brtwcert -I"C:Users49159DocumentsMATLABAdd-OnsToolboxesNXP_MBDToolbox_S32K1xxcodetoolsgcc-6.3-arm32-eabi/arm-none-eabi/include" -I"./common" -I"./inc" -I"./src/clock/S32K1xx" -I"./src/sim/S32K144" -I"./src/power/S32K1xx" -I"./S32K144/include" -I"../common" -I"../inc" -I"../src/clock/S32K1xx" -I"../src/sim/S32K144" -I"../src/power/S32K1xx" -I"../S32K144/include" -I"../instrumented/common" -I"../instrumented/inc" -I"../instrumented/src/clock/S32K1xx" -I"../instrumented/src/sim/S32K144" -I"../instrumented/src/power/S32K1xx" -I"../instrumented/S32K144/include" FOC_TC.c
In file included from FOC_TC.c:16:0:
FOC_TC.h:46:48: error: unknown type name 'SIM_Type'
static inline void SIM_HAL_SetAdcInterleaveSel(SIM_Type * base, uint8_t setting)
^~~~~~~~
FOC_TC.h:46:65: error: unknown type name 'uint8_t'
static inline void SIM_HAL_SetAdcInterleaveSel(SIM_Type * base, uint8_t setting)
^~~~~~~
FOC_TC.c: In function 'enable_FTM_PDB_ADC_triggeri':
FOC_TC.c:424:3: warning: implicit declaration of function 'PDB_DRV_LoadValuesCmd' [-Wimplicit-function-declaration]
PDB_DRV_LoadValuesCmd(0);
^~~~~~~~~~~~~~~~~~~~~
FOC_TC.c:426:3: warning: implicit declaration of function 'FTM_DRV_SetInitTriggerCmd' [-Wimplicit-function-declaration]
FTM_DRV_SetInitTriggerCmd(FTM3, true);
^~~~~~~~~~~~~~~~~~~~~~~~~
FOC_TC.c:426:29: error: 'FTM3' undeclared (first use in this function)
FTM_DRV_SetInitTriggerCmd(FTM3, true);
^~~~
FOC_TC.c:426:29: note: each undeclared identifier is reported only once for each function it appears in
FOC_TC.c: In function 'FOC_TC_ADC1_IRQHandler':
FOC_TC.c:1072:31: error: 'FTM3' undeclared (first use in this function)
FTM_DRV_SetInitTriggerCmd(FTM3, false);
^~~~
FOC_TC.c: In function 'FOC_TC_PDB1_IRQHandler':
FOC_TC.c:1152:31: error: 'FTM3' undeclared (first use in this function)
FTM_DRV_SetInitTriggerCmd(FTM3, true);
^~~~
FOC_TC.c: In function 'FOC_TC_initialize':
FOC_TC.c:1360:3: warning: implicit declaration of function 'SIM_HAL_SetAdcInterleaveSel' [-Wimplicit-function-declaration]
SIM_HAL_SetAdcInterleaveSel(SIM, 0b0010);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
FOC_TC.c:1360:31: error: 'SIM' undeclared (first use in this function)
SIM_HAL_SetAdcInterleaveSel(SIM, 0b0010);
^~~
gmake: *** [FOC_TC.o] Error 1
### Build procedure for model: 'FOC_TC' aborted due to an error.
Error(s) encountered while building "FOC_TC"
Component:Simulink | Category:Block diagram error

HOW TO RESOLVE THIS ERROR?

0 Kudos
Reply
4 Replies

2,668 Views
mariuslucianand
NXP Employee
NXP Employee

Hello bhanu.kassel@gmail.com‌,

You are trying to run the FOC example from this community, which was developed I think for an earlier MBDT version using the MBDT for S32K 4.1.0: Am I right? The models were not migrated yet.

Probably the problem is caused by this message/action performed by the Simulink. Not generating this as reusable function makes the compiler to not find some function declarations through files.

Converting 'Reusable function' setting of subsystem 'FOC_TC/S32K14x EVB/FastLoopControl' to 'Nonreused function' because a child system has either been explicitly marked as nonreused, or is used in a configuration that must be nonreused. Please generate the HTML report during code generation and see the "Subsystems" section for more information

Best Regards,

Marius

0 Kudos
Reply

2,668 Views
bhanu_kassel
Contributor II

hi,

I did hotfix to MBD toolbox 4.0.0 and I run FOC_TC file but I got this error.

System target file 'mbd_s32k.tlc' cannot be found.

This is urgent because I need it done within a few days. Could you help me out?

Regards,

Bhanu

0 Kudos
Reply

2,668 Views
constantinrazva
NXP Employee
NXP Employee

Hello bhanu.kassel@gmail.com‌,

I only saw this now - is this in regard to MBDT 4.1.0  thread? Is this still an issue? I suspect something wrong with your setup - different versions installed on top of each other with different patches applied. If this is still an issue, my advice would be to save the models that you've been working on and reinstall the latest version available, than install on top of that the latest patch for that version. This way, you shouldn't get any more errors, and if you get them, we'll be sure that the setup is correct (fresh install) and we'll go from there. I would also suggest that you uninstall and delete the old toolbox (again, be careful to save the models that you've worked on before deleting) before installing a fresh copy.

Let us know if you're still having issues with anything.

Kind regards,

Razvan.

0 Kudos
Reply

2,668 Views
Daniel_Popa
NXP Employee
NXP Employee

constantinrazvan.chivu

Can you have a look ?

Thank you!

Daniel

0 Kudos
Reply