I have a question in connection with the lwIP concerto example. The lwIP timer is served in a SysTick interrupt handler. But what will happen if i have an infinite loop for example in my data sending function? Will a next SysTick interrupt occur or SysTick interrupt is disabled somewhere in the lwipTimer() function?Thanks in advance.Regards,Tamas
The definition of lwIPTimer() is found in .\MWare\utils\lwiplib.c. It simply triggers the Ethernet interrupt handler by forcing a software trigger of the Ethernet Interrupt in the NVIC.
Brandon
Hi Brandon,Thank you for your last answer. My question is focusing on the interrupt events. Why doesn't happen a SysTickInterrupt during the EthernetInterrupt?They SysTickInterruptHandler() call the lwIPTimer() which triggers the EthernetInterruptHandler(). And for example if i have an UDP packet sender in the EthernetInterruptHandler() which works in an infinite loop, the SysTickInterruptHandler() and so the lwipTimer() are not called anymore. But why not?I think the UDP packet sender is handled in the Ethernet interrupt not in the lwIPTimer() since it just trigger the Ethernet Interrupt. Obviously i am wrong, but i would like to know have it works.
The lwIPEthernetIntHandler() interrupt service routine for the Ethernet MAC (triggered by lwIPTimer()), runs the handling of the interrupt within the interrupt context IF this is configured to run without an OS (ie. NO_SYS precompiler flag is set). This is found in lwiplib.c.
To trace through this, I performed a series of greps to trace through the call path. You should be able to perform the same and see the concertoif_interrupt() is either called within the lwIPEthernetIntHandler() if NO_SYS is defined, or in a process that is pending on a semaphore if a RTOS is used. If the RTOS is used, the concertoif_interrupt() is likely called in a task that has interrupts reenabled.
Thank you Brandon for the help! My problem was that i needed a precise time and sometimes the SysTick wrapped while i was in the Ethernet Interrupt Handler. So at that time i always got a wrong system time. That is why i didn't understand the concept of the example program, but now i could eliminate this issue with the reading of the COUNT flag of the STCTRL register which set if the systick reach the zero value. And if i would like to create a timestamps for an IP packet i can calculate it.
Best regards,Tamas