S32K388 GMAC0 Eth_43_GMAC driver not getting RX interrupt Hi, I'm using the following configuration: S32K388EVB-Q289 S32DS 3.6.8 RTD 7.0.1 I used the provided Eth_InternalLoopback_S32K388 example project as base, and modified it so that it can receive frames from my PC through a media converter. I have added in the RTD fix which was mentioned in Example S32K388 GMAC0 lwIP FreeRTOS S32DS 3.6.1 RTD600. I was able to hit the breakpoint in Eth_43_GMAC_Receive(EthConf_EthCtrlConfig_EthCtrlConfig_0, 0U, &Status); And was able to inspect the Ethernet frame in EthIf_RxIndication(Eth_43_GMAC_apxInternalCfg[PartitionId]->Eth_43_GMAC_apCtrlConfig[CtrlIdx]->EthCtrlEthIfIdx, FrameType, IsBroadcast, MacSrcAddr, Payload, PayloadLength, IngressTimeTuplePtr, RxHandleId); However, when I added a while 1 loop, enabled the Rx Interrupt and linked it to the GMAC0_CH0_RX_IRQHandler I was not able to get any interrupt anywhere. I have attached my project below. James_Zhang_SE_0-1788220964718.pngJames_Zhang_SE_0-1788220964718.pngJames_Zhang_SE_0-1788220964718.pngJames_Zhang_SE_0-1788220964718.png S32K3 AUTOMOTIVE-RTD Re: S32K388 GMAC0 Eth_43_GMAC driver not getting RX interrupt Hello @James_Zhang_SE ,
I checked the attached project. To enable RX IRQ in RTD7.0.1, you need to change Ingress QueueHandlerFunction and enable QueueInterrupt:
PavelL_0-1788263577590.pngPavelL_0-1788263577590.pngPavelL_0-1788263577590.pngPavelL_0-1788263577590.png
After that change, I hit breakpoint at GMAC_RxIRQHandler(), resp. at Eth_43_GMAC_Receive().
I also noticed that your RGMII TXCLK is defined as Input -> it should be Output.
However, to see your TX frame in Wireshark, you need to change the init sequence accordingly to Example S32K388 GMAC0 lwIP FreeRTOS S32DS 3.6.1 RTD600. So, in your project, it looks like:
PavelL_1-1788264277735.pngPavelL_1-1788264277735.pngPavelL_1-1788264277735.pngPavelL_1-1788264277735.png
Best regards,
Pavel Re: S32K388 GMAC0 Eth_43_GMAC driver not getting RX interrupt Hi Pavel, Thank you very much for your support. After applying the fixes you suggested, the GMAC driver is now working for me. I do have a few additional questions, and I would appreciate your guidance: Is there any detailed documentation that describes the complete procedure for configuring and using the GMAC driver? I would like to go through the documentation myself first so that I can better understand the driver before asking too many questions. Inside EthIf_RxIndication(), do I need to call Eth_43_GMAC_ReleaseRxBuffer(CtrlIdx, RxHandleId); at the end of the function to release the received buffer? There are quite a few GMAC configuration options available. Is there any documentation or reference that explains what each configuration parameter does and how it should be configured? Thank you again for your help. I really appreciate your support. Re: S32K388 GMAC0 Eth_43_GMAC driver not getting RX interrupt Hi @James_Zhang_SE ,
Thank you for sharing your update. I am glad to hear that the GMAC driver is now working for you.
Regarding your additional questions:
1. The main reference for configuring and using the driver is the Eth_43_GMAC User Manual, which is included in the RTD installation, e.g.: C:\NXP\S32DS.3.6.6_RTD701\S32DS\software\PlatformSDK_S32K3\RTD\Eth_43_GMAC_TS_T40D34M70I1R0\doc\RTD_ETH_43_GMAC_UM.pdf
I also recommend reviewing the corresponding Eth_43_GMAC Integration Manual (RTD_ETH_43_GMAC_IM.pdf), saved in the same directory, and the available GMAC example projects.
2. Whether Eth_43_GMAC_ReleaseRxBuffer() must be called depends on the EthCtrlReleaseResourceAfterReception configuration parameter.
PavelL_0-1789024403441.pngPavelL_0-1789024403441.png
If automatic release after reception is enabled, the driver releases the RX resource after EthIf_RxIndication() returns and you should not release it explicitly.
If automatic release is disabled, the received buffer remains allocated after EthIf_RxIndication() returns. In that case, the application must eventually call:
Eth_43_GMAC_ReleaseRxBuffer(CtrlIdx, RxHandleId);
This mode is useful when the application needs to retain the received data for further processing. However, the buffer must be released after the application has finished using it. Otherwise, the available RX buffers will eventually be exhausted.
Please also note that the received Payload pointer should not be used after the corresponding buffer has been released.
3. The Eth_43_GMAC User Manual is also the primary reference for the individual configuration parameters. In addition, S32 Configuration Tools displays a description for many parameters when the corresponding setting is selected or hovered over. For hardware-level behavior, such as MAC filtering, DMA operation, MTL queues, timestamps and interrupt status, please refer to the GMAC/EMAC chapter of the S32K3 Reference Manual.
As a practical starting point, I recommend referencing GMAC examples provided by the RTD package. There are also functional lwIP examples on the page:
https://community.nxp.com/t5/S32K-Knowledge-Base/S32K-Examples/ta-p/1108990
Please do not hesitate to ask for support in case you observe any issue. A dedicated thread for each topic is preferred. It helps keep us clarity of cases for other users.
Best regards,
Pavel
記事全体を表示