Hi, Victor
I learned the BLDC example and know I can use the Matlab Function module to call C function. However, I can not finish Period measurement as well.
Since the BLDC example is configured by EB tresos, but I only know a little about S32CT, I do the configuration with S32CT Refer to EB project, I also learn from some other examples. But I don't know if I finished the Icu configuration correctly and if it's the reason why I can not get period data.
Here is my configuration file, and I finished the following configuration :
1. Set PTE11 and PTD0 to eMios in Pins setting.

2. Set eMios MasterCounter in Mcl setting:

3. Enable peripheral clock of eMios0 in Mcu setting.

4. Enable relating eMios interrupt controller in Platform setting

5. Set Icu channels
5.1 Set Icu_channel0, using eMios0_channel1, using SiganlMeasurement mode, and set to Period_Time measurement function.

5.2 Set IcueMios, using using eMios0_channel1, using MasterCounter0(eMios0_23), using IcuSubModeforMeasurement IPWM

5.3 Enable eMios IcuHwlnterruptConfigList

I think I have finished all related settings. Then I make a simple model to get PWM period, the model is post as follow.

In the initialize function, I configured FreeMaster and called Icu_StartSignalMeasurement function to enable Icuchannel0.


In the main function, I set a flashing LED to ensure the program is running successfully.
Then I used the Icu_getTimeElapsed() function which is copied from the BLDC example.

The program can be downloaded to the board and the LED is flashing as wish. However, the period data keeps zero when I give PTE11 a 3V 1kHz PWM signal, which means the Icu_getTimeElapsed() function gets nothing returned.
I really appreciate it if you or anybody could check my configuration file and Simulink model, and tell me what is wrong and how can I get period data successfully. It is really important for me.
thanks again!
Best regards,
regulus