cancel
Showing results for 
Search instead for 
Did you mean: 

MAC internal registers has not reset in STM32MP157

srikanth
Associate III

Actually, we are trying to reset the MAC registers by using DMA mode register (bit 0) in Ethernet section.

As per reference manual, we are set the bit(swr bit) to 1 in ETH_DMAMR_REG register. but it is not reset automatically.

In software we done

// Enable eth clocks

  __HAL_RCC_ETH1CK_CLK_ENABLE();

  __HAL_RCC_ETH1TX_CLK_ENABLE();

  __HAL_RCC_ETH1RX_CLK_ENABLE();

  __HAL_RCC_ETH1MAC_CLK_ENABLE();

// Provide a software reset to reset all MAC internal registers

writeptr = (uint32_t*)(ETH_BASE_ADDRESS + ETH_DMAMR_REG);

SET_BIT(*writeptr,ETH_DMAMR_SWR); // make 0 bit to 1 for sw reset

readptr = (uint32_t*)(ETH_BASE_ADDRESS + ETH_DMAMR_REG);

while(READ_BIT(*readptr,ETH_DMAMR_SWR)); // checking the 0 bit till software reset has done( bit is reset).

In this writing has completed but we are unable to read 0 from this register.0693W00000SvEfTQAV.png 

May be what is the issue ? can help me in this regards.

regards

srikanth

5 REPLIES 5
PatrickF
ST Employee

Hi @srikanth​ ,

in order to complete the reset, the GMAC need to have a clock present on its clk_tx and clk_rx clocks.

Please have a look to RM0436 rev.6 Figure 83 which give a very helpful view.

Which kind of PHY interface are you using ?

For RGMII and GMII, you need to have clock present on ETH_CLK125 (or internally from RCC).

for RMII, you need to have clock present on ETH_REF_CLK.

For MII, you need to have clock on both ETH_RX_CLK and ETH_RX_CLK

You also need to setup some SYSCFG bits before issuing the reset.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thank you for reply, We will check and let you know.

srikanth
Associate III

Now the reset issue has solved. we are able to write and read the ethernet registers.

We are using RGMII mode and internal RCC clock.

Now we are to trying transmit/receive descriptors. How this descriptors initialization takes place and which memory need to use for this descriptors ?

Hi,

sorry, I can't help on that subject.

ETH IP is supposed to be used only using Linux driver.

For more details see :

https://wiki.st.com/stm32mpu/wiki/ETH_internal_peripheral

https://wiki.st.com/stm32mpu/wiki/Ethernet_overview

https://wiki.st.com/stm32mpu/wiki/Ethernet_device_tree_configuration

https://wiki.st.com/stm32mpu/wiki/How_to_configure_ethernet_interface

To use ETH in bare-metal, you might refer uBoot code.

Alternatively, STM32H7 HAL have similar ETH IP (but not Gigabit) and HAL library is provided.

But this would be your own clever custom development. STMicroelectronics do not provide support for STM32MP15 in bare metal.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Okay, thank you.