The AM389x TRM (SPRUGX7C) states the following about EMAC Receive Threshold Interrupts:
- The receive threshold interrupts use the same free buffer count and threshold logic as does flow control, but the interrupts are independently enabled from flow control. The threshold interrupts are intended to give the host an indication that resources are running low for a particular channel(s).
I would like to add the Receive Threshold notification (without flow control) to my design, which currently only implements Receive Packet Completion Interrupts for the receive channel, in order to avoid cases where the EMAC runs out of available Rx buffers (causing a HOSTPEND error). However, my attempts at using the Rx Threshold feature have been unsuccessful so far.
Per the instructions in the TRM, it seems like it should be fairly straightforward. to use As I understand it, the steps necessary to configure the Rx Threshold functionality are as follows:
- Initialize the receive channel n free buffer count register (RXnFREEBUFFER) with the total number of allocated Rx buffers for the channel.
- Establish the trigger threshold via the RXnFLOWTHRESH register.
- Enable the receive channel interrupt bits in the receive interrupt mask set register (RXINTMASKSET), which was already being done for Rx Packet Completion Interrupts.
- Enable the interrupt via the CMRXTHRESHINTEN register.
After setting all this up (including modifying my code to update RxnFREEBUFFER for every buffer reclaimed by the host), I can see the RxnFREEBUFFER updating as expected (EMAC is consuming buffers, host is reclaiming buffers). However, even with the RXnFLOWTHRESH buffer set to an artificially high threshold value, I never see the CMRXTHRESHINTSTAT register indicate a Rx Threshold condition on the channel. Could there be some setup step that I'm missing?
Thanks!