Git Product home page Git Product logo

rp2040-hat-lwip-c's Introduction

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.

rp2040-hat-lwip-c's People

Contributors

giungkim avatar min-hs avatar wizhannah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rp2040-hat-lwip-c's Issues

w5x00_lwip.c: unused Ethernet CRC

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:

  1. send_len is set but never used.
  2. The 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;
}

do/while loop in wizchip_initialize() in w5x00_spi.c is blocking if network cable is unplugged

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.