S32K344 eMios instance 1 channel 7 interrupt does not fire

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

S32K344 eMios instance 1 channel 7 interrupt does not fire

2,222 Views
KGStafl
Contributor I

Hi NXP team,

We are developing on an S32K344 processor and trying to configure eMios instance 1 channel 7 as an ICU IPWM using signal measurement mode. We have 3 other channels configured as ICU IPWM that work just fine but eMios instance 1 channel 7 doesn't trigger an interrupt after calling Emios_Icu_Ip_StartSignalMeasurement(instance_, channel_config_.hwChannel). We have another channel, eMios instance 1 channel 5 that uses the same interrupt and works fine which makes this more confusing. All channels are configured in S32DS and are using the same settings. 

I was stepping through the code and s_emiosBase[1]->CH.UC[7].S does not get modified and just stays 0, when the other channels actually set the flag event bit.

I'm not sure what else to do at this point, as it almost seems that this channel doesn't exist.

Any assistance appreciated.

-Kyle Garland 

0 Kudos
Reply
10 Replies

2,211 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Kyle Garland,

Based on your description, it sounds strange. If it is convenient, send me the simplified test project so that I can check the configuration.
Also, which S32K3 board did you use for testing? Is the eMIOS1_CH7 pin you configured connected to the signal you input on this board?


Best Regards,
Robin

0 Kudos
Reply

2,128 Views
KGStafl
Contributor I

Hi Robin,

Here is a small sample project that shows are current configs as well as the emios icu interrupts we are using. The main function is very minimal and really is just there to get things to compile. As a reminder, we have 4 pwm inputs in which 3 of the 4 are working. The channel in question is emios instance 1 channel 7. Let me know if there is anything else you need from me and thank you for the support!

-Kyle

0 Kudos
Reply

2,103 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Which S32K344 board did you use? By externally inputting a 100kHz PWM waveform to PTC7, the program can enter the following parts during debug.

 /* If captured */
if(ic_result_temp_1.PeriodTime)
{
/* Stop measuring */
Emios_Icu_Ip_StopSignalMeasurement(EMIOS1, EMIOS1_ch7);
captured_1 = 1;
}

I don't know why customer configure PTC7 as eirq, so I delete it.

PTC7 emios_1_ch_7_h eirq7.png

0 Kudos
Reply

2,098 Views
KGStafl
Contributor I

Hey Robin,

We have connected a PWM waveform to that port and are not receiving an interrupt for just that PWM input pin only, the other 3 from the project work fine. We removed the eirq setting on PTC7 and the problem still exists. This is on our custom hardware, but I am working to re-create on a MR_CANHUB344 devkit.

-Kyle

Tags (1)
0 Kudos
Reply

2,092 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Emios_Icu_Test_for_nxp breakpoint EMIOS1_4_IRQn_customized.png100kHz PWM signal input.jpg

100kHz external generated PWM signal connect to the P5.2 of MR-CANHUBK344.

MR-CANHUBK344 P5.2 PWM input.jpg

0 Kudos
Reply

2,089 Views
KGStafl
Contributor I

Hi Robin,

Thanks for verifying. Any idea's what may be wrong on our custom hardware project? I've had the EEs do some simple verification and there is definitely connectivity, and the project config settings are the same. It's strange that the interrupt registers correctly for instance 1 channel 5 but not instance 1 channel 7. Appreciate the help!

 

-Kyle Garland

0 Kudos
Reply

2,081 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Please test on the MR-CANHUBK344 board according to the information I sent you in private message. If the MR-CANHUBK344 board can capture, it is recommended that you check the hardware of the customer's board (including chip part number, MaskSet)

0 Kudos
Reply

1,957 Views
KGStafl
Contributor I

Hey Robin, 

We ended up fixing the issue, and it turned out it wasn't a hardware problem at all. When configuring port c pin 7 for emios 1 channel 7, s32 does not generate the correct settings. The generated code in the pin config shows inputBuffer as PORT_INPUT_BUFFER_NOT_AVAILABLE, which means the IMCR does not get set to the correct value during Siul2_Ip_PortInit()

    {
        .base                        = IP_SIUL2,
        .pinPortIdx                  = 71u,
        .mux                         = PORT_MUX_AS_GPIO,
        .safeMode                    = PORT_SAFE_MODE_NOT_AVAILABLE,
        .inputFilter                 = PORT_INPUT_FILTER_NOT_AVAILABLE,
        .driveStrength               = PORT_DRIVE_STRENTGTH_NOT_AVAILABLE,
        .pullConfig                  = PORT_INTERNAL_PULL_NOT_ENABLED,
        .pullKeep                    = PORT_PULL_KEEP_NOT_AVAILABLE,
        .invert                      = PORT_INVERT_NOT_AVAILABLE,
        .inputBuffer                 = PORT_INPUT_BUFFER_NOT_AVAILABLE,
        .outputBuffer                = PORT_OUTPUT_BUFFER_NOT_AVAILABLE,
        .adcInterleaves              = { MUX_MODE_NOT_AVAILABLE, MUX_MODE_NOT_AVAILABLE },
        .inputMuxReg                 = {
                                         87u
                                       },
        .inputMux                    = { 
                                         PORT_INPUT_MUX_ALT4,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT
                                       },
        .initValue                   = 2u
    },

If we manually change .inputBuffer = PORT_INPUT_ENABLED, this channel ends up working as intended. Is there an issue with the code generation that prevents some pins from not being configured correctly? My colleague saw the same thing for LPSPI1. We are using RTD4.

0 Kudos
Reply

1,481 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

After delete eirq,7 did you click Update Code? I have checked Siul2_Port_Ip_Cfg.c of your attached project Emios_Icu_Test_for_nxp.zip: .inputBuffer = PORT_INPUT_BUFFER_ENABLED.

Could you share the S32DS version you are using and also the RTD version? (There are many S32K3 RTD 4.0.0 patches available.) We want to verify if this is a problem related to a specific version of the tool. I am using S32K3_S32M27x Real-Time Drivers AUTOSAR R21-11 Version 4.0.0 HF01, I didn't encounter this problem.

S32K3 RTD 4.0.0 patch.png

0 Kudos
Reply

2,201 Views
KGStafl
Contributor I

Hi Robin,

Thanks for the response. Let me take some time to setup a simplified test project and I'll send that over to you. I'll also send over some images that may help in the meantime that might show something.

We are using the S32K344 processor on our custom hardware. I had our EEs check the trace and there's definitely continuity. I also tried a different board and the problem still persists so it must be a config issue or something in my firmware. 

-Kyle

0 Kudos
Reply