• AVR Freaks

Hot!LAN8720 seems to fail while tcpip stack keeps working?

Page: 12 > Showing page 1 of 2
Author
Frankaas
Starting Member
  • Total Posts : 46
  • Reward points : 0
  • Joined: 2018/12/12 02:02:21
  • Location: 0
  • Status: offline
2019/02/28 14:50:04 (permalink)
0

LAN8720 seems to fail while tcpip stack keeps working?

Hi there, I am back with another ethernet related conundrum...
 
I am working with a PIC32MX795F512L with an SMSC 8720 PHY. I am using MPLAB X IDE v5.10, Harmony v2.06 and XC32 v2.10.
 
I use the Harmony TCPIP stack with UDP, ICMPv4 and ARP which has been running fine. So now it was time to test our board with the other peripheral hardware (some relays, LED's, buttons etc.). For the most part, this works fine, however sometimes, the switching of a relay seems to upset the ethernet. The symptoms are:
 
- The microcontroller keeps running, there doesn't seem to be a problem there.
- No more packets seem to be sent (Wireshark shows nothing) or received while the LEDs on the board do indicate that this condition is true: if( TCPIP_UDP_IsConnected( appData.clientSocket ) && ( tcpipStat >= 0 )) so that it can send a heartbeat packet. But the heartbeat packets do not show up on Wireshark.
- It is not possible to ping the board. 
- The LEDs on the RJ45 connector behave differently each time this occurs, sometimes the green one is off, sometimes the green one is on and the orange is off, sometimes the green is on and the orange one is blinking.
- After resetting the microcontroller and PHY (unfortunately the reset pins of both are connected on the board we have so they cannot be reset separately) all works fine again.
- Scope images of the supply of the LAN8720 show quite large (+-2V) fluctuations while the relay is switched.
 
While this problem is most likely an EMC issue which we are looking into solving but it might not be possible, I would also very much like to know how it is possible that the microcontroller doesn't seem aware that something is off. It would be nice if it could detect something like this and reset the PHY and/or itself. Any ideas are very welcome. 
 
Thanks!!!
 
Franka
#1

39 Replies Related Threads

    rainad
    Super Member
    • Total Posts : 1192
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/01 07:50:44 (permalink)
    0
    The TCPIP_UDP_IsConnected() means only that the socket has a valid destination address so it is able to send data.
    The tcpipStat reflects the initialization status of the stack.
    So these tests are not really meaningful for your case.
    Most likely there's something that upsets the PHY on your board, these being sensitive devices.
    Not much diagnostic is available on the data path between the MAC and the PHY.
    However:
    - use the miim driver from the console to read the PHY registers. It may give some clue of what state the PHY is in after this happens
    - monitor the communication between the MAC and the PHY using the "macinfo" command. This will show you if there is any more traffic between the MAC and the PHY, if there are errors, etc.
    Once we know these details we may be able to get closer to the real cause.
     
    #2
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/04 14:03:36 (permalink)
    0
    Hi Rainad,
     
    Thank you for your answers and ideas! I still did not manage to get the friggin' &#@* USB console working on my board and I unfortunately don't have a UART available which makes debugging quite difficult. I've searched around the forum and looked at the documentation but no matter what I try, my PC refuses to recognize the PIC  (the code does compile). I've tried installing drivers etc but so far nothing has worked. I think I will have to try to find a way to have access to a UART...
     
    Are you saying that there is no way at all for the microcontroller to know whether the PHY is in good shape? Of course we want to fix the (most likely EMC) issue that is causing the PHY to get upset but in the meantime it would be nice to be able to reset it or something in case it occurs. Even if we fix the issue, it is a nice idea that an error on the PHY side is at the very least detected. Is there not even a PHY_get_status() type function available? I've found DRV_MIIM_Status( SYS_MODULE_OBJ hSysObj )DRV_ETHMAC_PIC32MACStatus( SYS_MODULE_OBJ object ) and DRV_ETHPHY_Status( SYS_MODULE_OBJ hSysObj ) but all these seem geared toward the status of the driver software in the PIC and not the PHY. As far as I've understood from the LAN8720 datasheet, it has status registers which I should be able to read.
     
     
    #3
    rainad
    Super Member
    • Total Posts : 1192
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/05 07:33:50 (permalink)
    0
    If you have an UART port that has the I/O pins available, then you need just 2 wires + ground coming out of the board for a serial connection, it can be done for testing purposes.
    As I suggested, try to read the PHY registers using the MIIM commands, and there are there some error and status registers that could give some indications. You can read those from the console or from your code, if you want to do some dynamic diagnostics.
    The same is true on the data transfer side: you can use the MAC registers to see if the data is transferred correctly between the MAC and the PHY or there are persistent errors. Use "macinfo" from the console or use the corresponding calls at run time.
    #4
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/06 07:29:39 (permalink)
    0
    Yeeeaahhh I FINALLY got the console (USB) and commands to work!!! Would've been better if I had gotten it to work a few months ago but I am extremely happy that it works now! If I try to set which PHY registers to dump, it seems to set the start register to 0 as requested, but it also sets the end register to 0. If I attempt to set the start register or end register to something other than 0 it returns saying it is set to 0 anyway.
     
    This is what is shown in the terminal window:
    >miim start r 0
    miim: Set Start Reg to: 0

    >miim end r 30
    miim: Set End Reg to: 0
     
    As far as I see in the LAN8720 datasheet, it has 14 registers, starting at 0 and ending at 31. I have not been able to find whether I am suppose to use these register numbers/addresses or if the PIC has aliases for them or something.
     
    Can somebody perhaps point out what I'm missing/doing wrong here?
     
    Thanks very much as always for the support!
     
    Franka
     
     
    #5
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/06 09:32:09 (permalink)
    0
    Oke, I feel a little silly, I just found out that I should replace the r with the desired value (register number) and now it is working fine. Will report back with my findings with regard to the upset PHY.
    #6
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/06 09:34:45 (permalink)
    0
    This is what comes out of the console with MIIM dump, macinfo and heapinfo when the PHY is upset:

    >Miim Dump Reg: 0, add: 0, val: 0x 0
    Miim Dump Reg: 1, add: 0, val: 0x780d
    Miim Dump Reg: 2, add: 0, val: 0x 7
    Miim Dump Reg: 3, add: 0, val: 0xc0f1
    Miim Dump Reg: 4, add: 0, val: 0x 1a1
    Miim Dump Reg: 5, add: 0, val: 0x 1
    Miim Dump Reg: 6, add: 0, val: 0x 0
    Miim Dump Reg: 7, add: 0, val: 0xffff
    Miim Dump Reg: 8, add: 0, val: 0xffff
    Miim Dump Reg: 9, add: 0, val: 0xffff
    Miim Dump Reg: 10, add: 0, val: 0xffff
    Miim Dump Reg: 11, add: 0, val: 0xffff
    Miim Dump Reg: 12, add: 0, val: 0xffff
    Miim Dump Reg: 13, add: 0, val: 0xffff
    Miim Dump Reg: 14, add: 0, val: 0xffff
    Miim Dump Reg: 15, add: 0, val: 0x 0
    Miim Dump Reg: 16, add: 0, val: 0x 40
    Miim Dump Reg: 17, add: 0, val: 0x 2
    Miim Dump Reg: 18, add: 0, val: 0x6000
    Miim Dump Reg: 19, add: 0, val: 0xffff
    Miim Dump Reg: 20, add: 0, val: 0x 0
    Miim Dump Reg: 21, add: 0, val: 0x 0
    Miim Dump Reg: 22, add: 0, val: 0x 0
    Miim Dump Reg: 23, add: 0, val: 0x 0
    Miim Dump Reg: 24, add: 0, val: 0xffff
    Miim Dump Reg: 25, add: 0, val: 0xffff
    Miim Dump Reg: 26, add: 0, val: 0x 0
    Miim Dump Reg: 27, add: 0, val: 0x b
    Miim Dump Reg: 28, add: 0, val: 0x 0
    Miim Dump Reg: 29, add: 0, val: 0x 80
    Miim Dump Reg: 30, add: 0, val: 0x 0
    Miim Dump Reg: 31, add: 0, val: 0x 44
     
    >macinfo
    Interface: PIC32INT driver statistics
    nRxOkPackets: 13290, nRxPendBuffers: 0, nRxSchedBuffers: 4, nRxErrorPackets: 0, nRxFragmentErrors: 0
    nTxOkPackets: 1238, nTxPendBuffers: 0, nTxErrorPackets: 0, nTxQueueFull: 0
    Interface: PIC32INT hardware statistics
    FRMTXOK : 0x 4d6
    FRMRXOK : 0x 33ea
    RXBUFCNT: 0x 0
    RXOVFLOW: 0x 0
    FCSERROR: 0x 40c9
    ALGNERR : 0x 0
    SCOLFRM : 0x 0
    MCOLFRM : 0x 0
    >heapinfo
    Usage: heapinfo 1/2/3
    Ex: heapinfo 1

    >heapinfo 1
    Heap type: internal. Initial created heap size: 44912 Bytes
    Allocable block heap size: 36256 Bytes
    All available heap size: 36256 Bytes, high watermark: 11920
    Last heap error: 0x0
    No Trace info exists.
     
    And this is what comes out when all is fine:
    >Miim Dump Reg: 0, add: 0, val: 0x1100
    Miim Dump Reg: 1, add: 0, val: 0x782d
    Miim Dump Reg: 2, add: 0, val: 0x 7
    Miim Dump Reg: 3, add: 0, val: 0xc0f1
    Miim Dump Reg: 4, add: 0, val: 0x de1
    Miim Dump Reg: 5, add: 0, val: 0xcde1
    Miim Dump Reg: 6, add: 0, val: 0x 9
    Miim Dump Reg: 7, add: 0, val: 0xffff
    Miim Dump Reg: 8, add: 0, val: 0xffff
    Miim Dump Reg: 9, add: 0, val: 0xffff
    Miim Dump Reg: 10, add: 0, val: 0xffff
    Miim Dump Reg: 11, add: 0, val: 0xffff
    Miim Dump Reg: 12, add: 0, val: 0xffff
    Miim Dump Reg: 13, add: 0, val: 0xffff
    Miim Dump Reg: 14, add: 0, val: 0xffff
    Miim Dump Reg: 15, add: 0, val: 0x 0
    Miim Dump Reg: 16, add: 0, val: 0x 40
    Miim Dump Reg: 17, add: 0, val: 0x 2
    Miim Dump Reg: 18, add: 0, val: 0x60e0
    Miim Dump Reg: 19, add: 0, val: 0xffff
    Miim Dump Reg: 20, add: 0, val: 0x 0
    Miim Dump Reg: 21, add: 0, val: 0x 0
    Miim Dump Reg: 22, add: 0, val: 0x 0
    Miim Dump Reg: 23, add: 0, val: 0x 0
    Miim Dump Reg: 24, add: 0, val: 0xffff
    Miim Dump Reg: 25, add: 0, val: 0xffff
    Miim Dump Reg: 26, add: 0, val: 0x 0
    Miim Dump Reg: 27, add: 0, val: 0x a
    Miim Dump Reg: 28, add: 0, val: 0x 0
    Miim Dump Reg: 29, add: 0, val: 0x c8
    Miim Dump Reg: 30, add: 0, val: 0x 0
    Miim Dump Reg: 31, add: 0, val: 0x1058
    macinfo
    Interface: PIC32INT driver statistics
    nRxOkPackets: 11867, nRxPendBuffers: 0, nRxSchedBuffers: 4, nRxErrorPackets: 0, nRxFragmentErrors: 0
    nTxOkPackets: 723, nTxPendBuffers: 0, nTxErrorPackets: 0, nTxQueueFull: 0
    Interface: PIC32INT hardware statistics
    FRMTXOK : 0x 2d3
    FRMRXOK : 0x 2e5b
    RXBUFCNT: 0x 0
    RXOVFLOW: 0x 0
    FCSERROR: 0x 2e
    ALGNERR : 0x 9
    SCOLFRM : 0x 0
    MCOLFRM : 0x 0
    >heapinfo 1
    Heap type: internal. Initial created heap size: 44912 Bytes
    Allocable block heap size: 36256 Bytes
    All available heap size: 36256 Bytes, high watermark: 8656
    Last heap error: 0x0
    No Trace info exists.
     
    I will dive into the various datasheets to attempt to find out what is wrong here but if you see anything obvious, please let me know ;)
     
    Thanks!!!
     
    Franka
    post edited by Frankaas - 2019/03/06 09:44:00
    #7
    rainad
    Super Member
    • Total Posts : 1192
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/06 13:18:38 (permalink)
    0
    without digging into the details, one thing is obvious from the very start: the high number of frames with CRC errors.
    So, something seems to be wrong with your board. The PHY is not working as it should.
    Then the reg 0 == 0 and reg 1: 780d instead of 782d.
    The PHY does not seem to be properly set up at this point. Probably it's been reset by some supply spike.
    I'd recommend the LAN Check service that MCHP offers.
     
    #8
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/07 01:36:07 (permalink)
    0
    Hey Rainad,
     
    Thank you for your feedback and analysis of the situation! I also suspected something like this. The problem is that we have bought (quite a lot of) these boards from a manufacturer and have not designed them ourselves. Right now we are unfortunately already at a point where we cannot spend a lot of time modifying the hardware. That is why I hoped to find a (perhaps somewhat dirty, it is what it is) workaround to detect this situation and reset/reinit/reconfigure the PHY whenever it occurs since it still only occurs sporadically. 
     
    If you have any ideas about this please let me know :)
     
    Kind regards,

    Franka
    #9
    rainad
    Super Member
    • Total Posts : 1192
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/07 07:07:35 (permalink)
    0
    You can periodically poll the MAC statistics registers. If you notice that there is no more reported traffic but the errors accumulate, you can reset the interface: Net down and then up.
    It's not perfect but it may work. You can also check the PHY status register, to check that it has lost its proper initialization values.
     
    #10
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/07 08:52:21 (permalink)
    0
    Hey Rainad,
     
    That sounds like it is the fix I need. I'm going to try to find how to read the PHY status registers and MAC statistics registers, I think reading the PHY config is preferred. However, especially the functions that actually read the PHY registers seem very well hidden/buried deep in Harmony. Which register is it that shows the packets with CRC errors (which you mention in your previous reply)? I see a difference in FCSERROR, but according to the reference manual this is related to sequence errors and even when everything is working properly, this value increases so I don't know whether I can get useful info on the state of the PHY from this. 
    #11
    rainad
    Super Member
    • Total Posts : 1192
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/07 09:35:04 (permalink)
    0
    take a look in the tcpip_commands.c that implement the "miim read" and "macinfo" commands.
    It's very simple, nothing is hidden. It's just that there's a lot of functionality so you need to know what you're looking for.
     
    #12
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/07 14:01:12 (permalink)
    0
    It might be obvious to you, but it is not to me so I guess I don't really know what I'm looking for. I believe I have found where to initiate a read but have no idea where and how to get the result... :( 
    #13
    RISC
    Super Member
    • Total Posts : 5376
    • Reward points : 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/07 15:44:50 (permalink)
    0
    Hi,
    I would suggest if you haven't done it to use the free LANcheck service from Microchip.
    You can submit your schematics and PCB layout files and you'll get feedback on your design.
    Just chose "Value Added Service" as you enter your ticket.
    Regards 
    #14
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/07 15:53:56 (permalink)
    0
    Hey RISC,
     
    Thanks for the advice and I am very curious if the design check would uncover some flaw. Rainad suggested this as well but unfortunately it is not my design. We bought these boards and I do have some schematics, but I do not have the PCB layout files. Also, if a design check was possible and a flaw would be found, it would probably be of no benefit to us now since we have no choice at this point but to use this hardware. 
     
    Kind regards,
     
    Franka
    #15
    rainad
    Super Member
    • Total Posts : 1192
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/08 11:49:49 (permalink)
    5 (1)
    Probably it's easier if you look into the drv_miim.h where the operations/APIs are explained.
    But it's not too complex:
     
    // initialization
    static const DRV_MIIM_OBJECT_BASE* miimObj = &DRV_MIIM_OBJECT_BASE_Default;
    static SYS_MODULE_INDEX miimObjIx = DRV_MIIM_DRIVER_INDEX;
     
    // To open the driver and get the handle:
    DRV_HANDLE miimHandle= miimObj->DRV_MIIM_Open(miimObjIx, DRV_IO_INTENT_SHARED);
     
    // To start a read operation:
    DRV_MIIM_OPERATION_HANDLE miimOpHandle = miimObj->DRV_MIIM_Read(miimHandle, rIx, miimAdd, DRV_MIIM_OPERATION_FLAG_NONE, &miimRes);
     
    // OK, now you need to wait, because it will take a while to read.
    // So you need a simple state machine (that is what TCPIPCmdMiimTask does)
    // That's probably what adds some complexity:
     
    uint16_t opData;
    DRV_MIIM_RESULT opRes = miimObj->DRV_MIIM_OperationResult(miimHandle, miimOpHandle, &opData);
    if(opRes == DRV_MIIM_RES_PENDING)
    { // ongoing...
    return;
    }
    if(opRes < 0)
    { // error occurred
    // display smth, etc., abort
    }
    otherwise the opData contains the value of the register.
     
     
    #16
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/11 15:35:07 (permalink)
    0
    Hey Rainad,
     
    Thanks for spelling it out for me, MIIM for dummies (me ;)) but it really helped. 
     
    I've managed to get it working in the sense that I can read the PHY and can pinpoint exactly when things are wrong. The second challenge now is to reinitialize the TCP/IP stack. The microcontroller seems to freeze or at least my LEDs are no longer blinking, I do still get responses on the console. The last message I get via the console with regard to the stack is "TCP/IP Stack: Network configuration load failed: 0".
     
    My code (state machine) for the stack down & up is below:
     
     
    bool succes;
    TCPIP_NET_HANDLE netH = TCPIP_STACK_IndexToNet( 0 );

    switch( appData.restart_state )
    {
    case BRING_NET_DOWN:
    {
    if( TCPIP_STACK_NetIsUp( netH ))
    {
    TCPIP_STACK_NetDown( netH );
    }
    else
    {
    appData.restart_state = BRING_NET_UP;
    }
    succes = false;
    }
    break;

    case BRING_NET_UP:
    {
    char new_ip_string[20];
    memset( new_ip_string, 0, 20 ); //all zeros!
    TCPIP_Helper_IPAddressToString( &NEW_CLIENT_IP, new_ip_string, 20 );

    TCPIP_NETWORK_CONFIG const config = { /*! Set new config, only IP is configurable at this point */
    .interface = TCPIP_NETWORK_DEFAULT_INTERFACE_NAME_IDX0,
    .hostName = TCPIP_NETWORK_DEFAULT_HOST_NAME_IDX0,
    .macAddr = TCPIP_NETWORK_DEFAULT_MAC_ADDR_IDX0,
    .ipAddr = new_ip_string,
    //.ipAddr = TCPIP_NETWORK_DEFAULT_IP_ADDRESS_IDX0, /* Not used */
    .ipMask = TCPIP_NETWORK_DEFAULT_IP_MASK_IDX0,
    .gateway = TCPIP_NETWORK_DEFAULT_GATEWAY_IDX0,
    .priDNS = TCPIP_NETWORK_DEFAULT_DNS_IDX0,
    .secondDNS = TCPIP_NETWORK_DEFAULT_SECOND_DNS_IDX0,
    .powerMode = TCPIP_NETWORK_DEFAULT_POWER_MODE_IDX0,
    .startFlags = TCPIP_NETWORK_DEFAULT_INTERFACE_FLAGS_IDX0,
    .ipv6Addr = NULL,
    .ipv6PrefixLen = 0,
    .ipv6Gateway = NULL,
    };
    if( TCPIP_STACK_NetUp( netH, &config ))
    {
    appData.restart_state = READY;
    succes = true;
    }
    }
    break;

    case READY:
    {
    succes = true;
    }
    break;

    default:
    // do nothing
    succes = true;
    break;
    }
    return succes;


     
     
    I've searched around a little but have only seen similar approaches that seemed to have worked. What am I doing wrong here?
     
     
    post edited by Frankaas - 2019/03/11 15:55:06
    #17
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/12 02:30:53 (permalink)
    0
    It seems like I've gotten the stack to restart now. It looks like you do not have to reopen your sockets (UDP in my case) after a network up/down? However, is it possible that the PHY is not fully initialized yet when TCPIP_STACK_Status(sysObj.tcpip) returns > 0?
     
    I poll the PHY two times a second from the moment it starts up and TCPIP_STACK_Status(sysObj.tcpip) returns > 0, it says that PHY register 0 does not have the correct settings so it restarts the network, and immediately after the restart, PHY register 0 does not have the correct settings so it just continues to restart. I figured that I should maybe ignore the PHY register values immediately after a restart to prevent this 'restart loop'.
     
    Kind regards,
     
    Franka
    #18
    Frankaas
    Starting Member
    • Total Posts : 46
    • Reward points : 0
    • Joined: 2018/12/12 02:02:21
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/12 03:34:45 (permalink)
    0
    I've found that when using the net up and down, the PHY does not seem to be reconfigured at all. Do I have to deinitialize and reinitialize the entire stack to reinit the PHY?
    #19
    rainad
    Super Member
    • Total Posts : 1192
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: LAN8720 seems to fail while tcpip stack keeps working? 2019/03/12 06:55:27 (permalink)
    0
    The PHY is reconfigured. Actually is reset and re-initialized at NetUp. You need to poll for TCPIP_STACK_NetIsReady() to see that the interface is up and ready. It can take up to 1 second because of negotiation and such.
    Please note the comments in the header file:
    "Remarks: 
    This function should be checked by all users to return true
    before starting operations on that interface."
     
    Hope this helps.
     
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5