Ethernet icon indicating copy to clipboard operation
Ethernet copied to clipboard

SAMD51 (M4) based boards fail to communicate

Open BrunDog opened this issue 5 years ago • 4 comments

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.

  • Does communicate with the SD card on board both shields, so I am confident it is not a wiring issue or bus (plus nothing to wire as its a straight shield plug-in). Additionally, exact code works correctly with M4 boards using Ethernet2 library.

  • Identical code works correctly on MEGA2560, Due, Uno with both W5100 and W5500 shields.

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

BrunDog avatar May 23 '19 19:05 BrunDog

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.

BrunDog avatar May 24 '19 01:05 BrunDog

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;
	} 

dondipietro avatar Apr 27 '20 19:04 dondipietro

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

bluespider42 avatar Jul 01 '20 12:07 bluespider42

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.

sahlex avatar Sep 26 '22 11:09 sahlex