Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Ethernet link-on-status on a Zynq not recognized

Posted by hannes23 on January 28, 2019

Hello, when testing exceptional conditions with the Ethernet communication on a Zynq I found out a small inconvenience. The tested condition is: Pull the cable during an existing connection and plug it in after a while. In 'NetworkInterface.c' inside prvEMACHandlerTask() it is recognized after 15 seconds, that the cable is pulled. The debug-message "prvEMACHandlerTask: PHY LS now 0" is written and the check-timeout is set to a short time, 1 second. When the cable is plugged in again and a packet is received before the ulPHYLinkStatus is read, the timeout will be set to 15 seconds. And if then within 15 seconds a new packet is received, the link-status will never be reset again to the correct value. So I added a small piece of code at the place where a packet was received to solve this nasty situation: if( xResult > 0 ) { /* A packet was received. No need to check for the PHY status now, but set a timer to check it later on. / vTaskSetTimeOutState( &xPhyTime ); xPhyRemTime = pdMSTOTICKS( PHYLSHIGHCHECKTIME_MS ); xResult = 0; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// / If ulPHYLinkStatus was set to off previously, the status has to be checked again. * Otherwise ulPHYLinkStatus would never be set to on, if a packet is received during timeout. */ if( ( ulPHYLinkStatus & BMSRLINKSTATUS ) == 0 ) { xStatus = ulReadMDIO( PHYREG01_BMSR );

            if( ( ulPHYLinkStatus & BMSR_LINK_STATUS ) != ( xStatus & BMSR_LINK_STATUS ) )
            {
                ulPHYLinkStatus = xStatus;
                FreeRTOS_printf( ( "prvEMACHandlerTask: PHY LS now %d\n", ( ulPHYLinkStatus & BMSR_LINK_STATUS ) != 0 ) );
            }
        }
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	}

Maybe that this problem occurs only under special conditions, which I have, and maybe that a better code could be used, but as a fast change the addition helped. The link off is seen after 15 seconds, and the link on is recognized immediately.

Greetings, Johannes


Ethernet link-on-status on a Zynq not recognized

Posted by heinbali01 on January 28, 2019

Hi Johannes, I'm sorry to discover that the current release of portable/NetworkInterface/Zynq/NetworkInterface.c still have this problem.

Here you find an alternative solution for the problem that you encountered.


Ethernet link-on-status on a Zynq not recognized

Posted by hannes23 on January 29, 2019

Hi Hein,

Thanks for your reply, and sorry, that I didn't remember your advice regarding the patch given one year before. :)

From: Hein Tibosch [mailto:heinbali01@users.sourceforge.net] Sent: Monday, January 28, 2019 5:24 PM To: [freertos:discussion] <382005@discussion.freertos.p.re.sourceforge.net> Subject: [freertos:discussion] Ethernet link-on-status on a Zynq not recognized

Hi Johannes, I'm sorry to discover that the current release of portable/NetworkInterface/Zynq/NetworkInterface.c still have this problem.

Here https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_free rtos_discussion_382005_thread_a3d9f566_-3Flimit-3D250-233ebe&d=DwMCAg&c=VlVW iTf6NLcRnQ6UE9A3gtZ_d8K8tB_QlazTgpkF1UI&r=I8W7X9UdiYUoP79S5qYphNd5H_gskbTn2C nU21oOZiE&m=SxdnWzQz41RCaUsUsPraD75CATB1MXw3_pD3Qe0jq50&s=yiNF8KswoFUli2Pgzf n2ZV5WGzMxS6yd_j4CT3pfa5A&e= you find an alternative solution for the problem that you encountered.


Ethernet link-on-status on a Zynq not recognized https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_free rtos_discussion_382005_thread_318174e2c3_-3Flimit-3D250-235ca1&d=DwMCAg&c=Vl VWiTf6NLcRnQ6UE9A3gtZ_d8K8tB_QlazTgpkF1UI&r=I8W7X9UdiYUoP79S5qYphNd5H_gskbTn 2CnU21oOZiE&m=SxdnWzQz41RCaUsUsPraD75CATB1MXw3_pD3Qe0jq50&s=rPpzsZDdRmVr1qR1 144sYekfSMYW_5CwwFYYtUptsTU&e=


Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freertos/discussion/382005/ https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_free rtos_discussion_382005_&d=DwMCAg&c=VlVWiTf6NLcRnQ6UE9A3gtZ_d8K8tB_QlazTgpkF1 UI&r=I8W7X9UdiYUoP79S5qYphNd5H_gskbTn2CnU21oOZiE&m=SxdnWzQz41RCaUsUsPraD75CA TB1MXw3_pD3Qe0jq50&s=_4PiizdO7488QFmJdefGXMbaAyWnQ2KmaAn8EndJb98&e=

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_auth_s ubscriptions_&d=DwMCAg&c=VlVWiTf6NLcRnQ6UE9A3gtZ_d8K8tB_QlazTgpkF1UI&r=I8W7X 9UdiYUoP79S5qYphNd5H_gskbTn2CnU21oOZiE&m=SxdnWzQz41RCaUsUsPraD75CATB1MXw3_pD 3Qe0jq50&s=zMXmNww2kXjVOBal8bwJ4r-L0hlooAShiEGzCMeG8vY&e=

Attachments

alternate (5781 bytes)
smime.p7s (5410 bytes)


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Mediatek

Renesas

RISC-V

SiFIve RISC-V

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner