Board used for Development: S32K344
Module : ICU
We are working on S32K344 hardware and configured ICU(Input capture unit) module for detecting both rising edge and falling edge triggering functionality.
ICU module is configured by referring the NXP example configuration. To test it, we are feeding PWM signal as input to ICU pin.
When it detects the signal, interrupt is triggered but the handler is not being serviced and left unhandled. Because of this Unhandled IRQ, error hook is thrown.
We confirmed this by checking the interrupt source when it causes error hook. It is same as the interrupt source number of EMIOS_0_Channel_7.
We also tried with different priority and different EMIOS channels but the issue seems to be still same.
Below are the ICU and Port configurations implemented:
ICU EMIOS channel configuration:
Instance 0;
Channel 7;
Bus used is EMIOS_ICU_BUS_A
Sub measurement mode is SAIC
ICU Channel:
Measurement mode is SIGNAL EDGE DETECT with default start edge as BOTH EDGES
Signal notification function is configured and defined.
MCL EMIOS channel configuration for ICU:
Instance 0;
Channel 23;
Counter - MCB UP COUNTER;
Default Period - 65535
Port configuration for ICU:
PIN used - PTE7
Pcr number - 135
Pin mode - eMIOS_0eMIOS_0_CH_7_G_IN
Initial mode: GPIO Mode
OS Configuration for Interrupt trigger:
Vector Interrupt source number - 81
Handler Function - EMIOS0_4_IRQ (instance 0 with interrupt request 7)
Followed below sequence in Init Phase:
Icu_Init(NULL_PTR);
Icu_EnableEdgeDetection(Icu_Channel);
Icu_EnableNotification(Icu_Channel);
Attached snapshots of configurations for reference.
Please let me know if you need additional information.
@sathyaganesr @WojciechK @Hector_Torre
I am facing the Similar issue Did anyone manage to have a solution.
Hello @Sathishkumar_Rajkumar,
Can you share the project?
Have you enabled the interrupt in the code?
BR, Daniel
Hello @danielmartynek
I am using EMIOS instance 0 and Channel 7 in ICU module and
configured EMIOS instance 0 and channel 23 in MCL module for ICU EMIOS BUS REF.
Also I am using Port Pin PTE7 (PCR:135, PIN Mode: eMIOS_0eMIOS_0_CH_7_G_IN)
Could you please tell me which Interrupt Source /Interrupt handler function should be configured for the above channel configurations. Because it is not clear which one should be used.
The ICU channel, that is EMIOS_0_Ch7.
extern ISR(EMIOS0_4_IRQ);
IntCtrl_Ip_InstallHandler(EMIOS0_4_IRQn, &EMIOS0_4_IRQ, NULL_PTR);
IntCtrl_Ip_EnableIrq(EMIOS0_4_IRQn);
Emios_Icu_Ip_EnableInterrupt(0, 7);
BR, Daniel
Yeah, we have also configured the same IRQ Handler (EMIOS0_4_IRQ).
I am calling Icu_EnableEdgeDetection interface at Init phase which in turn calls Emios_Icu_Ip_EnableInterrupt. So, I hope this should be fine to enable the interrupt.
Also instead of Platform module interfaces like InstallHandler and EnableIrq, we have configured interrupt in OS (Category 2 ISR) which will take care of triggering the interrupt.
And the thing is, interrupt is getting triggered, when input is fed to the ICU pin, but it is left unhandled. Which means interrupt request is not assigned to the corresponding ISR. So, we are not sure whether the interrupt handler function (EMIOS0_4_IRQ) from MCL is mapped properly to the Interrupt source.
Is there any other specific configuration to be enabled for mapping IRQ with interrupt ?
Hard to say, it would be better if I could test your project (or at least a simplified version of it) on my side.
You can refer to this example though:
BR, Daniel
Hello @danielmartynek
Due to company policy it is tough to share the project.
It would be really helpful if you could join a debug session.
Please let me know your calendar to schedule the session.
Regards,
Sathish
Our technical support does not provide debug sessions.
You can create a ticket and share the project there privately.
It does not have to be the whole project but a test project that replicates the issue.
BR, Daniel
Hi @danielmartynek
Could you please share the steps to create ticket.
Go to nxp.com and login,
you should see Support Tickets as below.
Thank you,
BR, Daniel
Hi Daniel,
We have the same issue as below link and we already attached our project in the post, please help to check it. Thanks a lot.
https://community.nxp.com/t5/S32K/S32K344-MCAL-IPWM-ICU-CAPTURE/m-p/1543046#M18511
Wade