eMIOS GPT ISR

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

eMIOS GPT ISR

22,073件の閲覧回数
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.

タグ(1)
0 件の賞賛
返信
9 返答(返信)

22,059件の閲覧回数
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 件の賞賛
返信

22,039件の閲覧回数
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 件の賞賛
返信

22,010件の閲覧回数
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 件の賞賛
返信

22,001件の閲覧回数
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 件の賞賛
返信

21,800件の閲覧回数
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 件の賞賛
返信

21,683件の閲覧回数
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 件の賞賛
返信

21,466件の閲覧回数
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 件の賞賛
返信

21,418件の閲覧回数
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 件の賞賛
返信

21,399件の閲覧回数
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 件の賞賛
返信