This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/AM6548: TI EMAC driver using on bare metal AM65x R5F MCU

Part Number: AM6548
Other Parts Discussed in Thread: TMDX654IDKEVM,

Tool/software: TI-RTOS

Hello, TI.

I am working on developing Ethernet Driver for R5F MCU of AM654x processor's family using TMDX654IDKEVM AM65x Industrial Development Kit. The driver is being developed basing on the latest version of the PDK AM65xx of SDK RTOS AM65xx and has to be executed on bare metal. Thus, it uses ‘nonos’ source files of the PDK.

The Ethernet driver has to provide an API for sending and receiving MAC level ETH packets. Therefore it calls the TI EMAC driver API provided with the PDK AM65xx of SDK RTOS AM65xx.

Currently, the TI EMAC driver has Emac_Cpsw_TestApp and Emac_Icssg_TestApp demo applications:

http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_device_drv.html#example-and-test-applications

I used the source code of the application as an example to properly initialize the TI EMAC driver, but still cannot send any packets to the Ethernet port as well as receive a packet. The TI EMAC driver demo applications are developed to test two types of AM65xx sub-systems, which are CPSW and ICSS-Gs. The CPSW test is developed to send internal loopback, and the ICSS-G test performs loading firmwares to the PRU and RTU modules to send a test packet. And what the firmwares do I can’t realize. Also, the RTUs are loaded with the ‘rtu_test0_bin.h’ and ‘rtu_test1_bin.h’ binary files. Werther they are be able to send something more then the test packet I don’t know. In my test they can’t.

