ENC28J60 on Netduino2Plus

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
User avatar
martinayotte
Posts: 1170
Joined: Mon Apr 27, 2015 1:45 pm

ENC28J60 on Netduino2Plus

Postby martinayotte » Wed Jul 01, 2015 12:12 am

Hi !

If your seen the other thread, I was stuck with a hangs on readOp(ENC28J60_READ_CTRL_REG, ESTAT) during ENC28J60 initialize().
After spending hours, I've narrow the problem. First, I wasn't sure about SPI init() since the ENC28J60 is hookup with several pins differences against normal SPI(1), but it was still not working. Opening again the Netduino2Plus schematic, I've got the light coming to me : the 25MHz oscillator is shared between STM32F405 and the ENC28J60, but not a direct connection, the STM32 provide the derivative Clock thru GPIO PA8 as and MCO1 alternate. So, I've struggled to have that init code added in rrcF2.c. Bingo ! The ENC28J60 is now having its clock !!! :)
So, the initialize() doesn't hang any more on readOp(ENC28J60_READ_CTRL_REG, ESTAT) !!! And I'm now been able to ping my Netduino2Plus board ! ;)

@Roger, I will clean my code and send you a PR soon.

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

Re: ENC28J60 on Netduino2Plus

Postby martinayotte » Wed Jul 01, 2015 9:10 pm

Some more success !
Since the Serasidis_EtherCard_STM library didn't provide a TCPServer yet, I've decide to continue my work already started on the "arduino_uip" library by porting the changes done in Serasidis_EtherCard_STM/src/enc28j60.cpp file into the arduino_uip/utility/Enc28J60Network.cpp file that was having AVR direct register access to AVR SPI. After few hours, I've got the merge done and I have now a TcpServer example working on my Netduino2Plus !
Hourra !!! :D

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

Re: ENC28J60 on Netduino2Plus

Postby Vassilis » Thu Jul 02, 2015 6:19 am

Well done martinayotte!

The Arduino_UIP (UIPEthernet) library is a 100% compatible with the standard arduino Ethernet library. So, that are all sketches that are written for arduino Ethernet, will work on your ported library.

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

Re: ENC28J60 on Netduino2Plus

Postby martinayotte » Thu Jul 02, 2015 1:42 pm

Thanks !

At first, I started to merge your Ethernet_STM library into your Serasidis_EtherCard_STM library, but I've quickly figured out that was a tedious task.

So, I will do some clean up on Arduino_UIP codes and push it into my branch and send a PR to Roger soon.

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

Re: ENC28J60 on Netduino2Plus

Postby martinayotte » Wed Jul 15, 2015 2:20 am

Since all basics components seems to works nicely on Netduino2Plus,
I've decided to post on Netduino forum (I've not log there since 2 years, I had to reset password :) ) to invite people to come on our stm32duino forum.
I just hoping that there won't be question's flood ... :)

Valery
Posts: 14
Joined: Fri Jan 08, 2016 8:19 pm

Re: ENC28J60 on Netduino2Plus

Postby Valery » Mon Apr 18, 2016 4:38 pm

Hello!
Vassilis wrote:Well done martinayotte!

The Arduino_UIP (UIPEthernet) library is a 100% compatible with the standard arduino Ethernet library. So, that are all sketches that are written for arduino Ethernet, will work on your ported library.


Does Anybody have UIPEthernet for STM32F1?

I just cant to understand, how to receive the full response from server using Serasidis_EtherCard_STM ...
How to change the webClient examle for receive to serial the whole response instead 700 Bites

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

Re: ENC28J60 on Netduino2Plus

Postby martinayotte » Mon Apr 18, 2016 4:49 pm

From what I remember from last summer, after I've achieved it on F405, I've gave it a try with MapleMini and it was working.
But those experiment were done with the UIPEthernet examples, bot with the one from Serasidis_EtherCard_STM, although there might be some similarities.

Valery
Posts: 14
Joined: Fri Jan 08, 2016 8:19 pm

Re: ENC28J60 on Netduino2Plus

Postby Valery » Mon Apr 18, 2016 8:55 pm

I'll try,
Thank you.

Quintessence
Posts: 4
Joined: Tue May 10, 2016 10:17 pm

Re: ENC28J60 on Netduino2Plus

Postby Quintessence » Wed May 11, 2016 10:46 am

Hey stm32duino community,

I'm new here and I got started with a blue Pill, which was really full of bugs at the beginning (locked chip, too long name of the FTDI board on OSX, at least I programmed it via a CH340 board...).
I installed the ported UIP Library on my Arduino 1.6.7 IDE and it was compiled and uploaded to the chip succesfully, other Test Sketches ran quite good (Blink and Serial Sketches).

I wanted to test the AdvancedChatServer Sketch, which did not work. I checked the wiring often (SPI Interface number one PinA4-7), checked it on the other SPI interface etc but it did not work...

I got just one hint, which maybe helps here: After bootup the Board tells you via Serial on what IP adress it is available. In my sketch it is: 192.168.0.6
So I had a look at the serial output of the Board after bootup and it said: Chat server address:100706496
So there is something wrong.

Does anyone have an idea what this can be?

@Martinayotte: You said, it worked on your MapleMini last year, what can be the difference here?

Thanks a lot for your comments and I'm sorry for this newbie questions! I think the UIP Lib is really important for the STM32duino, because it takes so much RAM of the Arduino UNO to run larger sketches than the example, so I think it is really worth to make it work on the BluePill ;)

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

Re: ENC28J60 on Netduino2Plus

Postby martinayotte » Wed May 11, 2016 12:51 pm

Quintessence wrote:In my sketch it is: 192.168.0.6
So I had a look at the serial output of the Board after bootup and it said: Chat server address:100706496
So there is something wrong.


The Serial output you've mentioned doesn't look like an IPAddr, how did you print it ?

Quintessence wrote:@Martinayotte: You said, it worked on your MapleMini last year, what can be the difference here?

Yes, it was working and I had some kind of Telnet server running on the MapleMini.

Maybe if you show piece of your code we can try to figure out what's wrong if you details the symptoms ...


Return to “STM32F4 Boards”

Who is online

Users browsing this forum: tom and 2 guests