NuttX on a Netduino Plus 2; setup Ethernet

OK, after the trouble with the SD card, which I thought would be a drop-kick, I’m a little daunted going into this one.  We’ll see!  But I definitely know more starting out.

So, first thing is code, and I found a project with an enc28j60 in it, and there is a up_enc28j60.c module in it, so I copy it over and commence to modifying.

Now I need clock.  On this board, the Ethernet controller chip (a Microchip ENCJ28J60) is clocked from A8 using a thing called MCO1 on the HSE.  Blablablah.  This actually was straightforward to setup, and I remembered my power control line this time.  I bind the driver to the spi in a manner similar to how it’s done with the SD card.  No kooky status to convey.

Now I need to build.  How?!  I have a devil of a time trying to figure out how to select ‘Network Devices’.  Its supposed to become available once you select networking support but I’ll be damned but that did not do it.  I crowbarred it open by setting the parameter in defconfig.  Then I was able to get to the to the ENC28J60 settings, which I setup.

Build fails.  There actually is a web of options that all need to be set correctly to get a build to go through to completion.  Things like ‘enable the worker thread’ and ‘enable socket options’ and ‘do not disable clock interfaces’ and ‘do not enable SLIP support’.  Eventually I get a build.  (I punted on a couple that were NSH related by disabling get, put, wget commands, but eventually I figured them out also and enabled them).

Now I can build, and it kinda works.  But often I get an assertion:

Assertion failed at file:net/enc28j60.c line: 1433

(sigh).  OK that has to do with packet pointers being wildly wrong (way overflowing buffers, etc.).  So back to the groups I go asking if anyone has seen this, and simultaneously I read source.  But first, I sleep….

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s