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.

AM6442: Low level /Register programming of Ethernet Peripheral

Part Number: AM6442

Hi,

I am using SK AM64x, which has an AM6442 SoC. I need help programming the Ethernet Peripheral (CPSW3G) on the SoC for my application.

Back Story(Optional):
I am trying my very best to develop a CNC motion controller using AM6442. Since the application requires real-time high performance, OS's are too slow. So I am doing this without using Linux, FreeRTOS, or NoRTOS. The documentation is nothing less than absolute garbage. So far, I've managed to create my own API for this SoC without using any of TI's libraries or APIs other than SCIclient. I was successfully able to integrate all the A53 Cores, R5F Cores, PRU Cores, DDR RAM(This was the hardest), Timers, Interrupts, High Speed GPIOs using PRU, and all the other goodies, and also Ethernet using PRU(This too was very hard). I also made my own custom SBL. The reason for not using NoRTOS is the same as the documentation is just garbage. I swear, I tried my best to use NoRTOS. In my own API, I did manage to transfer data on Ethernet using PRU @ 1Gbps, except one big hurdle I am stuck at is that the transmitted data has no CRC, so basically all Ethernet switches just drop my frame. I have to connect AM64x directly to my PC's Ethernet port and use the PCAP packet capture driver in Windows to read data from AM64x without CRC. So it's not so useful since I also plan to use it as a local web server too, so I can control my CNC using iOS, Android, or Webapp. I have tried way too hard and given too much of my time to get the Ethernet on PRU to get working and try to transmit CRC to work, but now I give up. Maybe I'll have better luck with the dedicated CPSW3G Ethernet peripheral.

Question:
How do I interface with the Ethernet Peripheral(CPSW3G) to transfer and receive data on an Ethernet port using only register programming? I have managed to configure this peripheral and also programme the onboard PHY, which I know for a fact is configured properly. Except for the main part of sending and receiving data from the peripheral, the documentation in the CPSW3G section says something about how I have to use DMA/PSI-L/CPPI to do it . but has no information as to how to do it. I have no clue how CPPI works, and I don't have the DMA running and have no clue how to configure that either. Even the DMA section in the datasheet gives no clue on how to interface with the CPSW peripheral. I am just lost here, Someone please help on where can I even start to do this. Any other related documentation that would help? Has anyone managed to do it on Beaglebone? I see AM572x on Beaglebone AI has kind of a similar CPSW as it is on AM64x.

AM6442 Reference Manual: https://www.ti.com/lit/pdf/spruim2

Thanks

  • Hello Abhimanyu,

    Just to set expectations up front:

    We can support questions about TI software (in this case., the MCU+ SDK FreeRTOS and NORTOS software). We can support specific questions about specific parts of hardware or software (e.g., "what does this register do?"). We can also answer questions about the "garbage documentation", and take actions to improve the documentation. (feedback is always welcome! The documentation is under active development)

    However, we cannot help you write totally custom code. If you decide not to use the tools that TI provides, then it is up to you to figure out how to get it working.

    Next steps: 

    Right now, your question is too broad for us to help with - I cannot provide a full guide for how to program and use a peripheral WITHOUT using the software that TI already wrote to enable you to do that. However, I am going to reassign your thread to the MCU+ team. That way if you have a followup question that is more specific, then they can help you.

    Regards,

    Nick

  • Hi Nick,

    Thanks for all your help. I really appreciate it.

    My apologies if my post was not clear in what I was asking or what I should expect. I am new here and not very familiar with this forum. I will try to be more concise.

    Just to set expectations up front:

    This was very helpful. I think I have a better understanding of how I should frame my question better.

    Yes, the documentation is very bad in some sections. The Technical Reference Manual is quite big but well organised. Some sections are well written. But most sections are just beyond repair. They are written as if they are only meant for TI's internal team and not much help from a user perspective. I would be happy to help by pointing out how to improve the documentation, but I don't know where the right place to share this feedback is.

    Next steps: 

    I do not expect a full-blown answer, nor do I expect code to be written for me. I just want some good directions on where to start.

    I would be happy to use NoRTOS for my application, but unfortunately, as I mentioned, the NoRTOS documentation is also close to non-existent. This is the biggest reason why I am developing my own API, as I found it was easier to develop my own API instead of trying to guess how the NoRTOS library works. I understand that this whole product is under development, as is the documentation.

    I have written my own API by reading the TRM, reverse engineering the NoRTOS library, reverse engineering GEL files, and so on.

    As for my question, I would be happy to accept clues on how to get the CPSW running WITH NoRTOS library as well. I am willing to put in the effort of reverse engineering it after that. The SDK documentation lacks clear, tutorial-style information on how to use the CPSW peripheral, as well as a clear explanation of what the NoRTOS functions do and what the function parameters should be, also what different sturct and descripters do.

    I think maybe I can configure the CPSW peripheral myself using register programming after doing it so many times with other peripherals. Although help here would be very much appreciated as well.

    For the time being, I'd appreciate it if someone could tell me which exact function(s) in the NoRTOS library initiate data transfer to/from Host Port 0 of the CPSW switch. Right now, I think they are under "ENET Data Path (DMA)". So which functions should I use for the simplest form to receive data from the buffers. If I can do that, I think I'll be able to figure out how to send data as well.

    Thanks

  • Hello Abhimanyu,

    Sounds good.

    Feedback on documentation 

    For application notes, TRMs, etc, there should be a URL at the bottom of every page that says "Submit Documentation Feedback". I just double-checked with the engineers that are in charge of writing the TRM, and they confirmed that they saw feedback delivered through that path.

    For web pages like The Linux SDK docs, the MCU+ SDK docs, or the AM64x Linux Academy, these forums are the best place to give feedback and ask questions.

    which function in the NORTOS library initiates data transfer to/from the CPSW switch? 

    I have reassigned your thread to a team member more familiar with MCU+ SDK to comment. Please ping the thread if you do not have a response within a day or so.

    Regards,

    Nick

  • Hello? Anyone there ? :(

  • Hi Abhimanyu,

    As of now, we do not have support for NORTOS on CPSW in MCUSDK 8.4.

    Can you please help me to get more details about what you are trying to achieve/goal ? So that we can help you better.

    Regards

    Ashwani