S32K3 PMSM Model Build Error for MCSPTE1AK344 Kit

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

S32K3 PMSM Model Build Error for MCSPTE1AK344 Kit

1,884 Views
Magendran
Contributor I

Dear NXP,

I get below error while implementing pmsm model file on MCSPTE1AK344 Kit. The error shows mcat_src_files are not there.

When I checked the Path the mcat_src_files directory has files in it.  Please advise is there any path to be updated in tool. Thanks.

Attached Build Error text file.

Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/generate/src -o"Dio_Ipw.o" "C:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/RTD/src/Dio_Ipw.c"

arm-none-eabi-gcc: error: Add-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/mcat_src_files: No such file or directory

arm-none-eabi-gcc -c -std=c99 -Os -fshort-enums -funsigned-char -fstack-usage -g -pedantic -Wall -Wextra -fmessage-length=0 -funsigned-bitfields -fno-common -Wunused -Wstrict-prototypes -Wsign-compare -Werror=implicit-function-declaration -mcpu=cortex-m7 -mthumb -mlittle-endian -mfloat-abi=hard -mfpu=fpv5-sp-d16 -DD_CACHE_ENABLE -DI_CACHE_ENABLE -specs=nano.specs -specs=nosys.specs --sysroot="C:\Users\Magendran\AppData\Roaming\MathWorks\MATLABAdd-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\tools\build_tools\gcc_v10.2\gcc-10.2-arm32-eabi\arm-none-eabi\newlib" -DSTEP_GPT_TIMER -DSTEP_GPT_CHANNEL=GptConf_GptChannelConfiguration_StepTimer -DSTEP_GPT_CHANNEL_FREQ=40000000 -DSTEP_GPT_CHANNEL_VALUE_MAX=4294967295 -DAUTOSAR_OS_NOT_USED -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DGCC -DS32K3XX -DS32K344 -DCPU_S32K344 -DENABLE_FPU -DMPU_ENABLE -DMBDT_INIT -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0  -DTID01EQ=0 -DSTACK_SIZE=128 -DRT -DMODEL=s32k3xx_mc_pmsm -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLAB Add-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/mcat_src_files -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/s32k3xx_mc_pmsm_ert_rtw -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/mcat_src_files -IC:/PROGRA~1/MATLAB/R2023b/extern/include -IC:/PROGRA~1/MATLAB/R2023b/simulink/include -IC:/PROGRA~1/MATLAB/R2023b/rtw/c/src -IC:/PROGRA~1/MATLAB/R2023b/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2023b/rtw/c/ert -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/AMMCLIB -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/Project_Settings -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/RTD -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/board -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/generate -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/src -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/AMMCLIB/include -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/AMMCLIB/lib -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/Project_Settings/Debugger -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/Project_Settings/Linker_Files -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/Project_Settings/Startup_Code -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/RTD/include -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/RTD/src -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/generate/include -IC:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/generate/src -o"Dma_Ip.o" "C:/Users/Magendran/AppData/Roaming/MathWorks/MATLABAdd-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/s32k3xx_mc_pmsm_Config/RTD/src/Dma_Ip.c"

arm-none-eabi-gcc: error: Add-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/mcat_src_files: No such file or directory

gmake: *** [Adc_Params.o] Error 1

gmake: *** Waiting for unfinished jobs....

gmake: *** [PosMode.o] Error 1

gmake: *** [PosMode1.o] Error 1

gmake: *** [s32k3xx_mc_pmsm.o] Error 1

gmake: *** [s32k3xx_mc_pmsm_data.o] Error 1

gmake: *** [Siul2_Port_Ip_Cfg.o] Error 1

gmake: *** [Tspc_Port_Ip_Cfg.o] Error 1

gmake: *** [freemaster_appcmd.o] Error 1

gmake: *** [freemaster_pipes.o] Error 1

gmake: *** [freemaster_protocol.o] Error 1

