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.

AM6422: SDK8.6 CPSW interrupt freertos

Part Number: AM6422

Hello,

    CPSW Ethernet releases a semaphore via interrupt mode during reception, and the reception task reads Ethernet data from memory. What is the triggering method for this interrupt? What is its specific priority? Currently, it appears that the interrupt enable is disabled when an interrupt occurs, and the interrupt enable is re-enabled only after the task has read all the current Ethernet data. We would like to know the specific triggering conditions for this interrupt and, if possible, whether these conditions can be configured accordingly? 

  • Hi,

    The interrupts are triggered by the completion event of the DMA transfers. The current interrupt priority for DMA events is 1. 

    Currently, it appears that the interrupt enable is disabled when an interrupt occurs, and the interrupt enable is re-enabled only after the task has read all the current Ethernet data. We would like to know the specific triggering conditions for this interrupt and, if possible, whether these conditions can be configured accordingly?

    I think you are referring to "Lwip2Enet_rxPktHandler" in this context. That is a check to enable the interrupt config during runtime, but it remains in the same mode through out. In later versions of SDK, it has been cleaned up and additional option of having either an interrupt or poll for packet transmission and reception.

    Please let me know if you have further queries. If I am wrong with above assumption, please provide more details on which section you are referring to.

    Regards,
    Teja.

  • Hello,

        Thank you for your reply. Regarding the SDK 8.6 we are using, can the mode be configured as either interrupt-driven or polling? In the case of interrupt mode, what is the corresponding interrupt trigger condition? For example, does an interrupt occur for each packet received, or after a certain threshold of packets? And can this threshold be configured?Can the interrupt priority of DMA events be configured?

  • Hi,

    For LwIP examples in 8.6, we only support polling. For layer2 examples, the interrupt is triggered for every packet, but once the packet processing task starts, it will handle all packets till the hardware FIFOs are completely drained. Please let me check with our dev team regarding the interrupt pacing feature support on AM64x device. 

    Can the interrupt priority of DMA events be configured?

    Yes, This can be technically configured. But currently it is not supported out of box. To change the interrupt priority of the events, you make minor changes to the enet driver in dma module (EnetUdma_registerEvent) to set it to a specific priority of your choice. But this will set the priority of all ethernet dma interrupts to same priority. If you want further control, you would need to manipulate the API arguments of EnetUdma_registerEvent to suit your usecase.

    Regards,
    Teja.

  • Hi,

    I have checked with the SDK code, and interrupt pacing is not available in AM64x device.

    Regards,
    Teja.

  • Hello,

        I have another question. In the current SDK 8.6 version, polling is used with a cycle of 1000 microseconds, meaning the receive task runs every 1 millisecond. During each run, it reads the current data. If the usage scenario requires timely responses, could this have an impact?Or can this time be adjusted? If adjustable, how to adjust it?

  • Hi,

    The usage of 1 millisecond timer is coming from the limitation of FreeRTOS timer. The clock step from freertos for polling cannot be lower that 1ms. If the application needs interrupt highly time sensitive responses, then you can enable the interrupt based configuration, but this would come with some sizable trade-off with the throughput. 

    Let us know if this is fine for you. 

    Best regards,
    Teja.

  • Hello,

        If interrupts are enabled, can it be set to a hybrid mode—using a timer under high traffic conditions to reduce CPU overhead, and using interrupts under low traffic conditions to minimize latency?

  • Hi,

    This is something similar to what Linux uses (NAPI), but similar implementation is not currently available in our SDK offering. This can theoretically be achieved, but this will need changes to the ethernet driver in its core operations. Unless you are experienced with networking drivers or any core drivers, I wouldn't suggest to venture into this.

    Can you please provide more details about the requirements? We can suggest possible methods which will meet your requirements within the SDK options.

    Regards,
    Teja.