Setting up the compiler for Motor Control toolbox "MKV10Z Family of Processors"

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

Setting up the compiler for Motor Control toolbox "MKV10Z Family of Processors"

2,347 Views
m_benderradji
Contributor II

Hi,

I have installed the Motor Control Development Toolbox for Kinetis to use it with "MKV10Z Family of Processors".

I want to set-up the compiler as it is described below:

2.2.5 Setting up the Target Compilers
The target compiler for Motor Control Development Toolbox to use will need to be
configured. Ensure a system environment variable called
<COMPILER_STRING>_TOOL is defined to value, an example is shown below.
IAR_TOOL= C:/ IAR
GCC_ARM_TOOL = c:/ Freescale/CW_MCU_v10_4/Cross_Tools/arm-none-eabi-gcc-4_7_3

I do not found c:/ Freescale folder

Could you please tell me what i need to do ?

Best regard

0 Kudos
13 Replies

1,827 Views
m_benderradji
Contributor II

hello,

any feedback please ?

Regards

0 Kudos

1,827 Views
m_benderradji
Contributor II

Hi Marus,

MC toolbox for kinetis V work now. i have just renamed licence.mat file to licence.lic.

For my second issue for MBDT 2018.r1 FOR S32 MCU's, I still have the same issue despite that I deleted "GCC_S32K_TOOL".

pastedImage_1.png

Maybe I must configure the compiler to use the default one. If yes how?

regards

0 Kudos

1,827 Views
m_benderradji
Contributor II

Marius,

Now i have another issue with the motor control toolbox for Kinetis. Refer to the following:

pastedImage_1.png

Could you please help me to resolve this issue. Thanks in advance

0 Kudos

1,827 Views
mariuslucianand
NXP Employee
NXP Employee

Hello m.benderradji@outlook.fr‌,

For the License Error issue, you need to get a license file (which is free) from the NXP website. You will find it on the same page from where you downloaded the toolbox. 

From the second question regarding the error it seems to be a compiler error. If I am not wrong you asked me about how to change the compiler. Please remove or rename the Path name an check if it works with the default one. 

Best Regards, 

Marius

0 Kudos

1,827 Views
m_benderradji
Contributor II

Marius,

I have only 2 toolboxes: MBDT for S32K MCU 2018.R1 and the one for Kinetis

pastedImage_1.png

For the seconde issue please find blow the hole log:

Build 4 2 1 Clear
11:12 AM Elapsed: 29 sec
### Starting build procedure for model: BLDC_ClosedLoop_s32k14x
### Generating code and artifacts to 'Model specific' folder structure
Code Generation 2 2
Elapsed: 27 sec
### Generating code into build folder: D:\Project\_Standard_Library_ALGO\Prototypage\BLDC_ClosedLoop_s32k14x_mbd_rtw
Self-transition #357 could be removed. 'B' has no children, and it does not cause any action or side-effect. [2 similar]
Component:Stateflow | Category:Coder warning
### Invoking Target Language Compiler on BLDC_ClosedLoop_s32k14x.rtw
### Using System Target File: D:\Users\Bender1M\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\mbdtbx_s32k14x\mbdtbx_s32k14x\mbd_s32k14.tlc
### Using Model-Based Design Toolbox for S32K1xx Series 2018.R1 (R2016b-R2018a) 23-Jul-2018
### 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 BLDC_ClosedLoop_s32k14x_types.h
.
### Writing source file BLDC_ClosedLoop_s32k14x.c
### Writing header file BLDC_ClosedLoop_s32k14x_private.h
### Writing header file BLDC_ClosedLoop_s32k14x.h
### Writing source file Hall_Emulation_Sequence.c
### Writing source file Motor_Speed_Request.c
### Writing source file FIRparams.c
.
### Writing header file freemaster_cfg.h
### Writing header file freemaster_interface_init.h
### Writing source file freemaster_interface_init.c
### Writing header file rtwtypes.h
### Writing header file Hall_Emulation_Sequence.h
.
### Writing source file BLDC_ClosedLoop_s_Calculate_RPM.c
### Writing header file BLDC_ClosedLoop_s_Calculate_RPM.h
### Writing header file Motor_Speed_Request.h
### Writing source file mbd_main.c
### TLC code generation complete.
.
### Processing Template Makefile: D:\Users\Bender1M\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\mbdtbx_s32k14x\mbdtbx_s32k14x\mbd_s32k14.tmf
### Creating BLDC_ClosedLoop_s32k14x.mk from D:\Users\Bender1M\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\mbdtbx_s32k14x\mbdtbx_s32k14x\mbd_s32k14.tmf
### Building BLDC_ClosedLoop_s32k14x: .\BLDC_ClosedLoop_s32k14x.bat
.
D:\Project\_Standard_Library_ALGO\Prototypage\BLDC_ClosedLoop_s32k14x_mbd_rtw>set MATLAB=C:\Program Files\MATLAB\R2017b

D:\Project\_Standard_Library_ALGO\Prototypage\BLDC_ClosedLoop_s32k14x_mbd_rtw>"C:\Program Files\MATLAB\R2017b\bin\win64\gmake" -f BLDC_ClosedLoop_s32k14x.mk COPY_MDLREF_INCLUDES=0 ISPROTECTINGMODEL=NOTPROTECTING GENERATE_ERT_S_FUNCTION=0 INCLUDE_MDL_TERMINATE_FCN=1 COMBINE_OUTPUT_UPDATE_FCNS=1 MULTI_INSTANCE_CODE=0 INTEGER_CODE=0
Cleaning...
RELATIVE_PATH_TO_ANCHOR is ..
==== Removing object files from build directory ====
Copying necessary files to build directory...
Compiler details : "D:\Users\Bender1M\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-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 -DARM_MATH_CM4 -D__FPU_PRESENT=1 -D__FPU_USED=1 -D__NVIC_PRIO_BITS=FEATURE_NVIC_PRIO_BITS -o SetupFiles -DCPU_S32K144HFT0VLLT -I. -I.. -I.. -I"C:\Program Files\MATLAB\R2017b\simulink\include" -I"C:\Program Files\MATLAB\R2017b\extern\include" -I"C:\Program Files\MATLAB\R2017b\rtw\c\src" -I"C:\Program Files\MATLAB\R2017b\rtw\c\libsrc" -I"C:\Program Files\MATLAB\R2017b\rtw\c\src\ext_mode\common" -I"C:\Program Files\MATLAB\R2017b\rtw\c\src\ext_mode\tcpip" -I"C:\Program Files\MATLAB\R2017b\rtw\c\src\ext_mode\serial" -I"C:\Program Files\MATLAB\R2017b\rtw\c\src\ext_mode\custom" -ID:\Project\_Standard_Library_ALGO\Prototypage -IC:\PROGRA~1\MATLAB\R2017b\simulink\include\sf_runtime -ID:\Project\_Standard_Library_ALGO\Prototypage\BLDC_ClosedLoop_s32k14x_mbd_rtw -I"D:\Users\Bender1M\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-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"
Assembler details : "D:\Users\Bender1M\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -x assembler-with-cpp -o SetupFiles
Product: BLDC_ClosedLoop_s32k14x.mot
Build product type: executable
Building file startup_S32K144.o...
"D:\Users\Bender1M\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\gcc-6.3-arm32-eabi/bin/arm-none-eabi-gcc" -c -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -x assembler-with-cpp -o startup_S32K144.o startup_S32K144.s
### Build procedure for model: 'BLDC_ClosedLoop_s32k14x' aborted due to an error.
Error(s) encountered while building "BLDC_ClosedLoop_s32k14x"

Thanks

0 Kudos

1,827 Views
m_benderradji
Contributor II

Hi Marius,

Could you tell me how i proceed ? for your information, i'm using MATLAB 2017b version

Do I need to create a folder "mbdtbx_pnt" in the following directory "D:\MCToolbox\mctbx_Kinetis" to have first "D:\MCToolbox\mctbx_Kinetis\mbdtbx_pnt" ?

