CAN2018.R1 FTM & CAN build tells lost some header file.

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

CAN2018.R1 FTM & CAN build tells lost some header file.

Jump to solution
744 Views
cg0
Contributor II

I use matlab 2018a x64 and use the default GCC. after generate C code. I use S32 Design Studio to rebuild and debug.

as attechments shown the two is the mdl.

and build shown an error when build CAN, the CAN I just use the CAN echo example.

But when S32 DS build the project.

it shows error: no such file or directory, which I find the matlab didn't generate.

also the CAN shows two. but not the same file, it's an another file, and shows some fuctions are not define in link file.it's strange.

0 Kudos
1 Solution
604 Views
constantinrazva
NXP Employee
NXP Employee

Hello cg0‌,

Indeed there is a bug in the TLC file corresponding to the custom initialization block; for a quick-fix you can either go and comment in the generated init_call_trigger.h line 6 (the #include pwm_private.h), then run the following in MATLAB terminal (note: you must be in the pwm_mbd_rtw generated folder)

!pwm.bat

or you can go to 

{TOOLBOX_ROOT}\src\mbdtbx_s32k14x\mbdtbx_s32k14x\blocks\custom_init\custom_init_s32k14_trigger.tlc

and comment out line 30

#include "%<CompiledModel.Name + "_private.h">"

We will fix this bug and put a hotfix here on the community, but this being a simple fix, you can make it yourself now so you don't have to wait.

As a side-note, you can just select the "Start PWM signals generation immediately after initialization" if you Enable it immediately anyways. If you do that, you can also remove the custom init block. The Enable/Disable block is generally used if you want to enable the PWM generation after some other initialization (e.g.: sending some commands to motor driver over SPI; in this example, you'd enable the PWM generation after the transfer is complete, in an ISR).

Hope this helps,

Razvan.

View solution in original post

0 Kudos
1 Reply
605 Views
constantinrazva
NXP Employee
NXP Employee

Hello cg0‌,

Indeed there is a bug in the TLC file corresponding to the custom initialization block; for a quick-fix you can either go and comment in the generated init_call_trigger.h line 6 (the #include pwm_private.h), then run the following in MATLAB terminal (note: you must be in the pwm_mbd_rtw generated folder)

!pwm.bat

or you can go to 

{TOOLBOX_ROOT}\src\mbdtbx_s32k14x\mbdtbx_s32k14x\blocks\custom_init\custom_init_s32k14_trigger.tlc

and comment out line 30

#include "%<CompiledModel.Name + "_private.h">"

We will fix this bug and put a hotfix here on the community, but this being a simple fix, you can make it yourself now so you don't have to wait.

As a side-note, you can just select the "Start PWM signals generation immediately after initialization" if you Enable it immediately anyways. If you do that, you can also remove the custom init block. The Enable/Disable block is generally used if you want to enable the PWM generation after some other initialization (e.g.: sending some commands to motor driver over SPI; in this example, you'd enable the PWM generation after the transfer is complete, in an ISR).

Hope this helps,

Razvan.

0 Kudos