2017-09-25 06:23 AM
Hey guys,
for speed optimization I want to use ethernet interrupt when a new packet recieves. For this, first I changed heth.Init.RxMode to ETH_RXINTERRUPT_MODE and after that I added the interrupt handler with:
void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef *heth)
{ }This works so far fine. For example I can toggle a LED in the interrupt handler.
Now I removed the ethernetif_input(&gnetif); call from the main while loop and put it into the interrupt handler.
Well, this isn't working really fine. I recieve a few packets, but then the interrupt isn't calling anymore.
So I searched for my mistake and had an idea. What happens when a packet is in the stack and a interrupt is calling?
Now I changed the interrupt handler to this:
void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef *heth)
{NVIC_DisableIRQ(ETH_IRQn);
ethernetif_input(&gnetif);NVIC_EnableIRQ(ETH_IRQn);}Now it's working better, but after round 20 recieved packets it took about 5 seconds between sending a packet from the pc to the call of the interrupt. And with every received packet it's getting more worse, until I receive no more packets.
Where is my mistake?
Thank you.
2017-10-18 08:21 AM
Hello
jurij.zapusek
,Which device using ?
Kind Regards
Imen
2017-10-26 01:35 AM
Hallo
Imen,
It's a STM32F107.
And I think I know my mistake. I'm calling the hole lwIP-Stack in an interrupt routine, was isn't realy nice. I think I get a stack overflow in the controller, so that the controller isn't working any more.
2019-01-06 04:09 AM
have the same issue
2019-01-06 04:21 PM
When receive interrupt is triggered, You must read all (!!!) received packets not just one.
P.S. Old ST examples and demos (for example STM3210C-EVAL demo firmware) are also working ridiculously slow and unstable most likely because of this bug.
2019-01-16 04:33 AM
Hallo
How to read all (!!!) received packets ?
2019-01-20 03:54 PM
low_level_input() must be called repeatedly (and packets processed) until it returns NULL.
2019-02-26 07:36 AM
Hi, I am using Nucleo-F767ZI, and I want to setup an interrupt to send data over ethernet every occurring interrupt. Any ideas?
Thank you!