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.
Hi @JackChen2022 ,
Could you please send me all of ENET's registers after ENET_DRV_SendFrame() and before ENET_DRV_GetTransmitStatus() ?
Best regards,
Nhi
The two images are the forward and backward changes to the registers when ENET_ActivateReceive() is executed in the ENET_DRV_Init() function.
Hi @JackChen2022 ,
Could you please dump to value in the register TDSR and RDSR before and after error occurred?
Best regards,
Nhi
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:
I have no SDK package, but please find in your package.
Best regards,
Nhi
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.
Hi @JackChen2022 ,
Can you please send me registers in MPU before the function ENET_ActivateReceive/ENET_ActivateTransmit written?
Best regards,
Nhi
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.
Hi @JackChen2022 ,
Seem that MPU hasn't been provided clock.
You will set value of MPU's register and don't see ??? if MPU has clock.
Best regards,
Nhi
There is something wrong with the screenshot just now. I re-screenshot Lauterbach's register value to see the problem more clearly.
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.
Hi @JackChen2022 ,
This indicated that MPU is enabled. You can try to disable MPU before initializing ENET?
Best regards,
Nhi
Hi @JackChen2022 ,
You can disable MPU as below:
/* Disable MPU */
IP_MPU->CESR = 0x00815200u;
Best regards,
Nhi