W5500 library is (finally) ported

Please do not post requests
User avatar
Vassilis
Posts: 323
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: W5500 library is (almost) ported

Post by Vassilis » Fri Aug 21, 2015 12:03 pm

Martin, I worked in parallel with you to solve the DHCP problem.

Finally I solve it.

Compiling with static gave me:

Code: Select all

Sketch uses 20,476 bytes (15%) of program storage space. Maximum is 131,072 bytes.
Compiling with DHCP gave me:

Code: Select all

Sketch uses 22,436 bytes (17%) of program storage space. Maximum is 131,072 bytes.
I need to run some more tests and then I will send a pull request to Roger.

User avatar
mrburnette
Posts: 2060
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: W5500 library is (almost) ported

Post by mrburnette » Fri Aug 21, 2015 12:18 pm

WOW!

Only 2% delta. I do not even have a need for the class, but may use it simply because it is so efficient! :lol:

Seriously, great job... hope your tests are all successful.

Ray

User avatar
Vassilis
Posts: 323
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: W5500 library is (almost) ported

Post by Vassilis » Sat Aug 22, 2015 7:10 pm

Thanks Ray!

The new library is ready. The old Ethernet_STM library supports only the W5100 chip and it has been published to my GitHub. From there, the Roger was created a link to his repository.
The new library supports both W5100 and W5500 chips. I have made the necessary modifications for supporting the W5200 too, but I don't have a W5200 Ethernet module to test it.

Should I replace the old "Ethernet_STM" library files on my GitHub with the new "Ethernet_STM" library files (keep the same library name) or should I create a new repository for example Ethernet2_STM ?

User avatar
martinayotte
Posts: 1239
Joined: Mon Apr 27, 2015 1:45 pm

Re: W5500 library is (almost) ported

Post by martinayotte » Sun Aug 23, 2015 3:25 am

Thanks Vassilis !
Should I replace the old "Ethernet_STM" library files on my GitHub with the new "Ethernet_STM" library files (keep the same library name) or should I create a new repository for example Ethernet2_STM ?
I don't think keep the old one is worth, since the new lib is also working with W5100, except if you know something that we don't know. ;)
That is bringing me the question, question not only for you : is the Serasidis_EtherCard_STM still useful ? If not, maybe Roger need to delete too ...

User avatar
Vassilis
Posts: 323
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: W5500 library is (almost) ported

Post by Vassilis » Sun Aug 23, 2015 7:53 am

martinayotte wrote:...That is bringing me the question, question not only for you : is the Serasidis_EtherCard_STM still useful ? If not, maybe Roger need to delete too ...
The Serasidis_EtherCard_STM library is not the same with Ethernet_STM library. The Serasidis_EtherCard_STM uses the ENC28J60 and the Ethernet_STM uses the W5x00 chips.
Both libraries produce almost the same hex file size but ENC28J60 is cheaper than W5x00 chips.

The UIPEthernet uses also the ENC28J60 chip but the compiled hex file is slightly bigger than the Serasidis_EtherCard_STM library produces.
On the other hand, the UIPEthernet is full compatible with the standard Ethernet library and the STM32 have a lot of flash memory (and CPU speed) to cover the delta size between the two libraries.

In my opinion, it's better of having the users more library options to work on.

User avatar
martinayotte
Posts: 1239
Joined: Mon Apr 27, 2015 1:45 pm

Re: W5500 library is (almost) ported

Post by martinayotte » Sun Aug 23, 2015 1:24 pm

Vassilis wrote:On the other hand, the UIPEthernet is full compatible with the standard Ethernet library
Yes, I figured that out when I've tried you W5500, I've simply took my sketch that was already using UIPEthernet, commented out headers an globals objects, put the W5500 in place, and it was ready to go !

BTW, I added UIPEthernet in github under F4 arduino_uip about a 2 months ago, maybe I should place another copy under F1 ?

User avatar
Vassilis
Posts: 323
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: W5500 library is (almost) ported

Post by Vassilis » Sun Aug 23, 2015 1:48 pm

I committed the new Ethernet_STM library.

The DHCP problem was on the "_dhcp = new DhcpClass()" as already told Martin (thanks man!). Sadly, the Martins solution didn't work for me.
So, what I did was to create a new DhcpClass object globally named _dhcp into the Ethernet_STM.cpp file and the structure dereference lines containing "_dhcp->" replace by "_dhcp."

For example the line

Code: Select all

W5100.setIPAddress(_dhcp->getLocalIp().raw_address());
was replaced by

Code: Select all

W5100.setIPAddress(_dhcp.getLocalIp().raw_address());
Of course, the lines

Code: Select all

_dhcp = new DhcpClass();
have been removed.

I think there is a problem somewhere into the compilation process because the original Ethernet library is compiled correctly for Arduino DUE and gives a small size hex file.

User avatar
martinayotte
Posts: 1239
Joined: Mon Apr 27, 2015 1:45 pm

Re: W5500 library is (almost) ported

Post by martinayotte » Sun Aug 23, 2015 3:49 pm

Vassilis wrote:The DHCP problem was on the "_dhcp = new DhcpClass()" as already told Martin (thanks man!). Sadly, the Martins solution didn't work for me.
Hi Vassilis,
What I've done using your previous version is the following :

Code: Select all

static DhcpClass s_dhcp;
[...]
//  _dhcp = new DhcpClass();
  _dhcp = &s_dhcp; 
In such case, we don't need to change all the "->" to "." ... ;)

User avatar
Vassilis
Posts: 323
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: W5500 library is (almost) ported

Post by Vassilis » Sun Aug 23, 2015 5:21 pm

martinayotte wrote:
Vassilis wrote:The DHCP problem was on the "_dhcp = new DhcpClass()" as already told Martin (thanks man!). Sadly, the Martins solution didn't work for me.
Hi Vassilis,
What I've done using your previous version is the following :

Code: Select all

static DhcpClass s_dhcp;
[...]
//  _dhcp = new DhcpClass();
  _dhcp = &s_dhcp; 
In such case, we don't need to change all the "->" to "." ... ;)
I already did that but it didn't work for me Martin. A lot of errors were appeared during compiling :?

User avatar
martinayotte
Posts: 1239
Joined: Mon Apr 27, 2015 1:45 pm

Re: W5500 library is (almost) ported

Post by martinayotte » Sun Aug 23, 2015 7:53 pm

Vassilis wrote:I already did that but it didn't work for me Martin. A lot of errors were appeared during compiling :?
Strange ... :(
I will grab your github later on, and see what could it be ...

Post Reply