How to use EIM on K344

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use EIM on K344

Jump to solution
1,155 Views
Sylvia_jiang
Contributor III

SPD 1.0.1 has been setup successfully in S32DS 3.5. I tried to add some codes of EIM in example code SPD_101_S32K344 as below :

Main()

{

        eMcem_Init(&eMcem_Config_0);

        Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);

        eMcem_SetupInjectionChannel(EMCEM_EIM_CH_0, 0, 1);

        eMcem_InjectFault(EMCEM_EIM_CH_0);

        for(;;)
        {
              if(exit_code != 0)
             {
                    break;
             }
        }
        return exit_code;

}

Errors happened in debugging code "pEim->EICHD[u16EimChannel].WORD[0] = channelCfg.EICHD_WORD[0];" of Function eMcem_Eim_SetupInjectionChannel (), and jump to

void HardFault_Handler(void)

{

          while(TRUE) {};

}

 

Tags (1)
0 Kudos
1 Solution
1,056 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Sylvia_jiang,

I just sent you another project with the functionality that you are looking for.

The project is officially available at the SafeAssure NDA community:

https://community.nxp.com/t5/SafeAssure-NDA-group/S32K344-Example-for-EIM-and-ERM-module/m-p/1458016

 

https://community.nxp.com/groups/safeassure-nda

REQUESTING ACCESS for SafeAssure NDA group: to get safety documents and receive expert support

https://community.nxp.com/docs/DOC-335524

 

BR, Daniel

 

View solution in original post

0 Kudos
10 Replies
1,044 Views
Sylvia_jiang
Contributor III

Hi Daniel,

     I wonder if hardfault occurs with other debugger. but I don't have any other debugger except Multilink. Would you mind testing my own project?

Looking forward to your reply

BR,

Sylvia.

0 Kudos
1,046 Views
Sylvia_jiang
Contributor III

hi Daniel,

    I really appreciate for your reply! I have requested SafeAssure NDA community and been waiting for reply. In private message you say "I just tested the eMcem_SetupInjectionChannel() using PE Micro Multilink and I get a hardfault. But not with Lauterbach / Segger J-Trace. I understand you use PE Micro too. Do you have any other debugger?". I don't have any other debugger.  when I test it at removing PE Micro Multilink and let it free run hardfault recurs. I think hardfault  that caused by eMcem_SetupInjectionChannel() has nothing to do with debugger.

0 Kudos
1,037 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Sylvia,

I sent you the example in a private message.

Can you test it?

Regarding the debugger, it was probably an issue on my side,

 

Regards,

Daniel

0 Kudos
1,001 Views
Sylvia_jiang
Contributor III

hi Daniel,

     The second project hasn't been built successfully. I haven't know these module and disable them. Have those disabled modules influenced on EIM running ?

Sylvia_jiang_0-1679017588040.png

 

0 Kudos
987 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Sylvia_jiang,

As far as I know, these modules should not impact the EIM.

Once you have access to the SafeAssure NDA community, I would recommend posting any safety related questions there. Also, you can follow-up in the thread of the example.

Thank you,

 

Regards,

Daniel

0 Kudos
924 Views
Sylvia_jiang
Contributor III

Hi Daniel

     I really appreciate for your help ! I am tring to debug it.

 

BR,

Sylvia

0 Kudos
1,136 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Sylvia_jiang,

I just sent you an example,

 

BR, Daniel

0 Kudos
1,115 Views
Sylvia_jiang
Contributor III

Hi Daniel,

     Thanks for your code and i really appreciate it ! Could I ask you about something?

Q1: eMcem_SetupInjectionChannel is not called. Is it not necessarry for eMcem_InjectFault ?

Q2: FCCU 0 pin output is high level and FCCU 1 is low level after eMcem_Init and they keep the same level after inject Fault 15. Is it the correct reaction?

Q3: Alarm Handler of Fault 15 is defined as eMcemUserAlarmHandler. How can I trigger this handler?

Looking forward to your updates!

0 Kudos
1,076 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Sylvia_jiang,

Yes, according to S32K_SPD_EMCEM_UM,

danielmartynek_0-1678455594570.png

 

I will need to test it on my side.

 

Regards,

Daniel

 

 

 

 

 

0 Kudos
1,057 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Sylvia_jiang,

I just sent you another project with the functionality that you are looking for.

The project is officially available at the SafeAssure NDA community:

https://community.nxp.com/t5/SafeAssure-NDA-group/S32K344-Example-for-EIM-and-ERM-module/m-p/1458016

 

https://community.nxp.com/groups/safeassure-nda

REQUESTING ACCESS for SafeAssure NDA group: to get safety documents and receive expert support

https://community.nxp.com/docs/DOC-335524

 

BR, Daniel

 

0 Kudos