This repository is no longer maintained and has been archived.
For the latest updates and ongoing development, please visit our new repository at WIZnet-PICO-LWIP-C.
lwIP Example for RP2040
This repository is no longer maintained and has been archived.
For the latest updates and ongoing development, please visit our new repository at WIZnet-PICO-LWIP-C.
I'm building a project where I hope to use the W5100S with the LWIP IP stack, and
noticed gcc complaining about several set but unused (never read) variables.
For example, in w5x00_lwip.c:110:
send_len
is set but never used.crc
calculated by ethernet_frame_crc
is never used.The example code seems to work, so I assume (2) is okay because the W5100S calculates the CRC?
Is this repository the best reference for using the W5100S with LWIP, or should I be looking elsewhere?
err_t netif_output(struct netif *netif, struct pbuf *p)
{
uint32_t send_len = 0;
uint32_t tot_len = 0;
memset(tx_frame, 0x00, sizeof(tx_frame));
for (struct pbuf *q = p; q != NULL; q = q->next)
{
memcpy(tx_frame + tot_len, q->payload, q->len);
tot_len += q->len;
if (q->len == q->tot_len)
{
break;
}
}
if (tot_len < 60)
{
// pad
tot_len = 60;
}
uint32_t crc = ethernet_frame_crc(tx_frame, tot_len); // crc set, never used
send_len = send_lwip(0, tx_frame, tot_len); // send_len set, never used
return ERR_OK;
}
This is really a question, as a result of a question on the WIZnet forum (topic 10579).
Why does the code in wizchip_initialize() block until LINK UP is established? So when called if the ethernet cable is unplugged or the switch is down the call would not return. See code at line 211 here: https://github.com/Wiznet/RP2040-HAT-LWIP-C/blob/main/port/ioLibrary_Driver/src/w5x00_spi.c
Would it do any harm to just return the LINK status rather than looping to wait for LINK_UP? or can it just return no matter what the LINK status is?
Unplugging and re-plugging the cable back in once the network is up results in full recovery.
This call is made in nearly all of the example programs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.