<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: S32K366 GMAC Configuration Inquiry with LAN8720 PHY in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K366-GMAC-Configuration-Inquiry-with-LAN8720-PHY/m-p/2122969#M50236</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/245816"&gt;@zhangzhixing&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;DIV id="&amp;quot;componentDiv&amp;quot;"&gt;
&lt;P&gt;Thank you for the detailed description.&lt;BR /&gt;May I ask which version of the RTD you are currently using?&lt;/P&gt;
&lt;P&gt;Below are a few suggestions based on the RTD 4.0.0 and the lwIP example for S32K396. I hope they help clarify the configuration:&lt;/P&gt;
&lt;P&gt;1. Pin Configuration&lt;BR /&gt;The pin settings in the Gmac_Ip_InternalLoopback_S32K396 example look correct.&lt;BR /&gt;You might consider starting with the Fastest drive strength for output pins.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;2. Clock Configuration&lt;BR /&gt;The EMAC clock shall be configured for RMII as shown on the picture (from S32K344):&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PavelL_0-1750839936554.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/344579iC70A1A7827551461/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PavelL_0-1750839936554.png" alt="PavelL_0-1750839936554.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PavelL_0-1750839936554.png&lt;/span&gt;&lt;/span&gt;
&lt;P&gt;&lt;BR /&gt;Based on the lwIP example, please verify the DCM_GPR configuration:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;!--ScriptorStartFragment--&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="scriptor-paragraph"&gt;&lt;SPAN&gt;/* Set RMII configuration for EMAC in DCM module */&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="scriptor-paragraph"&gt;&lt;SPAN&gt;IP_DCM_GPR&lt;/SPAN&gt;&lt;SPAN&gt;-&amp;gt;DCMRWF1&lt;/SPAN&gt; &lt;SPAN&gt;|&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;DCM_GPR_DCMRWF1_MAC_CONF_SEL_MASK&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;SPAN&gt;&lt;!--ScriptorEndFragment--&gt;&lt;/SPAN&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;This line is typically placed very early in the initialization sequence, often before any clock or peripheral setup.&lt;/P&gt;
&lt;P&gt;Please note: This configuration differs from the one used on S32K344, as the DCMRWF1 register layout has changed in the S32K396.&lt;/P&gt;
&lt;P&gt;3. PHY Reset Sequence&lt;BR /&gt;Ensure the PHY is properly reset and stabilized before EMAC initialization:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A good place for the PHY reset is after Siul2_Port_Ip_Init() and before Clock_Ip_Init().&lt;/LI&gt;
&lt;LI&gt;Make sure to insert a delay (typically 3-5 msec - depends on used PHY) after releasing the PHY reset to allow it to complete internal initialization.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Also verify:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The PHY has completed its internal startup sequence.&lt;/LI&gt;
&lt;LI&gt;The RMII clock (50 MHz) is present and stable before calling Clock_Ip_Init() and initializing the EMAC.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P&gt;Please feel free to use the lwIP example as a reference. However, all the checks and updates mentioned above are still necessary to ensure proper functionality.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Pavel&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jun 2025 08:36:52 GMT</pubDate>
    <dc:creator>PavelL</dc:creator>
    <dc:date>2025-06-25T08:36:52Z</dc:date>
    <item>
      <title>S32K366 GMAC Configuration Inquiry with LAN8720 PHY</title>
      <link>https://community.nxp.com/t5/S32K/S32K366-GMAC-Configuration-Inquiry-with-LAN8720-PHY/m-p/2121146#M50136</link>
      <description>&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Recently, I designed a circuit using S32K366, where the MCU controls another Ethernet module on the board via a PHY chip (LAN8720). The LAN8720 has successfully established a link with the onboard Ethernet module, auto-negotiated to 100Mbps full-duplex.&lt;/P&gt;&lt;P class=""&gt;I conducted three tests:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P class=""&gt;‌&lt;STRONG&gt;Internal MAC Loopback Test&lt;/STRONG&gt;‌:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Followed the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Gmac_Ip_InternalLoopback_S32K396&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;example to configure the S32K366 MAC in loopback mode. After programming, the MAC successfully received its own transmitted data using:&lt;DIV class=""&gt;&lt;SPAN&gt;c&lt;/SPAN&gt;&lt;SPAN class=""&gt;Copy Code&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;do&lt;/SPAN&gt; { Status = Gmac_Ip_ReadFrame(INST_GMAC_0, &lt;SPAN class=""&gt;0U&lt;/SPAN&gt;, &amp;amp;RxBuffer, &amp;amp;RxInfo); } &lt;SPAN class=""&gt;while&lt;/SPAN&gt; (Status == GMAC_STATUS_RX_QUEUE_EMPTY);&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;Observed&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Des3 = 0x03000040&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in descriptors.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;‌&lt;STRONG&gt;PHY (LAN8720) Local Loopback Test&lt;/STRONG&gt;‌:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Configured MAC in non-loopback mode and enabled LAN8720’s local loopback (PHY echoes MAC’s TX data back to RX).&lt;/LI&gt;&lt;LI&gt;Confirmed waveforms on MAC’s RXD0/RXD1/RXDV pins via oscilloscope.&lt;/LI&gt;&lt;LI&gt;However, the same&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Gmac_Ip_ReadFrame()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;loop hung indefinitely (Status&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;remained&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;GMAC_STATUS_RX_QUEUE_EMPTY).&lt;/LI&gt;&lt;LI&gt;Descriptor&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Des3&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;showed&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;0xC1000000.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;‌&lt;STRONG&gt;Normal Mode (End-to-End Communication)&lt;/STRONG&gt;‌:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Configured LAN8720 in normal mode. MAC TX data reached PHY’s differential outputs, and the Ethernet module replied.&lt;/LI&gt;&lt;LI&gt;LAN8720 forwarded the module’s data to MAC via RMII (RXD0/RXD1), but&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Gmac_Ip_ReadFrame()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;again failed to capture data (same behavior as Test 2).&lt;/LI&gt;&lt;LI&gt;Des3&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;remained&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;0xC1000000.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P class=""&gt;‌&lt;STRONG&gt;Additional Checks&lt;/STRONG&gt;‌:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Verified RMII clock (50MHz) and data timing—no significant issues observed.&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;‌&lt;STRONG&gt;Question&lt;/STRONG&gt;‌:&lt;BR /&gt;Beyond disabling MAC loopback (as in the official internal loopback test), what additional MAC configurations are required for S32K366 GMAC to communicate via LAN8720? Specifically:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Are DMA or other peripheral settings mandatory?&lt;/LI&gt;&lt;LI&gt;Why does&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Des3&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;differ between loopback/non-loopback modes, and how does this affect reception?&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;Looking forward to your guidance.&lt;/P&gt;&lt;P class=""&gt;Best regards,&lt;BR /&gt;Zhang Zhixing&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 06:17:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K366-GMAC-Configuration-Inquiry-with-LAN8720-PHY/m-p/2121146#M50136</guid>
      <dc:creator>zhangzhixing</dc:creator>
      <dc:date>2025-06-23T06:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: S32K366 GMAC Configuration Inquiry with LAN8720 PHY</title>
      <link>https://community.nxp.com/t5/S32K/S32K366-GMAC-Configuration-Inquiry-with-LAN8720-PHY/m-p/2122969#M50236</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/245816"&gt;@zhangzhixing&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;DIV id="&amp;quot;componentDiv&amp;quot;"&gt;