Thus, fighting with the problem for around two weeks, I please you to help me. Can I somehow setup any one of the Ethernet ports to be able to send any available packets to the network. Do you have some initialization examples to setup CPSW port and PHY on the board to send out data? Or maybe you can provide a firmware or instruction how to setup an ICSSG port? I will be glad to send data to any Ethernet port. Could you please help me to solve the initialization problem?

  • Hi Sergei,

    This is forwarded to the R5F experts, however due to the holidays, responses may be delayed.

    Best Regards,
    Yordan
  • Sergei,

    Let me try and set this up at my end so I can confirm or try to reproduce this issue. Can you clarify that you are setting up the EVM and CCS such that the SYSFW/DMSC firmware is loaded before you run the example? Does the example work for you on the A53 but only fail from the R5F?

     In addition to the EMAC driver code, there is also a EMAC diagnostic code that tests the PHY Setup and EMAC setup on the EVM. Have you tried this on your EVM to see there is no HW issue?

    Regards,

    Rahul

  • Hello, Rahul!

    Firstly, thank you for your answer and help!

    1. Yes, I have set up the EVM and CSS and load SYSFW/DMSC firmware, following the instructions ‘Advanced AM65x Debug Setup with DMSC Firmware Load’ witch are described here:
    software-dl.ti.com/.../index_how_to_guides.html

    2. I have not tried to execute the examples on the A53 core. But the thing is that the examples work properly on R5F, but only in scope of their tests.

    3. I have not tried to run EMAC diagnostic tests, but we have brought up Linux kernel on A53, and the Linux is able to send ARP packets to the Ethernet through the CPSW port and the ICSS-G ports. I can capture the packets by Wireshark on my host PC. That’s why I can realize that AM6548 SoC on the EVM board is connected to the PHY chips of each port correctly and HW works well.

    Rahul, my problem is that I cannot set up any of the ports using TI EMAC driver to sent a Ethernet packet to network.

    The Emac_Cpsw_TestApp is a loopback test inside the CPSW switch, and it does not send any packets to the port 6.

    The Emac_Icssg_TestApp sends only a test packet from one ICSS-G port to other ICSS-G port. The test at the beginning waits for link-up on the port 4 and port 5. And after the links are upped it sents the test packet from port 4 to port 5. I tried to deceive the test for capturing the test pack on my host PC. But the attempt was fail. I connected port 5 to port 6 to give the test an ability to detect link-up on port 5, and the port 4 I connected to the host PC for catching the test packet by Wireshark. So, I could not catch up it. Also, the initialization for the test uploads ‘rtu_test0_bin.h’ and ‘rtu_test1_bin.h’ files to the on SoC RTUs. Might the reason that I cannot send a packet to the ICSS-G port be that the firmwares for RTUs are for the test only?

    Thus, using the setting for the test I cannot set up the the TI EMAC driver to send Ethernet packets to the network. And I am interested in do you have an initialization sequence for EMAC driver and associated peripherals such as UDMA, MDIO, PHY, PRU, RTU, and etc. to initialize the SoC for sending packets out? It may be any port either CPSW or ICSS-G.

    Please help me to solve the problem, or show a direction what I have to do.
  • Hi,

    There are also NIMU test examples that communicate with outside world:
    \packages\ti\binary\NIMU_Cpsw_ExampleApp
    \packages\ti\binary\NIMU_Icssg_ExampleApp

    They can run on A53 or R5F. Can you try that? Also, those examples run standalone, which means you can't run Linux on A53.

    Regards, Eric
  • Hello, Eric.

    Thank you for these examples! Yes, of course I'm going to try that.
  • Any news?

    Regards, Eric
  • Hello, Eric.

    I'm sorry, no news yet. We had holidays in Russia and I couldn't check the test. And also, after the holidays I got sick. So, I hope I will be fine on Monday and continue my investigation. In any case I let you know about the result.

  • Hello, Eric.

    Thank you for your pointing to NIMU test. It helped me to see ICMP packages on wires. So, I could ping the board and get reply from it. Therefore, I can research the test source code and take a configuration for TI EMAC driver probably. But this will be next story. I am going to do it tomorrow. Thank you one more time for your help!

  • Part Number: AM6548

    Tool/software: TI-RTOS

    Hello, TI.

    I am still continue working on setting up the TI EMAC driver on TMDX654IDKEVM AM65x Industrial Development Kit, and still can’t receive or send an Ethernet packet to the network. Having examined the NIMU test for CPSW, I saw that the test could communicate with my laptop answering the ICMP packets. Also, I researched the test setting and configured my software and the TI EMAC driver used by the software exactly how the NIMU test does. However it didn’t help me to use the TI EMAC driver.

    I have run up the NIMU test under debugger, and assign all C source files to have ability to set breakpoints and to do debugging the test step by step. And currently I have a question. The TI EMAC driver uses the TI UDMA driver, which uses the TI INTA (Interrupt Aggregator) driver. So, having this sequence the TI EMAC driver for receiving a packet sets up the TI UDMA driver, and the TI UDMA driver sends an interrupt function within a settings to TI INTA driver. Therefore, when an Ethernet packet received, the TI UDMA driver ISR function is called, and the function does some other steps to complete the packet receiving.

    Under debugging I have seen that the ISR function is called in the NIMU test, but I cannot repeat this in my software. The the NIMU test is executed under TI RTOS, my software uses ‘nonos’ source code provided by TI PDK and executed on bare metal. May the different be in it? And what do I have to initialize more to see that the ISR function is called on bare metal using the ‘nonos’ source code? May the TI RTOS do some additional HW initialization for TI EMAC driver works?

  • Hi,

    If NDK worked on your setup but you want NO-OS CPSW driver without using TI's network stack (NDK), you may also refer to the board diagnostics for AM65x, the code is under: pdk_am65xx_1_0_3\packages\ti\board\diag\emac. The user guide is: software-dl.ti.com/.../index_board.html

    The EMAC test is explained: 3.3.2.11. EMAC Test. This is an external loopback at PHY level by using a Ethernet loopback cable. First test it to make sure it work as expected. Then I believe if you replace the loopback cable by a host PC, you should be able to exchange packets as well.

    Regards, Eric
  • Hello, Eric.

    Thank you! Yes, I saw source code of the diagnostic test and also tried the settings of the TI EMAC driver from it for my project. The settings did not force the driver to be working as well. But I have not executed the test. Ok, I am going to execute the test and also to take a look at it under debugger to realize step by step what it does. Please give me some time for that and I will return to you with an answer.

  • Hello, Eric!

    I am sorry for delaying with an answer as I had some other urgent tasks to do. But I have built the diagnostic tests, and the ‘make am65xx_evm’ command only built tests for armv8 architecture. Thus, I could not execute the test program under R5F MCU.

    But anyway a focus of my project little bit changed and currently I am waiting for a PRU and RTU RISC controllers programming guidelines by TI to have an opportunity to program ICSS-G Ethernet.

    Thank you for your answers and help!