Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Visitor
vigneron
Posts: 5
Registered: ‎04-08-2011

Xilkernel LWIP Socket API does not block when it should.

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.

 

 

Visitor
lipatievrs
Posts: 1
Registered: ‎08-05-2011
0

Re: Xilkernel LWIP Socket API does not block when it should.

Good day!

 

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:

   

#if !NO_SYS
    xemac->sem_rx_data_available = sys_sem_new(0);
#endif

 

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_services\lwip130_v1_00_b" to "sw_services". Then go to "$YOUR_WORKSPACE_PATH\sp_xilkernel\sw_services\lwip130_v1_00_b\src\contrib\ports\xilinx\netif\xlltemacif.c" and fix the bug in source file. Don't forget to rebuild software platform and all dependent projects to feel changes. That's all.

 

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.

 

Good luck!