|
From: | Rastislav Uhrin |
Subject: | [lwip-users] R: R: R: R: ping slow down |
Date: | Fri, 10 Jun 2016 20:31:53 +0200 |
Problem with ping delay has been solved! Not really. I have discovered that when PC is connected directly with cable to my target, ping response is always very short. When I connect board through cable to router (netgear) and PC is connected through wifi, this 60sec period delay appears. Thanks for support rum Da: lwip-users [mailto:address@hidden Per conto di Noam Weissman Hi Rastislav, We talked about it before but let me summarize it once more. Interrupt are triggered as they happen and disturb the application. If you use a variable /array or some other data both from interrupt and application you must synchronize the sharing. Example: if you read data from an array (app side) and in the middle you get an interrupt that writes to the same array you may have a problem. To avoid the above the OS gives the user the ability to surround a small code with a protecting "critical section". Critical section will mask interrupts for a short period and assure that while handling that shared data it will not change from ISR. The above is great, but !!! .... there is a big but. Under Cortext-M3 critical section will only work if the OS runs at a higher interrupt priority then the that interrupt that the user wants to mask. That means that (priorities): 15 - highest . . . 0 - lowest If you set TCP interrupt to 3 and OS time tick interrupt to 5 the OS will not mask the TCP interrupt when inside a critical section. OS should be set to 3 and TCP to 5 etc... BR, Noam. http://www.freertos.org/RTOS-Cortex-M3-M4.html http://www.freertos.org/a00110.html
From: lwip-users <address@hidden> on behalf of Rastislav Uhrin <address@hidden> Hi Greg, Thank you for your contribution. But if from interrupt you want to signal semaphore its number must be “higher” than MAX_SYSCAL_INTERRUPT_PRIORITY. If the slowdown exists with only lwIP probably problem will be in the driver. This is my thought. Thanks rum Da: lwip-users [mailto:address@hidden] Per conto di Greg Smith Hi, Rastislav and Noam. Noam, thank you for those links. I used similar ones for the ST part and they were very helpful. I hope Rastislav finds them useful, too. Rastislav, the approximate priorities of your tasks is very similar to how I have mine setup. I'm not an expert (I'm still learning lwIP myself), but it seems about right and is working for me. About your task priorities: be careful not to mix together your hardware's (Infineon's) IRQ priorities and FreeRTOS' priorities -- they don't relate to each other. So 20 (out of 63) is approximately where I put my MAX_SYSCAL_INTERRUPT_PRIORITY. (Technically, I have mine as 7 out of 15). If the other task, the one at 25, is triggered by a hardware interrupt, then I think you have it set too low. It should probably be set to a higher priority (i.e. a lower numerical value, say 19). If that "25" is a FreeRTOS task priority, then there is no relation and it will always get pre-empted by a hardware IRQ. (At least, that is my understanding of FreeRTOS.) I would also suggest using far fewer RTOS task levels -- maybe 5 or 7 at most. (That is set with configMAX_PRIORITIES.) There's an art to interrupts and priorities, which makes it a little hard to describe in an E-mail. So please ask if you have more questions. Good luck! -- G From: lwip-users [mailto:address@hidden] On Behalf Of Noam Weissman Hi Rastislav, Check the following link if they have some info that may help you. http://www.freertos.org/Infineon-ARM-Cortex-M4-XMC4000-RTOS.html http://www.freertos.org/FreeRTOS-for-Infineon-XMC4000-Cortex-M4.html BR, Noam. From: lwip-users [mailto:address@hidden] On Behalf Of Rastislav Uhrin Hi Greg, Thanks for your thoughts. I am exactly on same configuration as you except I am using Infineon C4. I want to ask about priorities of RTOS tasks ETHRx - task which extracts frame fills pbuf and sends to tcpip, waits on semaphore from interrupt – RTOS priority is say “middle” TCPIP - task of lwIP – RTOS priority “higher” My application task working with sockets – RTOS priority “lowest” Of course in real application there are more 12 other tasks with different priorities. Is this arrangement correct? About MAX_SYSCAL_INTERRUPT_PRIORITY this is 20 (of 63) and task which sends semaphore is 25 (“lowest interrupt priority” ). There are some other 10 interrupts distributed, some bellow 20 which need to run always, other above 20 which need to be disabled by OS when needed. But I have build simple application with only lwIP and nothing else and ping is delayed. I was puzzled by this regular behavior. Thanks rum Da: lwip-users [mailto:address@hidden] Per conto di Greg Smith Hi, Rastislav. This email has been scanned for email related threats and delivered safely by Mimecast. This email has been scanned for email related threats and delivered safely by Mimecast. |
[Prev in Thread] | Current Thread | [Next in Thread] |