Menu

#126 Print Functions In Zynq EMAC Code

open
nobody
None
5
2019-03-03
2019-02-28
No

The file FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/Zynq/x_emacpsif_physpeed.c uses the Xilinx xil_printf function for print statements. It would be great if those could be updated to use FreeRTOS prints like the rest of the FreeRTOS-Plus-TCP code so that users can provide mutex protection for STDIO. The xil_printf prints can trample on STDIO outputs from other threads.

Discussion

  • Hein Tibosch

    Hein Tibosch - 2019-03-01

    Marty, please find attached the latest Zynq driver "Zynq_2019_march_01.7z"

    ● NetworkInterface.c :

    • xNetworkInterfaceOutput() will call xCheckLoopback() to check if the message is for the loopback device
    • set the ICMP checksum to zero. This is necessary for the hardware ( checksum offloading )
    • bugfix: when a packet has been received, it is assumed that the Link Status is high. Therefore ulPHYLinkStatus must be set.

    ● x_emacpsif_dma.c

    • bugfix: emacps_send_message() : after writing to the "NWCTRL" register, read it back to make sure the data was transferred.
    • Do not assume that ipconfigUSE_LINKED_RX_MESSAGES is defined as 1
    • emacps_check_rx() : make pxFirstDescriptor/pxLastDescriptor local variables.

    ● x_emacpsif_physpeed.c

    • Replace xil_printf() with FreeRTOS_printf()

    I tested the driver in a Zybo project, using iperf3 and FTP.

     

    Last edit: Hein Tibosch 2019-03-01
  • Marty Otzenberger

    I compiled the new code into my project, and everything appears to be working correctly. I am only running the example FTP server and UDP/TCP CLI consoles at the moment, so nothing to complex.

    One more note that I had forgotten when I posted originally. On Line 341 of x_emacpsif_physpeed.c there is a sleep(1) call. Changing that to a vTaskDelay helps prevent the EMAC thread from blocking other tasks from running if the ethernet connection is not present when the Zynq boots.

     
  • Hein Tibosch

    Hein Tibosch - 2019-03-03

    Very good, I will change all occurences of sleep():

    -    sleep( 1 )
    +    vTaskDelay( 1 )
    
     

Log in to post a comment.