MATLAB setup with MCTB KV3x

cancel
Showing results for 
Search instead for 
Did you mean: 

MATLAB setup with MCTB KV3x

212 Views
brunotremblay
Contributor III

Hi, I'm working with MATLAB R2018b and the toolbox for KV3x. According to the section 2.2.7 of the "Motor Control Development Toolbox User Manual, Rev. 1.0.0, 12/2014", I must setting up the compiler for MATLAB when trying to compile a simple example, I get this error message:

-L"C:\Freescale\CW MCU v11.1\Cross_Tools\arm-none-eabi-gcc-4_7_3/lib/gcc/arm-none-eabi/4.8.0/m4/fp/v4-sp-d16" -L"C:\Freescale\CW MCU v11.1\Cross_Tools\arm-none-eabi-gcc-4_7_3/arm-none-eabi/lib/m4/fp/v4-sp-d16" -( -lm -lc -lgcc -Map kv3xf_adc.map -o kv3xf_adc.elf C:\Freescale\CW MCU v11.1\Cross_Tools\arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-ld: cannot find -lm C:\Freescale\CW MCU v11.1\Cross_Tools\arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-ld: cannot find -lc C:\Freescale\CW MCU v11.1\Cross_Tools\arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-ld: cannot find -lgcc gmake: *** [kv3xf_adc.elf] Error 1
### Build procedure for model: 'kv3xf_adc' aborted due to an error. Error make_rtw: exception id RTW:buildProcess:fatalBuildError message Error(s) encountered while building "kv3xf_adc"
Is it from the MATLAB setup or something else?
Regards
Bruno
0 Kudos
2 Replies

123 Views
constantinrazva
NXP Employee
NXP Employee

Hello brunotremblay‌,

Can you try with a version of the compiler that is supported by the release ? [CW v10.5 for this toolbox]

pastedImage_1.png

This is an older toolbox and using a newer version of the compiler (v11.1 in your case) might be the problem.

Please let us know if you're still having problems with your models.

Kind regards,

Razvan.

0 Kudos

123 Views
brunotremblay
Contributor III

Hello Constantin Razvan Chivu,

I've retried with the CW v10.6 (the oldest version available on the NXP site) and I get the same result.

-L"C:\Freescale\CW MCU v10.6\Cross_Tools\arm-none-eabi-gcc-4_7_3/lib/gcc/arm-none-eabi/4.8.0/m4/fp/v4-sp-d16" -L"C:\Freescale\CW MCU v10.6\Cross_Tools\arm-none-eabi-gcc-4_7_3/arm-none-eabi/lib/m4/fp/v4-sp-d16" -( -lm -lc -lgcc -Map kv3xf_adc.map -o kv3xf_adc.elf
C:\Freescale\CW MCU v10.6\Cross_Tools\arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-ld: cannot find -lm
C:\Freescale\CW MCU v10.6\Cross_Tools\arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-ld: cannot find -lc
C:\Freescale\CW MCU v10.6\Cross_Tools\arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-ld: cannot find -lgcc
gmake: *** [kv3xf_adc.elf] Error 1
### Build procedure for model: 'kv3xf_adc' aborted due to an error.
Error make_rtw: exception id RTW:buildProcess:fatalBuildError message Error(s) encountered while building "kv3xf_adc"

As mention earlier at the 2.2.7 section, when setting the compiler for the 64-bit MATLAB with the mex -setup command, I can't select the Microsoft SDK. Instead I get :

>> mex -setup
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. You will be required
to update your code to utilize the new API.
You can find more information about this at:
https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.

To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN

I'll search the MATLAB help for that but I don't put alot of hope on this. If you have a clue, that will be appreciated.

Regards

Bruno

0 Kudos