07-08-2011 12:53 PM
I have configured hardware according to Figure 2 of the LWIP UG. I am testing the kernel in Priority Scheduling SCHED_PRIO and have found that the xemacif_input_thread will not block even if no packets are available. The loop has a semaphore for received data handling but it doesn't block even if the packet read quantity is zero.
If one wants a high priority on the network interface but doesn't want to prohibit other tasks entirely (e.g., when there is no data on the network) this is a problem. I have set break points to see that the semaphore is signaled only when data is received but that the thread will not block in any event.
Unfortunately, I don't know how to alter the library code for LWIP so that I can view the semaphore values. It seems SDK obliterates any code changes down there when the Xilikernel BSP is rebuilt.
Any clues or is this a bug outside of my control? Anyone else see this? Is there something I am not configuring in the Xilkernel?
Thanks in advance.
08-05-2011 06:32 AM
I also see this bug of lwip realization. It appears only if you use temac controller due to the uninitialized semaphore in file "xlltemacif.c" in function "low_level_init". To fix this you must add this strings to this function:
xemac->sem_rx_data_available = sys_sem_new(0);
before string "init_lltemac(xlltemacif, netif);" and than recompile library (i.e. recreate your software platform using your patched source).
From my experience the simplest way to fix library bug is to copy all library sources from install path to your workspace, than change your local copy of library source files and recompile software platform. All your changes will only be applied to your current software platform.
For instance - you want to patch and recompile lwip. Say, in your workspace you have software platform folder named "$YOUR_WORKSPACE_PATH\sp_xilkernel". Than you must first create folder "sw_services" within "sp_xilkernel" and then copy all folder "$XILINX_INSTALL_PATH\EDK\sw\ThirdParty\sw_service
All described above run for me on Xilinx SDK 11.4 but it may work on other SDK versions. Also all services and drivers sources locate in "$XILINX_INSTALL_PATH\EDK\sw". Check there if something goes wrong.