The ENET module of S32K148 chip failed to initialize, and the registers ETHEREN and EBERR were abnor

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

The ENET module of S32K148 chip failed to initialize, and the registers ETHEREN and EBERR were abnor

6,811 Views
JackChen2022
Contributor I

Let me give you a little background on what happened
The S32k148 chip, initially using the S32DS platform, has no problem with the configuration of ENET.
Later, due to the company's needs, the Autosar tool and OS were used. By calling the low-level driver of 32DS SDK package, the hardware and ENET configuration files did not change. After the initialization of enetif_low_level_init() and ENET_DRV_Init() was completed, In the enetif_low_level_output() function ENET_DRV_GetTransmitStatus() always returns busy; The debug trace shows that after the ENET_DRV_SendFrame() function was executed, the registers ETHEREN and EBERR were faulty and TXF and TXB were not updated.

Hope to get your technical support, thank you.

Labels (1)
0 Kudos
Reply
20 Replies

6,750 Views
JackChen2022
Contributor I

JackChen2022_0-1705570796126.jpeg

JackChen2022_1-1705570814295.jpeg

 

 

0 Kudos
Reply

6,758 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @JackChen2022 ,

Could you please send me all of ENET's registers after ENET_DRV_SendFrame() and before ENET_DRV_GetTransmitStatus() ?

Best regards,

Nhi

0 Kudos
Reply

6,746 Views
JackChen2022
Contributor I

The two images are the forward and backward changes to the registers when ENET_ActivateReceive() is executed in the ENET_DRV_Init() function.

screenshot-20240118-175356.png

screenshot-20240118-175416.png

0 Kudos
Reply

6,739 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @JackChen2022 ,

Could you please dump to value in the register TDSR and RDSR before and after error occurred?

Best regards,

Nhi

0 Kudos
Reply

6,700 Views
JackChen2022
Contributor I
Hello, do you have any suggestions for my feedback? The values of registers TDSR and RDSR have been sent to you with pictures, and there is no solution to this problem at present
0 Kudos
Reply

6,698 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @JackChen2022 ,

Unfortunately, I have no board to check this at the moment. But I thought that maybe your issue come from you didn't give accessing to buffer descriptor. So, my suggestion at the moment is one of them that you can try:

- Disable MPU.

- If MPU enabled, then you can configure memory region (that contains buffer descriptors of ETH) as below:

Nhi_Nguyen_0-1705649075294.png

I have no SDK package, but please find in your package.

Best regards,

Nhi

 

0 Kudos
Reply

6,693 Views
JackChen2022
Contributor I

Thank you very much for your reply.
EB tool on my side does not have permission to configure OS_MPU, and I did not find the switch of disabled MPU on Da Vinci tool. The transplanted lwip protocol stack is S32SDK_S32K1xx_RTM_3.0.0 downloaded by the S32DS tool, which does not use the full Autosar tool chain, so I want to know if there is any other way to solve this problem.

I looked at the code and found that the MPU feature should be turned off.

11.png

 

12.png  

JackChen2022_1-1705655705966.png

JackChen2022_0-1705655622572.png

JackChen2022_2-1705655774447.png

 

 

 

  

0 Kudos
Reply

6,689 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @JackChen2022 ,

Can you please send me registers in MPU before the function ENET_ActivateReceive/ENET_ActivateTransmit written?

Nhi_Nguyen_0-1705656987256.png

Best regards,

Nhi

0 Kudos
Reply

6,684 Views
JackChen2022
Contributor I

Currently the debugging tool I use is Lauterbach, and MPU registers cannot be viewed.
Just now I manually add code to read the MPU_CESR register value, but it cannot be used, and an interrupt exception occurs. I don't know whether Autosar cannot read the register directly due to security requirements, or whether it needs to port the mpu_driver.c mpu_hw_access.c file to the project.

JackChen2022_0-1705658576569.pngJackChen2022_1-1705658907250.png

 

0 Kudos
Reply

6,677 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @JackChen2022 ,

Seem that MPU hasn't been provided clock. 

Nhi_Nguyen_0-1705661351430.pngNhi_Nguyen_1-1705661359501.pngNhi_Nguyen_2-1705661367761.png

You will set value of MPU's register and don't see ??? if MPU has clock.

Best regards,

Nhi

0 Kudos
Reply

6,658 Views
JackChen2022
Contributor I
Through Lauterbach debugging, it is confirmed that ECC error occurs when accessing the address of the variable rxDescriptor. What I don't understand is why this kind of problem still occurs when MPU has been disabled. Do you need to port the MPU driver in the SDK package to integrate into the Autosar project, and re-set the access rights to ENET after MPU initialization
0 Kudos
Reply

6,670 Views
JackChen2022
Contributor I

JackChen2022_0-1705664651066.png

JackChen2022_1-1705664703791.png

There is something wrong with the screenshot just now. I re-screenshot Lauterbach's register value to see the problem more clearly.

 

 

0 Kudos
Reply

6,672 Views
JackChen2022
Contributor I

JackChen2022_0-1705664167631.png

Just because MPU CLOCK Enable is not set, the register value of MPU_CESR is read after enabling, and the difference is shown in the picture.

0 Kudos
Reply

6,635 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @JackChen2022 ,

This indicated that MPU is enabled. You can try to disable MPU before initializing ENET?

Best regards,

Nhi

0 Kudos
Reply

6,616 Views
JackChen2022
Contributor I
Ok, I ported mpc driver from S32SDK_S32K1xx_RTM_3.0.0 using MPU_DRV_Deinit() before lwip module initialization; Davinci Autosar MPU default configuration may have compatibility issues, you need to manually call the MPU_DRV_Deinit() function.
0 Kudos
Reply

6,620 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @JackChen2022 ,

You can disable MPU as below:

/* Disable MPU */
IP_MPU->CESR = 0x00815200u;

Best regards,

Nhi

6,735 Views
JackChen2022
Contributor I

After executing the ENET_ActivateReceive() function, both TDSR and RDSR are updated to 0.
Until the ENET_ActivateReceive() function is executed, the TDSR and RDSR values are normal and are the same as s_enetBases[instance].

0 Kudos
Reply

6,734 Views
JackChen2022
Contributor I
 
0 Kudos
Reply

6,748 Views
JackChen2022
Contributor I

Several similar problems were found in the forum, but no concrete solutions were found.
I used the Autosar Dafinqi tool, called the SDK driver of S32DS, and ported the lwip protocol stack

0 Kudos
Reply

6,752 Views
JackChen2022
Contributor I
I found a thread on the forum with the same problem, but had no idea how it was solved. The function has not yet reached ENET_DRV_SendFrame() and ENET_DRV_GetTransmitStatus(). After initializing the ENET_DRV_Init() function, executing the ENET_ActivateReceive() function and ENET_ActivateTransmit() results in the EBERR, register
EIR = 0x00400000,
ECR = 0xF0000110
RDSR = 0x00000000,
TDSR = 0x00000000
0 Kudos
Reply