gmake: *** [freemaster_rec.o] Error 1

gmake: *** [freemaster_s32k344_lpuart.o] Error 1

gmake: *** [freemaster_scope.o] Error 1

gmake: *** [freemaster_serial.o] Error 1

gmake: *** [freemaster_tsa.o] Error 1

gmake: *** [freemaster_ures.o] Error 1

gmake: *** [freemaster_utils.o] Error 1

gmake: *** [mbdt_board_init.o] Error 1

gmake: *** [mbdt_lpuart.o] Error 1

gmake: *** [s32k3_trigger_config.o] Error 1

gmake: *** [exceptions.o] Error 1

gmake: *** [nvic.o] Error 1

gmake: *** [startup.o] Error 1

gmake: *** [sys_init.o] Error 1

gmake: *** [system.o] Error 1

gmake: *** [Adc.o] Error 1

gmake: *** [Adc_Ipw.o] Error 1

gmake: *** [Adc_Ipw_Irq.o] Error 1

gmake: *** [Adc_Sar_Ip.o] Error 1

gmake: *** [Adc_Sar_Ip_Irq.o] Error 1

gmake: *** [Bctu_Ip.o] Error 1

gmake: *** [Bctu_Ip_Irq.o] Error 1

gmake: *** [CDD_Mcl.o] Error 1

gmake: *** [CDD_Mcl_Ipw.o] Error 1

gmake: *** [CDD_Uart.o] Error 1

gmake: *** [Cache_Ip.o] Error 1

gmake: *** [Cache_Ip_HwAcc_ArmCoreMx.o] Error 1

gmake: *** [Can_43_FLEXCAN.o] Error 1

gmake: *** [Can_43_FLEXCAN_Ipw.o] Error 1

gmake: *** [Can_43_FLEXCAN_Irq.o] Error 1

gmake: *** [Clock_Ip.o] Error 1

gmake: *** [Clock_Ip_Data.o] Error 1

gmake: *** [Clock_Ip_Divider.o] Error 1

gmake: *** [Clock_Ip_DividerTrigger.o] Error 1

gmake: *** [Clock_Ip_ExtOsc.o] Error 1

gmake: *** [Clock_Ip_FracDiv.o] Error 1

gmake: *** [Clock_Ip_Frequency.o] Error 1

gmake: *** [Clock_Ip_Gate.o] Error 1

gmake: *** [Clock_Ip_IntOsc.o] Error 1

gmake: *** [Clock_Ip_Irq.o] Error 1

gmake: *** [Clock_Ip_Monitor.o] Error 1

gmake: *** [Clock_Ip_Pll.o] Error 1

gmake: *** [Clock_Ip_ProgFreqSwitch.o] Error 1

gmake: *** [Clock_Ip_Selector.o] Error 1

gmake: *** [Clock_Ip_Specific.o] Error 1

gmake: *** [Cmp_Ip.o] Error 1

gmake: *** [DSPSS_Api.o] Error 1

gmake: *** [Det.o] Error 1

gmake: *** [Det_stub.o] Error 1

gmake: *** [Dio.o] Error 1

gmake: *** [Dio_Ipw.o] Error 1

gmake: *** [Dma_Ip.o] Error 1

 

C:\Users\Magendran\AppData\Roaming\MathWorks\MATLABAdd-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\s32k3xx_mc_pmsm_ert_rtw>echo The make command returned an error of 2

The make command returned an error of 2

 

C:\Users\Magendran\AppData\Roaming\MathWorks\MATLABAdd-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\s32k3xx_mc_pmsm_ert_rtw>exit /B 1

### Build procedure for s32k3xx_mc_pmsm aborted due to an error.

Build Summary

Top model targets built:

 

Model            Action  Rebuild Reason                                   

===========================================================================

s32k3xx_mc_pmsm  Failed  Code generation information file does not exist. 

 

0 of 1 models built (0 models already up to date)