Do I need to create a second folder "mbdtbx_pnt" in the first folder "mbdtbx_pnt" to have "D:\MCToolbox\mctbx_Kinetis\mbdtbx_pnt\mbdtbx_pnt"

Do I need to add next "slsfnagctlr.p" to "mbdtbx_pnt" folder ?

And finally, do i need to add the \mbdtbx_pnt\mbdtbx_pnt\ to the Path ?

I have a second issue when i try to build the "BLDC_ClosedLoop_s32k14x.slx" exemple of NXP MBDT 2018.R1 for S32K MCU's . Refer to the following:

pastedImage_1.png

Is this issue relevant to the first one ?

Thanks in advance for your support

0 Kudos

1,827 Views
mariuslucianand
NXP Employee
NXP Employee

Hello m.benderradji@outlook.fr‌,

Firstly, let's clarify some things. In this response you mentioned 3 different toolboxes. The one for Kinetis, MPC574xP and MBDT for S32K MCU 2018.R1. The slsfnagctlr.p fix it is only applicable to the Kinetis and MPC574xP toolboxes which were not tested on the 2017b Matlab's version because were released before 2017 and the Matlab' API has changed. 

Please excuse me but probably I din't provided the right fix link for Kinetis. Please follow the next thread HotFix: MBD Toolbox for Kinetis.

For MPC574x the file structure should be smth like this {Toolbox install dir}\mbdtbx_pnt\mbdtbx_pnt\mscripts. Do not create folders, just try finding the ones specified. 

every toolbox has a file that adds all the required files in Matlab's path. For Mpc574xP it is called mbd_pnt_path.m. If you use the MPC574xP please run that.

Now, the problem you are facing is a compiler problem, and apparently you are trying to run an example on BLDC motor for S32K144 board and it is not relevant to the one related with slsfnagctlr.p. Please consider sending me the hole log because I can not figure it out just by the last lines. 

Best Regards, 

Marius

0 Kudos

1,827 Views
m_benderradji
Contributor II

Hi Marius,

I have installed CodeWarrior IDE and i have set-up the compiler as it is described in your previous response.

Now i am trying to build a basic model using the "Motor Control toolbox for MKV10Z Family". I have the following error:

pastedImage_1.png

Could you please tell me what i need to do to resolve this issue. For your information i have also the NXP MBDT 2018.R1 for S32K MCU's installed. Are there a conflict between the two toolbox ?

Thanks in advance for your support.

Best regard

0 Kudos

1,827 Views
mariuslucianand
NXP Employee
NXP Employee

Hello m.benderradji@outlook.fr‌,

You are facing a known issue related with the Matlab's API.

Please apply the Hotfix 9 from this link https://community.nxp.com/message/1008960?commentID=1008960#comment-1008960 

Hope this helps you!

Best Regards, 

Marius

0 Kudos

1,827 Views
m_benderradji
Contributor II

Dir Marius,

The are several CodeWarrior IDE's. Which one i need to install for the Motor Control Development Toolbox.

I have noticed also that there are an "evaluation version". Is  CodeWarrior free ?

regards

0 Kudos

1,827 Views
mariuslucianand
NXP Employee
NXP Employee

Hello m.benderradji@outlook.fr‌,

The toolbox was tested with the version 10.5. On the community there are another threads about 10.7 so I think it will work with 11.1 too. Anyway, the MBDT is using only the compiler, so the right Path variable must be set. 

For your second question you can use the "evaluation version". I think there is only the code size limitation and not a time limitation.

Best regards, 

Marius

0 Kudos

1,827 Views
m_benderradji
Contributor II

Thank you Marius for the support

0 Kudos

1,827 Views
mariuslucianand
NXP Employee
NXP Employee

Hello m.benderradji@outlook.fr‌,

The CodeWarrior Compiler must be separately downloaded and installed. After that you will find the folder containing the compiler on your disk. Also, the folder "Freescale" might be renamed to "NXP" so have a closer look on your disk. You can download the latest version of CW from here

Best regards, 

Marius 

0 Kudos