arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
259 stars 264 forks source link

SAMD51 (M4) based boards fail to communicate #99

Open BrunDog opened 5 years ago

BrunDog commented 5 years ago

Hi,

Testing new SAMD51 (M4) based boards from Adafruit (Metro M4 and Grand Central M4, both based on the SAMD51)... using same simple chat server example.

Does not communicate with W5100 or W5500 based shields (Ethernet.hardwareStatus() returns EthernetNoHardware), Ethernet.localIP() returns no IP despite a static assignment, etc.

This leads me to believe there is an incompatibility with SAMD51 & W5x00.

BrunDog commented 5 years ago

Figured out the issue... w5100.h and w5100.cpp do not reference the SAMD51. I added definitions for this micro, which solved the problem.

That said, the library does need to be updated - I just don't know how to do that. Will let the admins do it.

dondipietro commented 4 years ago

Hello Can you explain with modification you made ? Do you added this ?

#elif defined('__SAMD51__')
    static volatile uint32_t *ss_pin_reg;
    static uint32_t ss_pin_mask;
    inline static void initSS() {
        ss_pin_reg = portModeRegister(digitalPinToPort(ss_pin));
        ss_pin_mask = digitalPinToBitMask(ss_pin);
        pinMode(ss_pin, OUTPUT);
    }
    inline static void setSS() {
        *(ss_pin_reg+5) = ss_pin_mask;
    }
    inline static void resetSS() {
        *(ss_pin_reg+6) = ss_pin_mask;
    } 
bluespider42 commented 4 years ago

Does this library work with the M4 boards? what changes need to be made?

sahlex commented 2 years ago

I've got the same problem. When using the shield with SAMD21 (SparkFun RedBoard Turbo) it works like charm. My Adafruit Metro M4 (SAMD51) doesn't detect the shield.