UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer cforney
Observer
1,299 Views
Registered: ‎12-22-2016

lwip library fails compile with ethernet lite

Jump to solution

The lwip202_v1_1 fails to build when using a design with the axi_ethernetlite.  It appears that the ethernet lite is not recognized as a supported device in eth_link_detect in xadapter.c and a valid xemacp and xemacs are not defined within the #if statement.  Are there any workarounds?lwip compiler error.PNG

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
1,364 Views
Registered: ‎08-25-2009

Re: lwip library fails compile with ethernet lite

Jump to solution

Could you please try to set a local repository with the modification files in SDK? BSP will get re-generated everytime if you update or clean up/regenerate the designs.

"Don't forget to reply, kudo and accept as solution."
0 Kudos
7 Replies
Moderator
Moderator
1,230 Views
Registered: ‎08-25-2009

Re: lwip library fails compile with ethernet lite

Jump to solution

Hi @cforney,

 

Which version of the Vivado/SDK you are using?

 

This is an known issue that after the upgrade to lwip202 in the 2018.1 release, some additional PHY related functionality was added in Vivado 2018.2, which has caused Emaclite functionality not to work.

In 2018.2 builds, designs with Emaclite will throw up compilation errors.

 

Please use the attached patch for 2018.2.

 

"Don't forget to reply, kudo and accept as solution."
Observer cforney
Observer
1,216 Views
Registered: ‎12-22-2016

Re: lwip library fails compile with ethernet lite

Jump to solution

Thanks,

 

I did create this using 2018.2.  That worked for the compile issue.   

 

I'm working in a windows environment so I just added to the BSP source in my SDK project.  How do I prevent the BSP from being regenerated every time I recompile or update the vivado project.   

 

Unfortunately the phy is failing to autonegotiate, but that's another conversation.

 

0 Kudos
Moderator
Moderator
1,365 Views
Registered: ‎08-25-2009

Re: lwip library fails compile with ethernet lite

Jump to solution

Could you please try to set a local repository with the modification files in SDK? BSP will get re-generated everytime if you update or clean up/regenerate the designs.

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Observer cforney
Observer
1,174 Views
Registered: ‎12-22-2016

Re: lwip library fails compile with ethernet lite

Jump to solution

I needed to modify one more line of code in xemacliteif.c.  In the get_IEEE_phy_speed_emaclite, when the code sets the autonegotiate advertise register to 100 and 10, it inadvertently clears the advertise IEEE 802.3 bit and my PHY just sat there and failed to autonegotiate.  (I'm using a TI DP83848K dev board.) So I just added the bit mask to make sure it is advertised.  It's probably better to read the register and OR in the desired speeds.

 

Old Code:

/* Advertise PHY speed of 100 and 10 Mbps */
XEmacLite_PhyWrite(xemaclitep, phy_addr,
                       IEEE_AUTONEGO_ADVERTISE_REG,
                       (ADVERTISE_100_AND_10));

 

New Code:

/* Advertise PHY speed of 100 and 10 Mbps */
XEmacLite_PhyWrite(xemaclitep, phy_addr,
                       IEEE_AUTONEGO_ADVERTISE_REG,
                       (ADVERTISE_100_AND_10 | 0x0001));

 

 

0 Kudos
Visitor lancou
Visitor
1,155 Views
Registered: ‎08-07-2018

Re: lwip library fails compile with ethernet lite

Jump to solution

Hi, this might be a silly question, but how exactly do I use this patch? Encountered the same problem. 

0 Kudos
Observer cforney
Observer
1,130 Views
Registered: ‎12-22-2016

Re: lwip library fails compile with ethernet lite

Jump to solution

Not at all.  I'm not a Linux expert and wasn't sure how to patch the code.  But since I use the windows, I opened up the .patch file with a text editor which contains the output of the "diff" command.  All of the lines with a '+' are the lines that need to be added to xadapter.c in your lwip_bsp.  I copied them below with approximate line numbers.  You're adding an #elsif to the #if directives for whatever interface was used in the design.  Somehow the ethernet lite got removed in 2018.2

 

Modify  xadapter.c

In Project bsp->ps7_corexa9_0->libsrc->lwip202_v1_1->src->contrib->ports->Xilinx->netif

 

Around line 300 add the following to define phy_link_detect

 

#elif defined(XLWIP_CONFIG_INCLUDE_EMACLITE)

static u32_t phy_link_detect(XEmacLite *xemacp, u32_t phy_addr)

{

                u16_t status;

 

                /* Read Phy Status register twice to get the confirmation of the current

                 * link status.

                 */

                XEmacLite_PhyRead(xemacp, phy_addr, IEEE_STATUS_REG_OFFSET, &status);

                XEmacLite_PhyRead(xemacp, phy_addr, IEEE_STATUS_REG_OFFSET, &status);

 

                if (status & IEEE_STAT_LINK_STATUS)

                                return 1;

                return 0;

}

 

Around line 348 add the following to define eth_link_detect

 

#elif defined(XLWIP_CONFIG_INCLUDE_EMACLITE)

static u32_t phy_autoneg_status(XEmacLite *xemacp, u32_t phy_addr)

{

                u16_t status;

 

                /* Read Phy Status register twice to get the confirmation of the current

                 * link status.

                 */

                XEmacLite_PhyRead(xemacp, phy_addr, IEEE_STATUS_REG_OFFSET, &status);

                XEmacLite_PhyRead(xemacp, phy_addr, IEEE_STATUS_REG_OFFSET, &status);

 

                if (status & IEEE_STAT_AUTONEGOTIATE_COMPLETE)

                                return 1;

                return 0;

}

 and around 377 add the following to define xemapcs and xemapp in void eth_link_detect

 

                #elif defined(XLWIP_CONFIG_INCLUDE_EMACLITE)

                                xemacliteif_s *xemacs = (xemacliteif_s *)(xemac->state);

                                XEmacLite *xemacp = xemacs->instance;

 

In get_IEEE_phy_speed_emaclite()

Modify bit mask to keep the advertise IEEE 802.3 capabilities

 

                /* Advertise PHY speed of 100 and 10 Mbps */

                XEmacLite_PhyWrite(xemaclitep, phy_addr,

                                                                IEEE_AUTONEGO_ADVERTISE_REG,

                                                                (ADVERTISE_100_AND_10 | 0x0001));

 

Good luck!

 

Observer matthiaskern
Observer
906 Views
Registered: ‎05-30-2018

Re: lwip library fails compile with ethernet lite

Jump to solution

Can we expect a software-update for this bugfix any time soon? The patch-file is not a very handy solution

0 Kudos