wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

SOLVED: LAN9514 Ethernet issue after reboot

Thu Aug 30, 2018 8:49 am

I have made a fully working carrier board for the CM3L which includes a LAN9514 for USB and Ethernet functionality.
The device works fine and all USB ports function correctly. However the ethernet has some bugs..

When powered on, i can insert the ethernet cable and it works fine (connects to the network and internet fine). However if i then reboot the pi the ethernet stops working (unless i unplug and re-plug the ethernet cable). During the reboot process the lights on the ethernet jack seem to turn off during the splash screen text sequence-thing.
NOTE: after reboot the USB functionality remains absolutely fine.

Has anyone ever experience this before? My suspicion is that its something to do with the LAN_RUN pin functionality on a CM3L (i think i remember reading somewhere that this is not enabled on a compute module).

Any help would be much appreciated!
Last edited by wj_12 on Wed Sep 12, 2018 9:17 am, edited 1 time in total.

aBUGSworstnightmare
Posts: 861
Joined: Tue Jun 30, 2015 1:35 pm

Re: LAN9514 Ethernet issue after reboot

Thu Aug 30, 2018 9:23 am

How do you configure your GPIO - via dt-blob.bin i.e.?

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Thu Aug 30, 2018 10:13 am

I haven't made any changes to dt-blob at this time no, setup of alternate functions of GPIO etc have been made in config.txt and for a capacitive touch panel these have been made in a device tree overlay

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1819
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: LAN9514 Ethernet issue after reboot

Thu Aug 30, 2018 11:13 am

You may need a custom dt-blob.bin declaring the LAN_RUN pin for your board, in order that the reset works as expected.

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Thu Aug 30, 2018 12:37 pm

Thanks Phil, i've looked around but can't find anything yet, could you point me in the right direction of some resources which might help me to write a custom dt-blob?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1819
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: LAN9514 Ethernet issue after reboot

Thu Aug 30, 2018 12:45 pm

There's a general guide here: https://www.raspberrypi.org/documentati ... uration.md
and a good starting point here: https://www.raspberrypi.org/forums/view ... p?t=172619
It's configured to have LAN_RUN on GPIO 31, but a quick search-and-replace will allow you to move it elsewhere.

You will need to add ETH_CLK unless you have a real 24/25MHz oscillator hooked up to the 9514.

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Thu Aug 30, 2018 12:56 pm

Thats great thanks Phil, i will get going on this as soon as and feedback my results!
I have a 25MHz clock on my board so just the LAN_RUN to change for me.

John Westlake
Posts: 62
Joined: Thu Nov 09, 2017 4:34 am

Re: LAN9514 Ethernet issue after reboot

Fri Aug 31, 2018 8:22 am

Just to confirm when you say you have the "25MHz oscillator on your board" - that if your using a crystal connected directly to the LAN9514 that you have a 1Mohm resistor connected across this crystal (so between Xin and Xout).

Its seems that the Microchip Datasheet is non to clear on this and others have missed this resistor across the crystal (This Resistor bias the LAN9514 oscillator circuit into the linear region). Without this resistor fitted the symptoms are as you describe - LAN drops some period after boot.

Ps - sorry I didn't fully read your original post (my bad) -I've left my message here encase others hit upon this thread via a search engine with clock issues...

I can confirm that LAN_RESET is required after re-boot - without Reset after Reboot the LAN is not seen by the OS... (otherwise the LAN works OK without the Reset connected aslong as you don't reboot).
Last edited by John Westlake on Fri Aug 31, 2018 8:28 am, edited 1 time in total.

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Fri Aug 31, 2018 8:26 am

Yep i have a 1MOhm resistor across my 25MHz crystal. I closely based my design on the following document released by microchip:

http://ww1.microchip.com/downloads/en/D ... 14_sch.pdf

PS to your PS :D - The crystal is still something that has left me wondering, so it is something i might still investigate. I noticed the one i have chosen has a typical drive of 50uW rather than the 100uW of the recommended device on the document i posted above.

The thing i find strange with the LAN_RUN being the issue is that after reboot the USB function of the 9514 still works, it is only the ethernet which does not..
Last edited by wj_12 on Fri Aug 31, 2018 8:33 am, edited 1 time in total.

John Westlake
Posts: 62
Joined: Thu Nov 09, 2017 4:34 am

Re: LAN9514 Ethernet issue after reboot

Fri Aug 31, 2018 8:30 am

Sorry - we cross posted, I was just in the process of editing my post (above)...

The LAN_RESET will solve the Reboot issue :)

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Fri Aug 31, 2018 8:39 am

