K64F: System stops when ethernet cable isn't plugged in

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K64F: System stops when ethernet cable isn't plugged in

Jump to solution
1,655 Views
tobiaswellnitz
Contributor II


Hi,

 

I was playing around with the WebServer example (for FreeRTOS), with the SDK 2.0. I noted the uC execution is aborted when I initialise the interface (netif) and the ethernet connector is not plugged in.

 

This seems to be a bit unfortunate, since I have another task which handles some basic IO Input.

 

Investigating this issue with the debugger, shows me that the problem is within the PHY initialization (fsl_phy.c). In particular in PHY_Init().

 

PHY_Init() - line 84/85:

result = PHY_Write(base, phyAddr, PHY_BASICCONTROL_REG,

    (PHY_BCTL_AUTONEG_MASK | PHY_BCTL_RESTART_AUTONEG_MASK));

 

How can I initialise Ethernet / lwip without depending on a physically connected cable?

 

I presume the auto negotiation has to be replaced with fixed values, right?

 

Thanks,

Tobias

Labels (1)
Tags (4)
1 Solution
1,192 Views
butok
NXP Employee
NXP Employee

Hi Tobias,

Please disable the assert in ethernetif.c, low_level_init():

#if 0 /* Disable assert. If initial auto-negation is timeout,

        the ENET set to default 100Mbs and full-duplex.*/

    if (count == ENET_TIMEOUT)

    {

        LWIP_ASSERT("\r\nPHY Link down, please check the cable connection.\r\n", 0);

    }

#endif

It must help.

Best regards,

Andrey Butok

View solution in original post

5 Replies
1,193 Views
butok
NXP Employee
NXP Employee

Hi Tobias,

Please disable the assert in ethernetif.c, low_level_init():

#if 0 /* Disable assert. If initial auto-negation is timeout,

        the ENET set to default 100Mbs and full-duplex.*/

    if (count == ENET_TIMEOUT)

    {

        LWIP_ASSERT("\r\nPHY Link down, please check the cable connection.\r\n", 0);

    }

#endif

It must help.

Best regards,

Andrey Butok

1,192 Views
tobiaswellnitz
Contributor II

Thanks Andrey,

this did the trick.

Tobias

0 Kudos
1,192 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Tobias,

I have reported this to the KSDK team, and they are going to fix it in the next release. Thanks for your patience!


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,192 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Tobias,

Which platform did you run the webserver from ksdk 2.0? Would you please help to clarify? Thanks for your patience!


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,192 Views
tobiaswellnitz
Contributor II

Hey Kan,

The Platform is an K64F freedom board.

Thanks,

Tobias

Am 10.03.2016 um 07:32 schrieb Kan_Li <admin@community.freescale.com>:

NXP Community

K64F: System stops when ethernet cable isn't plugged in

reply from Kan_Li in Kinetis Software Development Kit - View the full discussion

Hi Tobias,

Which platform did you run the webserver from ksdk 2.0? Would you please help to clarify? Thanks for your patience!

Have a great day,

Kan

>

0 Kudos