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.
Hi @SParihar
According to this image shared, you have configured the interruption of EMIOS 0 CH 0 instead of CH 5.
B.R.
VaneB
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().
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?
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);
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.
Hi @SParihar
Did you make any other changes in the configuration apart from those shown in the images? Clock frequency? Peripherals?