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.
解決済! 解決策の投稿を見る。
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.
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.