Use ENET_SetMII() function without disabling Ethernet MAC

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Use ENET_SetMII() function without disabling Ethernet MAC

1,169 次查看
ombra32
Contributor III

Hi,

I need to dynamically change MAC controller speed and duplex, based on values auto-negotiated by PHY at each link up.

In iMXRT1176 SDK there is a function named ENET_SetMII(), created exactly with that purpose:

 

/*!
 * brief Sets the ENET MII speed and duplex.
 *
 * This API is provided to dynamically change the speed and dulpex for MAC.
 *
 * param base  ENET peripheral base address.
 * param speed The speed of the RMII mode.
 * param duplex The duplex of the RMII mode.
 */
void ENET_SetMII(ENET_Type *base, enet_mii_speed_t speed, enet_mii_duplex_t duplex)
{

 

I've tried it on my code, and it works like a charm!

But iMXRT1170 Reference Manual states that TCR->FDEN register (changed by ENET_SetMII() function) can be modified only with ECR->ETHEREN = 0 (Ethernet MAC disabled).

mac2.PNG

So, now the question is: is really safe to use ENET_SetMII() function to dynamically change speed and duplex of MAC controller, without disabling it?

 

Best regards,

Marco

0 项奖励
回复
3 回复数

1,148 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) Is really safe to use ENET_SetMII() function to dynamically change speed and duplex of MAC controller, without disabling it?
-- No, I'm afraid not, it's a risk to do it.
Have a great day,t
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

1,137 次查看
ombra32
Contributor III

Ok, so what is the best suggested way to manage ENET MAC after PHY re-link?

0 项奖励
回复

1,129 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) So what is the best suggested way to manage ENET MAC after PHY re-link?
-- It seems like that it needs to reInitialize the ENET module.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复