LPC1788 - ENET_IRQHandler()

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1788 - ENET_IRQHandler()

1,214 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LPC_Buzz on Wed Jul 17 14:53:08 MST 2013
Hi,

I'm using NXP's EMAC Driver lpc177x_8x_emac.c.
When a packet is received, in the ENET_IRQHandler() a callback function registred as Emac_ConfigStruct.pfnFrameReceive is called.

If I spend a longer time processing the packet in this function (and implicitly in the interrupt routine) and during this a second packet is received, [u]it will not fire the interrupt again[/u]. The interrupt will be fired later, when the third packet arrives, and the EMAC driver will present actually the second packet as being ready to be processed.

In this scenario, I will receive the packet number N only when packet N+1 arrives.

Any idea how can I troubleshoot this? Making the interrupt routine faster works, but I need to make the system work in my scenario, with slower ENET_IRQHandler().

Thank you.
标签 (1)
0 项奖励
回复
2 回复数

1,113 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LPC_Buzz on Thu Jul 18 15:26:35 MST 2013
Thanks for your answer, Wolfgang.

The driver from NXP actually has a while loop inside the ENET_IRQHandler() which should do exactly what you suggested, but it doesn't work as expected.

Your ideea to handle the packet in another lower priority software interrupt is interesting, I will try it.
0 项奖励
回复

1,113 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Wed Jul 17 22:56:00 MST 2013
There are some possible solutions to this problem:

a) do the packet processing not in this interrupt. Instead, fire an interrupt from software (you can use any non-used interrupt handler for this.) Give this "bottom half" interrupt a lower priority.

b) put a do - while loop inside your interrupt handler, checking for a new packet before you leave the handler.

regards
Wolfgang

0 项奖励
回复