2021-09-23 05:59 AM
When the HAL_ETH_Transmit is called by the driver it seems the code below (part of HAL_ETH_Transmit ) times out as the DMA TX complete callback are not called. I've followed the STM32H743 example but I guess STM32H742 memory map is a bit different than H743. Does anyone tries Ethernet on STM32H742 ?
Thanks
The timeout error
while((dmatxdesc->DESC3 & ETH_DMATXNDESCWBF_OWN) != (uint32_t)RESET)
{
if((heth->Instance->DMACSR & ETH_DMACSR_FBE) != (uint32_t)RESET)
{
heth->ErrorCode |= HAL_ETH_ERROR_DMA;
heth->DMAErrorCode = heth->Instance->DMACSR;
/* Set ETH HAL State to Ready */
heth->gState = HAL_ETH_STATE_ERROR;
/* Return function status */
return HAL_ERROR;
}
/* Check for the Timeout */
if(Timeout != HAL_MAX_DELAY)
{
if(((HAL_GetTick() - tickstart ) > Timeout) || (Timeout == 0U))
{
heth->ErrorCode |= HAL_ETH_ERROR_TIMEOUT;
heth->gState = HAL_ETH_STATE_ERROR;
return HAL_ERROR;
}
}
}
2021-09-23 02:11 PM
The project is for *F*742 and you run it on *H*742?
Really?
2021-09-24 03:29 AM
Sorry, bad Copy and past, it is STM32H742VGT, I've fixed the
original post.
2021-09-24 03:36 AM
Hi - The problem maybe timer related or memory location (.ld). There is a good series of videos by controllertech on you tube regarding this.
It helped me to get my STM32H743ZI2 going!
2021-09-28 09:42 PM
Hi clock.1166
Thanks for your answer, could you please give more info about the timer
Thanks
2021-09-28 11:19 PM
There are many videos available. I found the it best to start with this one:
https://controllerstech.com/stm32-ethernet-1-connection/
or
https://www.youtube.com/watch?v=MJfUiw8bZEI - memory management
Its best that you look at all the relevant videos in the series.
He explains and uses Timer6 instead of the preset timertick.
This is also handy:
https://community.st.com/s/article/FAQ-Ethernet-not-working-on-STM32H7x3
I am only starting to understand all this myself - its a long haul.
2021-09-29 08:51 AM
Honestly, that site and videos are as bad as HAL/Cube code itself. The guy has a shallow understanding and the code doesn't fix any real issues.
https://youtu.be/8r8w6mgSn1A?t=1082
The thing doesn't work... "Let me reset it once!" :D
The reality is that on H7 networking code of HAL/Cube basically doesn't work and it cannot be fixed with clicking CubeMX. Look here for more details:
https://community.st.com/s/question/0D50X0000C6eNNSSQ2/bug-fixes-stm32h7-ethernet
2021-09-30 02:24 AM
As I said, I am only just learning about webservers.
These videos helped me understand a bit more and also how to get the project working OK on STM32H743ZI2.
Some of us need a simple explanation!
Or even a shallow understanding!
2021-09-30 02:42 AM
TX timeout error can be because of disconnected cable or phy error.
This is my shallow understanding. Check the error value returned by the ETH driver or define callbacks for errors.
2024-07-26 11:58 PM
hey can u help me to configure stm32h742 im trying from last one month even till now it is not connected with lan can you please let me know the mpu config and the rx and tx decripter and heap address please help me