eMIOS GPT ISR

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

eMIOS GPT ISR

4,804 Views
SParihar
Contributor III

I am trying to make a project which uses eMIOS GPT to produce a periodic interrupt and blink the LED by defining the ISR. But on buiding undefined reference to 'EMIOS0_5_IRQ' error is coming.

Please tell me how can I solve this error and a proper way to define any ISR.

Tags (1)
0 Kudos
9 Replies

4,790 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @SParihar 

VaneB_1-1705606880400.png

According to this image shared, you have configured the interruption of EMIOS 0 CH 0 instead of CH 5.

 

B.R.

VaneB

 

 

0 Kudos

4,770 Views
SParihar
Contributor III

I want to configure interruption of eMIOS0 Channel 0. For this channel I need to set EMIOS0_5_IRQ according to the interrupts list.
And I have updated the interrupt channel in Peripheral Configuration Tool. But still same error is coming.

0 Kudos

4,741 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @SParihar 

Sorry for not explaining correctly. 

The error shown in S32DS could be caused by the configuration of the ISR in the IntCtrl_Ip. In this configuration, you do not define the handler. So, when you call extern ISR(EMIOS0_5_IRQ) as the handler is not defined causes the error "undefined reference to". 

If you refer to the PIT example you use as a reference, you will see that the handler is defined as PIT_0_ISR, which will be used in extern ISR().

VaneB_0-1705698505390.png

 

0 Kudos

4,734 Views
SParihar
Contributor III

If I define ISR similar to PIT example as shown in the picture, then also the same error comes.
I think either I am giving a wrong handler name (EMOIS_5_IRQ) in the Peripheral tool or I am not correctly installing the handler in the code.

0 Kudos

4,533 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @SParihar 

If it is possible, Could you share your code? So, I can test it from my side?

Also, could you provide the device you are using, the IDE, and the RTD version?

0 Kudos

4,416 Views
SParihar
Contributor III

i am using S32 Design Studio 3.5 with layest update. RTD 4.0.0. I am using the s32k3x4evb t172 board.

0 Kudos

4,199 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @SParihar 

I look deep into your project and the following are my observations: 

 

/* Initialize EMIOS instance 0 - Channel 0 */
//Emios_Gpt_Ip_InitChannel(EMIOS0_CH0, &EMIOS_0_ChannelConfig_PB[1]);
Emios_Gpt_Ip_InitChannel(EMIOS0_INST, &EMIOS_0_ChannelConfig_PB[1]);
/* Enable channel interrupt EMIOS 0 - CH_0 */
Emios_Gpt_Ip_EnableChannelInterrupt(EMIOS0_INST, EMIOS0_CH0);
/* Install IRQ handler for EMIOS */
//IntCtrl_Ip_InstallHandler(EMIOS0_5_IRQn, EMIOS0_5_IRQ, NULL_PTR);
//IntCtrl_Ip_EnableIrq(EMIOS0_5_IRQn);
IntCtrl_Ip_Init(&IntCtrlConfig_0);
IntCtrl_Ip_EnableIrq(EMIOS0_5_IRQn);
void PitNotification(void)

 

The EMIOS clock is 160MHz and the EMIOS0_INTERVAL needs to be a value of 16bits. 

You need to have a loop to wait for the interrupt to occur - while (1).

 

//extern void EMIOS0_5_IRQ(void);

 

VaneB_0-1706568283653.pngVaneB_1-1706568293250.png

0 Kudos

4,152 Views
SParihar
Contributor III

Sorry for the late reply,
I applied the changes you suggested and now the project is getting build without any errors.
But when running, the program goes into while loop and then gets stuck in the hard fault handler. It never goes into the PitNotification function.

0 Kudos

4,133 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @SParihar 

Did you make any other changes in the configuration apart from those shown in the images? Clock frequency? Peripherals? 

0 Kudos