Build duration: 0h 0m 53.175s

0 Kudos
Reply
11 Replies

510 Views
Eduardo2000
Contributor I

Hello @Magendran , We are seeing exact same issue! After programming the board, The user LED stays OFF and pushing the LED won't spin the motor. Instead, D3 red LED goes on every time we push the user LED. Also the Freemaster won't work either! Can you plz let us know if you solved the problem? If so, how ? 

0 Kudos
Reply

1,803 Views
stefanvlad
NXP Employee
NXP Employee

Hello Magendran,

 

Thank you for the attached log file and the details above, there are multiple errors above and let's address them below:

1. error: Add-Ons/Toolboxes/NXP_MBDToolbox_S32K3xx/S32K3_Examples/mc/PMSM/mcat_src_files: No such file or directory

For this one I recommend you install the latest Model-Based Design Toolbox for S32K3xx version 1.4.0 to the following location: 

stefanvlad_0-1706544263577.png

This should be the default location and you need to clean (delete) other folders like C:\Users\Magendran\AppData\Roaming\MathWorks\MATLABAdd-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\ in order to have only one clean and good location, as in the picture above.

2. Error:License Error: -1, Model-Based Design Toolbox License Missing.
    No license file found in D:\MATLAB\MATLABAdd-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\lic.

In order to fix this error, you need to add the license.dat file in the folder C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx\lic\

And the license you can get from NXP website under My NXP Account --> Software Licensing and Support--> View accounts

3.  error: 'GptConf_GptChannelConfiguration_GptChannelConfiguration_2' undeclared (first use in this function); did you mean 'GptConf_GptChannelConfiguration_GptChannelConfiguration_0'?

First, I do recommend setting the default path in Matlab, using the Set Path window --> Default --> Save --> Close:

stefanvlad_2-1706545468009.png

Then navigate to C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx and run the path script file mbd_s32k3_path.m in the Matlab location:

stefanvlad_1-1706545190555.png

The output should be as in the picture above, with no errors if all the above steps are followed.

Last step is to navigate to C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx\S32K3_Examples\mc\PMSM and open the s32k3xx_mc_pmsm.mdl

 

Hope this helps you to run the models with no issues,

Stefan V.

 

0 Kudos
Reply

1,738 Views
Magendran
Contributor I

Hi Stefan,

Thanks for sending your PMSM folder.

I have changed the path of MATLAB ADD-ons as per your suggestion.

while buiding and deploying the project i get following error.

Error: File: C:\mathworks\Toolboxes\NXP_MBDToolbox_S32K3xx\mbdtbx_s32k3\+mbd_s32k3\+common\blocks\fm\fm_config.tlc Line: 64 Column: 7

Attached log file FYR. Please advise. Thanks.

0 Kudos
Reply

1,692 Views
stefanvlad
NXP Employee
NXP Employee

Hello Magendran,

 

I have looked into the attached log and tried to replicate the error with fm_config.tlc, but in my case it does not reproduce, instead I have moved the PMSM folder to another location C:\Users\nxf86664\Downloads\PMSM (1)\PMSM and it builds and flashed successfully:

stefanvlad_0-1706804660086.png

I recommend you install the following Add-ons:

stefanvlad_1-1706805006828.png

and the following path is set on my PC:

stefanvlad_2-1706805230586.png

 

Once again check you have similar paths and Add-on on you PC, they are required in order to successfully build the project.

 

Stefan V.

0 Kudos
Reply

1,658 Views
Magendran
Contributor I

Hi Stefan,

I have checked path setup and Add-on on my PC and the packages you had mentioned in Add-on and i have everything similar as per your recommendation. I still get same error. I have MATLAB 2023b version. 

Please advise. Thanks.

0 Kudos
Reply

1,644 Views
stefanvlad
NXP Employee
NXP Employee

Hi Magendran,

 

I have tested and retested using Matlab R2023b Update 6 with the following Add-ons installed:

stefanvlad_0-1706885577713.png

And reinstalled the MBDToolbox_S32K3xx v1.4.0 and it builds successfully each time, no issues.

 

I recommend you start fresh, to summarize the steps:

  1. Open Matlab R2023b Update 6 and Manage Add-ons
  2. Uninstall the current NXP_MBDToolbox_S32K3xx v1.4.0
  3. Close Add-ons Manager
  4. Open Matlab Set Path -> Default -> Save ->Close and then exit Matlab. 
  5. Delete local folder C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx
  6. Check if you have any other location on your PC that has a folder C:\.... or D:\.......\Toolboxes\NXP_MBDToolbox_S32K3xx
  7. Delete any NXP_MBDToolbox_S32K3xx folders if they exist.
  8. Download the latest NXP_MBDToolbox_S32K3xx_1.4.0_20230529.mltbx
  9. Open Matlab R2023b and to go downloads and install the above add-on.
  10. Copy the license.dat in the folder D:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx\lic
  11. Change Matlab folder to D:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx\S32K3_Examples\mc\PMSM
  12. Open the s32k3xx_mc_pmsm.mdl and build it.
  13. If all the steps are ok, then the result should be successfully: stefanvlad_2-1706886384185.png

     

In your case Matlab is installed to D:\, that is why the above paths are using D drive.

It is important you follow the steps above carefully and hope this can help,

Stefan V.

0 Kudos
Reply

1,786 Views
Magendran
Contributor I

Hi Stefan,

I installed matlab Add-ons in drive, license file in LIC folder ,set the mbd_s32k3_Path and it was successful. still i am getting error: 'GptConf_GptChannelConfiguration_GptChannelConfiguration_2' undeclared (first use in this function); did you mean 'GptConf_GptChannelConfiguration_GptChannelConfiguration_0'?.

 

Attached error file. Please advise. Thanks.

0 Kudos
Reply

1,773 Views
stefanvlad
NXP Employee
NXP Employee

Hi Magendran,

I see the attached file the same path as the old path in the posts above, D:\MATLAB\MATLABAdd-Ons\Toolboxes\NXP_MBDToolbox_S32K3xx\S32K3_Examples\mc\PMSM\

Have you followed the steps I presented in the previous post?


The install path should be as short as possible, for example: C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx\ this is what it is recommended.
Also, when you run the PMSM example your Matlab folder needs to be: C:\MathWorks\Toolboxes\NXP_MBDToolbox_S32K3xx\S32K3_Examples\mc\PMSM\

stefanvlad_0-1706617022387.png

Before doing the build process again, please clean up the PMSM folder, keep only the following folders and files:

stefanvlad_1-1706617211888.png

I have attached here the PMSM folder from my PC,

Hope this helps.

0 Kudos
Reply

1,847 Views
Magendran
Contributor I

Hi NXP team,

I have changed the path of ADD-ONS and compiled still i get attached Error.  i am able to compile and download DIO and UART example successfully but not PMSM model file. Please advise.

0 Kudos
Reply

1,406 Views
Magendran
Contributor I

Hi Stefan,

I am able to download the model file on the S32K3 board but green LED is not on. Please let me know any steps i need to enable. Thanks.

Thanks and Regards,

Magendran

0 Kudos
Reply

1,014 Views
stefanvlad
NXP Employee
NXP Employee

Hello @Magendran ,

 

Can you please specify what S32K3x4EVB board are you using? Is it the Q172 or the T172?

The PMSM model attached on the previous post was tested on the S32K3x4-Q172 with SCH-51972 RevA board.

Mode details on the boards are in Get Started with the MCSPTE1AK344 Development Kit | NXP Semiconductors.

 

Also, if the model is successfully built and programmed to the board, can you open FreeMaster and connect to the board to see the variables? 

Pushing the User buttons on the board, does it start the motor?

 

Stefan V.

0 Kudos
Reply