S32K148 - ENET TX handling

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K148 - ENET TX handling

597 Views
jakub_mielczare
Contributor III

Hello,

I have a question related with S32k148 and ENET transmit (TX) interrupt handling with AUTOSAR.

If the TX descriptor ring has 8 descriptors then what is the best way to handle the TX interrupt which is configured as category 1 interrupt in AUTOSAR?

If the ENET_EIR register flag TXF (Transmit Frame Interrupt) is set, the interrupt gets triggerred, right?

The interrupt handler clears the flag, processes the interrupt. What if next frame is completely transmitted before interrupt handler ends and ACKs the interrupt in NVIC? Will the TXF flag and MCU irq be set again?

Should TXF be cleared after handling the finished frame or before? To ensure that all complete frames are processed by interrupt handler and the ring does not get full.

Thank you,

Jakub

Tags (3)
0 Kudos
1 Reply

572 Views
namnguyenviet
NXP Employee
NXP Employee

Hello @jakub_mielczare,

In the TX side, the interrupt handler would be triggered each time the ENET_EIR[TXF] flag is set. In the interrupt handler, TXF would be cleared. If the next frame is completely transmitted before interrupt handler ends, interrupt handler would be called again right after the previous call is finished. The TXF is always cleared in NXP MCAL ETH interrupt handler function, you don't need to handle this task in the application, but if you are implemented an ETH MCAL by your own, then you shall need to clear the TXF flag in the ETH interrupt handler.

From my point of view, if you are using NXP MCAL driver and you're implementing your own stack based on that, then the best way would be: the application will wait until EthIf_TxConfirmation() is called, after that the application will start transmitting a new frame by calling Eth_ProvideTxBuffer() and Eth_Transmit()

Best Regards,

Nam

0 Kudos