I have also just edited mine in reply haha

Some feedback to PhilE on my dt-blob - i have created a custom dt-blob with the LAN_RUN set to GPIO pin 6 (as it is on my board) with the following code:

Code: Select all

/dts-v1/;

/ {
  videocore {

    pins_cm3 {

      pin_config {

        [email protected] {
          polarity = "active_high";
          termination = "pull_down";
          startup_state = "inactive";
          function = "input";
        }; // pin

        // BANK 0 //
        [email protected]  { function = "i2c0";   termination = "pull_up";    }; // I2C0 SDA
        [email protected]  { function = "i2c0";   termination = "pull_up";    }; // I2C0 SCL
        [email protected]  { function = "i2c1";   termination = "pull_up";    }; // I2C1 SDA
        [email protected]  { function = "i2c1";   termination = "pull_up";    }; // I2C1 SCL
        [email protected]  { function = "input";   termination = "pull_up";    }; // NOT USED (DEFAULT STATE)
        [email protected]  { function = "input";   termination = "pull_up";    }; // NOT USED (DEFAULT STATE)
        [email protected]  { function = "output";  termination = "no_pulling"; }; // LAN_RUN
        [email protected]  { function = "input";   termination = "pull_up";    }; // NOT USED (DEFAULT STATE)
        [email protected]  { function = "input";   termination = "pull_up";    }; // NOT USED (DEFAULT STATE)
        [email protected]  { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "uart0";   termination = "no_pulling"; }; // UART0_TX
        [email protected] { function = "uart0";   termination = "pull_up";    }; // UART0_RX
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)

        // BANK 1 //
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "uart1";   termination = "no_pulling"; }; // UART1_TX
        [email protected] { function = "uart1";   termination = "pull_up";    }; // UART1_RX
        [email protected] { function = "input";   termination = "pull_up";    }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "no_pulling"; }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "no_pulling"; }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)
        [email protected] { function = "input";   termination = "pull_down";  }; // NOT USED (DEFAULT STATE)

      }; // pin_config

      pin_defines {
        [email protected]_RUN { type = "internal"; number = <6>; }; // LAN_RUN
  
      }; //  pin_defines

    }; // pins_cm

  }; // videocore
};
But i have had no success so far, admittedly i have not observed this with a scope yet to see the activity on the LAN_RUN pin. However using this dt-blob i did have an issue where the pi would not boot to the desktop and would get extremely hot, so i cycled the power and everything was fine again...

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Fri Aug 31, 2018 10:13 am

Ok so i probed the LAN_RUN pin on my board on boot-up and observed it holds the line low for 150ms. On reboot the following happens:

Image

I did the same on another one of my boards which does not have the custom dt-blob and nothing happens at all (the line stays high on both boot-up and reboot)

This to me would say the LAN_RUN is doing what it is supposed to do.

Something i did observed is that on reboot the status and link lights on the Ethernet plug flicker but never fully turn on.

John Westlake
Posts: 62
Joined: Thu Nov 09, 2017 4:34 am

Re: LAN9514 Ethernet issue after reboot

Sat Sep 01, 2018 1:23 pm

wj_12 wrote:
Fri Aug 31, 2018 8:26 am
Yep i have a 1MOhm resistor across my 25MHz crystal. I closely based my design on the following document released by microchip:

http://ww1.microchip.com/downloads/en/D ... 14_sch.pdf

PS to your PS :D - The crystal is still something that has left me wondering, so it is something i might still investigate. I noticed the one i have chosen has a typical drive of 50uW rather than the 100uW of the recommended device on the document i posted above.

The thing i find strange with the LAN_RUN being the issue is that after reboot the USB function of the 9514 still works, it is only the ethernet which does not..
I'd be surprised if you had an issue with Crystal Drive current - my understanding is that Crystal drive current is more of a long-term reliability issue (and impacts Phase-Noise) neither applicable to your current issues (the Phase Noise difference of x2 drive current is NOT important in this application).

Might be worth using your scope to observe the Clock during reboot... but as USB still functions I'd not put the clock too high up the potential issue list...

Yes - USB still working after reboot without LAN_RUN connected is normal - only the LAN not responding after reboot was the observed behavior.

