S32G399 GMAC0 internal loopback issue

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

S32G399 GMAC0 internal loopback issue

Jump to solution
705 Views
Yang_C
Contributor III

Hi all,

I encountered a problem while testing S32G399 GMAC0 internal loopback on M7.

 

First of all, I imported the example project Gmac_Ip_InternalLoopback_S32G399A_M7 and ran the test on our goldbox S32G-VNP-RDB3, the loopback worked.

 

Next step, I modified my own project - added Gmac module into the driver and did the same config according to the example project, copy paste the example code into my own code and tested the same functionality on our custom board.

 

Every time, the status was stuck in GMAC_STATUS_RX_QUEUE_EMPTY. It seemed like GMAC0 couldn't get anything from the RxBuffer. The only extra thing I did in my code is that I used GMAC0 SMI interface to start the PHY(TJA1103 100Base-T1), or G3 couldn't get the RXC, because TJA1103 is pin strapped in a non-autonomouse mode.

 

I am assuming as long as G3 can power on properly, RXC and TXC are present, the internal loopback functionlaity should work. I also used the scope to check that TXC/RXC were indeed present and their frequency were both 25MHz.

Is there any other reason that can cause this issue?

My IDE version is 3.5.10, RTD4.0.2.

0 Kudos
Reply
1 Solution
553 Views
Yang_C
Contributor III

Hi alejandro_e,

Just share the good news with you. If I only run the gmac0 loopback, it works. Should be some other configs in my original project impact the gmac0 module. I will continue investigating.

Thank you very much.

 

BR,

Yang

View solution in original post

0 Kudos
Reply
11 Replies
675 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @Yang_C,

Thanks for reaching out to us and thanks for sharing the SW versions you are using. From the description of your problem I cannot conclude what can be interfering with the GMAC module in your project. Can you share more details regarding your project? For example, we can start by analyzing what other modules you are using and the pin configuration. If possible share your project, you can send it using the private message feature of the community or by opening a private support ticket and referencing this post. However I would understand if you do now want to share your project completely, we can start by reviewing the mex file alone, that includes the pins and peripherals configuration.

 

Thanks in advance for the information

 

0 Kudos
Reply
640 Views
Yang_C
Contributor III

Hi alejandro_e,

Thank you for your prompt reply.

Your supposition is right, It's not appropriate to share our design, so I just attached my mex file with a screenshot showing what modules we are using. please help check if there's config issue in mex file.

Extra info: GMAC0 module is connected to TJA1103(100Base-T1).

BR,

Yang

 

0 Kudos
Reply
603 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @Yang_C,

Thanks for the information. Checking the GMAC pin configuration I see you added the gmac_mdc and gmac_md pins configuration, while the GMAC original example (Gmac_Ip_InternalLoopback_S32G399A_M7) includes only the gmac_tx_clk and gmac_rx_clk, also, checking the example's description, from the PHY only the clock is used, for synchronization purposes, and thus, the MDIO pins are not configured. 

Original example:

alejandro_e_0-1759786612731.png

 

Your configuration:

alejandro_e_1-1759786637096.png

 

If you are attempting to use an external you will need to rout it externally, the internal loopback will only "bounce" the mac frames internally, they won't reach the PHY.

If you want to test the external loopback I would recommend to integrate the example as it is in the RTD package to adjust all the software components and then adjust it to achieve the external configuration. 

 

Best regards

 

0 Kudos
Reply
598 Views
Yang_C
Contributor III

Hi alejandro_e,

Thank you for your fast response.

Just tried removing the gmac0 MDIO/MDC pin config, still stuck in GMAC_STATUS_RX_QUEUE_EMPTY. In fact, I didn't enable the MDIO functionality in my code and I also changed the external PHY(TJA1103) to autonomous mode which means it will provide 25MHz clock after power on without any extra register override.

My eventual request is pinging s32g399 with my PC through TJA1103. Initially I found it didn't work, so I turned to check which side may have the issue by running their own loopback check. Now I am stuck in the s32g399 gmac0 loopback. TJA1103 loopback hasn't started yet.

My understanding is as long as s32g399 can power on and run properly, RXC and TXC are present, gmac0 should not be a problem. Is that correct? Is there any config issues in my mex file?

BR,

Yang

 

0 Kudos
Reply
574 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @Yang_C,

Thanks for the information. Answering to a part of your question, if the PHY is providing the needed clock the internal loop-back example should work. 

Regading the mex file, I did see some problems, but from my experience, they are related more to the IDE than to the chip itself. However I cannot assure that since I cannot test with all the software components running.

My recommendations at the moment would be:

- Check the clock signal coming from the PHY

- Use the loop-back example 'alone', this is, try to run the example with no other software components in your custom HW, this way we can discard the possible interference of other software components.

 

Thanks in advance for the tests 

0 Kudos
Reply
569 Views
Yang_C
Contributor III

Hi alejandro_e,

Thanks for your suggestion, I will try to figure out a way to just run the example  project.

Regarding the PHY clock, I indeed found some differences. On our custom board TXC/RXC waveform is more like a sin wave whereas the same clock source on g3 goldbox is more like a square  wave. Since the clock is generated by processor and PHY, I couldn't adjust it, any suggestion?

0 Kudos
Reply
565 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello again @Yang_C,

You can check the S32G3 Hardware Design Guidelines User Guide, in particular, section 10.2.2 SGMII recommendation. However, for details regarding the PHY itself I would recommend posting a question in Other-NXP-Products, there one of my colleagues with more knowledge on the PHYs will be able to help you. 

 

 

0 Kudos
Reply
554 Views
Yang_C
Contributor III

Hi alejandro_e,

Just share the good news with you. If I only run the gmac0 loopback, it works. Should be some other configs in my original project impact the gmac0 module. I will continue investigating.

Thank you very much.

 

BR,

Yang

0 Kudos
Reply
491 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @Yang_C,

Thanks for letting me know. We can discard possible pin configuration problems by running the main() of the loop back example with no other modules running, but keeping all your pins configuration (mex file), if it works, the problem is with another part of the program interfering in runtime, if it does not work, it is related to the pins/mex configuration.

 

Thanks for the information

0 Kudos
Reply
483 Views
Yang_C
Contributor III

Hi alejandro_e,

Thanks for your clue.

BR,

Yang

0 Kudos
Reply
413 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @Yang_C,

Please let me know if you need more support.

 

Thanks