S32G2 : Ethernet configuration

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

S32G2 : Ethernet configuration

3,484 Views
skseofh
Contributor II

Hi.

I'm using S32G2 reference board 2.

And I tested Ethernet Loopback example and it works well.

 

I want to use ethernet not loopback mode, 

is there any configuration document to follow?

Cause there are too many configuration tab.

Thanks in advance.

0 Kudos
11 Replies

1,949 Views
aglavi
Contributor I

Hi,

I figured out why its not working by enabling the pins.

You need to manually set the GMAC control registers before calling GMAC_Ip_Init. It is describen in the GMAC user manual. 

IP_SRC->GMAC_0_CTRL_STS = (IP_SRC->GMAC_0_CTRL_STS & ~(SRC_GMAC_0_CTRL_STS_PHY_MODE_MASK | SRC_GMAC_0_CTRL_STS_PHY_INTF_SEL_MASK)) | (SRC_GMAC_0_CTRL_STS_PHY_MODE(0U) | SRC_GMAC_0_CTRL_STS_PHY_INTF_SEL(GMAC_RGMII_MODE));
Gmac_Ip_Init(INST_GMAC_0, &Gmac_aCtrlConfigPB_VS_0[0]);
Gmac_Ip_EnableController(INST_GMAC_0);

Hope this helps

0 Kudos

3,445 Views
bpe
NXP Employee
NXP Employee

RTD provides a compact example code to help you to familiarize yourself with
the controller. Full-feature Ethernet support is available under the OS. See
the documents at the links below for details:

https://www.nxp.com/webapp/Download?colCode=VNPRDBEEUG

https://www.nxp.com/webapp/Download?colCode=PFE-Ethernet-LWIP-FreeRTOS_S32G-demo

 

Best Regards,
Platon

 

0 Kudos

2,975 Views
nioer
Contributor I

hi, when I use the demo , it contains some errors.

Devassert.h: No such file or directory

how to solve this problem? 

 

 

0 Kudos

3,441 Views
skseofh
Contributor II

well, I want to use Eth_43_GMAC on M7 core

 

And I use Rx interrupt to receive Eth message, and it works.

But I tried to send message, but it didn't work..

 

Could you give me an example code to send Ethernet message?

Any simple Tx example on M7 core would do, thanks..

0 Kudos

3,416 Views
skseofh
Contributor II

Any update...?

0 Kudos

3,395 Views
bpe
NXP Employee
NXP Employee

If the loopback demo works for you as you mentioned above, then you do have a
working example of the transmission procedure. Note that the loopback and
non-loopback transmission sequences differ only in the PHY initialization.
There are no examples for Ethernet in addition to what have already been
mentioned in this thread.

 

Best Regards,
Platon

0 Kudos

3,256 Views
skseofh
Contributor II

Hi, nxp support team.

 

Is there any update on this?

0 Kudos

3,143 Views
bpe
NXP Employee
NXP Employee

Could you show me the result that tx message is working on M7 core?

You can only check that the Tx buffer has been handled. This is done by Eth_TxConfirmation(). See the driver User Manual for details. There is no feedback on transmit from the PHY to the upper layer by the definition in IEEE 802.3 Clause  22.  The only reliable way to ensure that a frame has been transmitted by the PHY on the wire is to capture it.

Could you tell me what did I miss?

This requires debugging which is beyond my scope, sorry. If you want this kind of services, consider our paid support options:

https://www.nxp.com/support/support/nxp-engineering-services/automotive-premium-services:AP-PREMIUM-...

 

Alternatively, compare your initialization steps with the reference code mentioned earlier in this thread.

 

Best Regards,
Platon

 

 

 

0 Kudos

3,371 Views
skseofh
Contributor II

Could you show me the result that tx message is working on M7 core?

 

I attached the project file.

It is based on Eth_InternalLoopback_S32G274A_M7 example( RTD AUTOSAR 4.4 D2105)

 

Here is what I changed:

1) Pin : enable GMAC pins based on RGMII

skseofh_0-1642053941196.png

 

2. Clock : change clocks

skseofh_1-1642053981347.png

 

3. Eth_43_GMAC configuration : uncheck 'MAC_CONFIG_LOOPBACK'

skseofh_2-1642054049940.png

 

4. Code

4.1) change 'destination MAC address'(00-0E-C6-8E-6F-C5)

skseofh_3-1642054139194.png

4.2) Transmit loop

skseofh_4-1642054152399.png

 

Could you tell me what did I miss?

 

0 Kudos

3,011 Views
sebastianwelzel
Contributor I

Hi skseofhm,

I run into the same problem like you. Have found already a solution for this problem. I´m still looking for a hint to enable Ethernet transmission without loopback...

 

Best regards

Sebastian

1,944 Views
aglavi
Contributor I
Check comments
0 Kudos