2022-09-13 12:27 AM
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.
May be what is the issue ? can help me in this regards.
regards
srikanth
2022-09-13 06:17 AM
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.
2022-09-13 11:09 PM
Thank you for reply, We will check and let you know.
2022-09-15 05:59 AM
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 ?
2022-09-15 06:14 AM
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.
2022-09-16 02:25 AM
Okay, thank you.