Hi experts,
I am using the out-of-box MCAL Eth app demo
- How do I disable interrupt pacing in my MCAL Ethernet project
- How do I switch to polling mode instead of interrupt mode.
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.
Hi experts,
I am using the out-of-box MCAL Eth app demo
In ethernet, two primary modes for handling data transmission and reception events are Polling and Interrupts.
What is polling mode?
In polling mode, the MCU periodically checks the status of transmission and reception. The R5F does not rely on the ethernet/DMA peripheral to notify it about new data being available (Rx) or data transmission being completed (Tx).
What is interrupt mode?
In interrupt mode, the MCU relies on the DMA to notify about the data transmission or reception. The DMA notify callback function is hit when new packets arrive (Rx flow). This callback function then handles the flow. On the Tx side, when the DMA completes the data transfer, the Tx callback will be hit which further handles the application flow.
What is interrupt pacing?
Interrupt pacing is a mechanism used to control the rate at which interrupts are generated in response to Rx and Tx events. This way, the resources are managed more efficiently. An interrupt pacing unit is used, for example 2ms, which indicates that interrupts will be generated every 2ms and all the packets will be handled in that time interval.
Note: By default, the out-of-box MCAL Eth_App demo has Interrupt pacing enabled.
Refer 4.10. ETH — Platform MCAL Development - AM263 User Guide (ti.com) to correctly get started and setup the Eth app demo
Steps to disable interrupt pacing:
Steps to disable interrupts and enable polling:
Now in examples/Eth/EthApp.c file, call "Eth_TxConfirmation()" after the Eth_Transmit() function is called.
retVal = Eth_Transmit(pEthConfigPtr->ctrlIdx, bufIdx, frameType, txConfirmation, lenByte, gBCstMacAddr); #if (ETH_ENABLE_TX_INTERRUPT != STD_ON) AppUtils_delay(1U); #endif if ((Std_ReturnType) E_NOT_OK == retVal) { gTestPassed = E_NOT_OK; gAppObj.stats.ethTransmitErr++; } else { #if (ETH_ENABLE_TX_INTERRUPT != STD_ON) Eth_TxConfirmation(0); #endif while(gAppObj.txConfirmPacketFlag==FALSE) { /*wait till tx packet confirmed */ } gAppObj.stats.ethTransmitPckCnt++;A diff snippet for the same:
gmake -s allclean gmake -s eth_app
Run the application using CCS. Open wireshark and check the packets transmitted from the microcontroller.
MCU sending packets to external world:
MCU receiving packets from external world:
As shown above, the Eth app demo will now use polling mode instead of the default interrupt mode.
Regards,
Shaunak