Might be worth trying a RPi3 board with LAN_RUN disconnected just to get a 'Feel' of whats going on :) - the documentation is pretty poor for the CM3, so having a RPi3 to refer to and play with is a great help...

Ps. good for the posting the Microchip LAN9514 reference schematic - I'd not seen it before..

BTW:- you do have the LAN_RUN connected directly to the CM3 GPIO and not with the typical R/C Reset Gen fitted (R21 / C29 on the MicroChip Schematic)? Your scope shoots suggest you don't have the Resistor / Cap fitted (Good)...

You could try a manual Reset after reboot - I'm sure the CM3 GPIO will survive being briefly pulled (shorted) low...
Last edited by John Westlake on Sat Sep 01, 2018 10:42 pm, edited 2 times in total.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1819
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: LAN9514 Ethernet issue after reboot

Sat Sep 01, 2018 3:32 pm

If you do want to disconnect LAN_RUN then a less disruptive way is with another custom dt-blob.bin. However, the Pi 3 drives the clock from a GPCLK pin which is configured by software, and it is important that the clock is present when the device is brought out of reset - which it won't be after a power on reset.

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Tue Sep 04, 2018 11:16 am

John Westlake wrote:
Sat Sep 01, 2018 1:23 pm
I'd be surprised if you had an issue with Crystal Drive current - my understanding is that Crystal drive current is more of a long-term reliability issue (and impacts Phase-Noise) neither applicable to your current issues (the Phase Noise difference of x2 drive current is NOT important in this application).

Might be worth using your scope to observe the Clock during reboot... but as USB still functions I'd not put the clock too high up the potential issue list...

Yes - USB still working after reboot without LAN_RUN connected is normal - only the LAN not responding after reboot was the observed behavior.
The clock seems to be fine during reboot when i views it on my scope. As for the USB still working, it does this with or without the LAN_RUN pin "connected" (enabled in dt-blob). So simply the presence of a working LAN_RUN pin to reset the chip doesn't seem to make any difference to the issue, odd!
BTW:- you do have the LAN_RUN connected directly to the CM3 GPIO and not with the typical R/C Reset Gen fitted (R21 / C29 on the MicroChip Schematic)? Your scope shoots suggest you don't have the Resistor / Cap fitted (Good)...
Yes it is connected directly to the GPIO pin.

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Fri Sep 07, 2018 2:50 pm

So i've just performed a test which has some interesting results.

I used the wiringpi commands to manually control the reset pin for the LAN9514.

e.g.

Code: Select all

gpio write 27 1
gpio write 27 0

etc..
I wrote a quick shell script which would pull the pin low for 2 seconds and then high again:

Code: Select all

#!/bin/bash

gpio write 27 0
sleep 2 
gpio write 27 1
Test 1:
USB keyboard and mouse plugged in and working, run the shell script and see the mouse LED turn off for 2 seconds and turn back on again. Both devices are working fully again.

Test 2:
USB keyboard and mouse AND ethernet cable plugged in and connected to the network. Run the shell script and the devices power off and ethernet connection lost. The shell script never gets to the point where it pulls the pin high again and seems to be stuck in a loop/crashed as the script does not finish. This means no LAN9514 and no usb/ethernet, a power cycle is needed to acess the pi again!

wj_12
Posts: 14
Joined: Mon Jul 30, 2018 8:30 am

Re: LAN9514 Ethernet issue after reboot

Wed Sep 12, 2018 9:16 am

It appears i had made an error in assembling the board, and had mixed up a 49R9 resistor with a 10R resistor, meaning the ethernet had very limited functionality. oops!

Thank you to all who have helped me, frustrating that it is a silly mistake but also relieved that the design works!

John Westlake
Posts: 62
Joined: Thu Nov 09, 2017 4:34 am

Re: SOLVED: LAN9514 Ethernet issue after reboot

Wed Sep 12, 2018 10:05 am

Great you have it working, always hard when your not sure if its a software or hardware issue...

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1819
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: SOLVED: LAN9514 Ethernet issue after reboot

Wed Sep 12, 2018 10:06 am

And it's usually software...

aBUGSworstnightmare
Posts: 861
Joined: Tue Jun 30, 2015 1:35 pm

Re: SOLVED: LAN9514 Ethernet issue after reboot

Wed Sep 12, 2018 11:10 am

Another 'Error#60' issue...

... Means error caused by the person sitting 60cm in front of the DUT :D

Glad it's working now!

Return to “Compute Module”

Who is online

Users browsing this forum: No registered users and 2 guests