&lt;P&gt;Thank you for the detailed description.&lt;BR /&gt;May I ask which version of the RTD you are currently using?&lt;/P&gt;
&lt;P&gt;Below are a few suggestions based on the RTD 4.0.0 and the lwIP example for S32K396. I hope they help clarify the configuration:&lt;/P&gt;
&lt;P&gt;1. Pin Configuration&lt;BR /&gt;The pin settings in the Gmac_Ip_InternalLoopback_S32K396 example look correct.&lt;BR /&gt;You might consider starting with the Fastest drive strength for output pins.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;2. Clock Configuration&lt;BR /&gt;The EMAC clock shall be configured for RMII as shown on the picture (from S32K344):&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PavelL_0-1750839936554.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/344579iC70A1A7827551461/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PavelL_0-1750839936554.png" alt="PavelL_0-1750839936554.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PavelL_0-1750839936554.png&lt;/span&gt;&lt;/span&gt;
&lt;P&gt;&lt;BR /&gt;Based on the lwIP example, please verify the DCM_GPR configuration:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;!--ScriptorStartFragment--&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="scriptor-paragraph"&gt;&lt;SPAN&gt;/* Set RMII configuration for EMAC in DCM module */&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="scriptor-paragraph"&gt;&lt;SPAN&gt;IP_DCM_GPR&lt;/SPAN&gt;&lt;SPAN&gt;-&amp;gt;DCMRWF1&lt;/SPAN&gt; &lt;SPAN&gt;|&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;DCM_GPR_DCMRWF1_MAC_CONF_SEL_MASK&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;SPAN&gt;&lt;!--ScriptorEndFragment--&gt;&lt;/SPAN&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;This line is typically placed very early in the initialization sequence, often before any clock or peripheral setup.&lt;/P&gt;
&lt;P&gt;Please note: This configuration differs from the one used on S32K344, as the DCMRWF1 register layout has changed in the S32K396.&lt;/P&gt;
&lt;P&gt;3. PHY Reset Sequence&lt;BR /&gt;Ensure the PHY is properly reset and stabilized before EMAC initialization:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A good place for the PHY reset is after Siul2_Port_Ip_Init() and before Clock_Ip_Init().&lt;/LI&gt;
&lt;LI&gt;Make sure to insert a delay (typically 3-5 msec - depends on used PHY) after releasing the PHY reset to allow it to complete internal initialization.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Also verify:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The PHY has completed its internal startup sequence.&lt;/LI&gt;
&lt;LI&gt;The RMII clock (50 MHz) is present and stable before calling Clock_Ip_Init() and initializing the EMAC.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P&gt;Please feel free to use the lwIP example as a reference. However, all the checks and updates mentioned above are still necessary to ensure proper functionality.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 08:36:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K366-GMAC-Configuration-Inquiry-with-LAN8720-PHY/m-p/2122969#M50236</guid>
      <dc:creator>PavelL</dc:creator>
      <dc:date>2025-06-25T08:36:52Z</dc:date>
    </item>
  </channel>
</rss>

