6 years, 11 months ago.

mbed os 5 and ethernet modules using SPI

Hi,

I'm having problems compiling an "Ethernet" library for a Ethernet module I want to use. It is based on a w5500 chip and interfaces over SPI. This should be super simple and straight forward, and I have had it working with multiple variations of Arduinos and ethernet modules in the past.

The main problem seems to be that mbed os 5 wants to be an actual os, by defining some of the networking abstractions in the EthernetInterface. But all of the ethernet library implementation that I can import in the online compiler do not implement the EthernetInterface, but instead define most of these themselves, e.g., Socket.h. This is course clashes with redeclaration errors and more.

My question is:

How are SPI based ethernet modules supposed to be supported with mbed os 5? Through a driver layer implementing the various SPI command under the EthernetInterface API?

Regards, Bent

Also, here after a week of troubleshooting deep down the mbed source files, it turns out that if using "mbed-dev" library instead of "mbed" everything works like a charm... The tricky part was that with the "mbed" library things nearly work, but then suddenly very weird behavior occurs with debugger and dev environment...

posted by Bent Christensen 09 May 2017

1 Answer

6 years, 11 months ago.

Hello,

lot of programs published here are using older EthernetInterface library that is not compatible with mbed-os one.

You can import ESP826 6driver - https://github.com/ARMmbed/esp8266-driver, and have a look how it is implemented.

Accepted Answer

Hi Martin,

Ok, thanks.

At least I wanted to be sure I was not missing an obvious mbed os configuration setting somewhere.

I managed to get the W5500Interface library up and running by adding a namespace qualifier around the classes in the W5500Interface library causing the redeclaration error.

posted by Bent Christensen 02 May 2017