Skip to main content
Visitor II
February 15, 2020
Question

Can't Receive Ethernet packets in STM32H750VB

  • February 15, 2020
  • 1 reply
  • 2038 views

Hi all,

I have used the Ethernet in my custom design board based on STM32H750VB and using STM32CubeIDE with the latest updates. It has an RMII connection to a PHY and I could successfully send UDP packets to the PC both with both polling and interrupt based methods. Unfortunately, I can't receive any packet from PC. Below are my observations:

  1. I am sure that PC is sending UDP broadcast packets because I see them on the Wireshark!.
  2. I have also seen that RXD[1:0] and CRS_DV signals are toggling and connected to the Microcontroller. hence there is not any problem with the PHY chip (LAN8742A).
  3. I have also configured the filters to pass all broadcast messages and every other filter settings to make sure that nothing is filtered in any layer.
  4. When I connect cable and immediately after initialization I see that MTLQICSR register changes to a state that shows receive overflow in MTL buffer happened and also MTLRQDR register shows that RX Queue is half or Full!. This happens even if I activate filters of MAC!. This is kind a strange because when all filters are nabled MAC should only pass specific packets to MTL!. while I am not sending any packets.

Regarding above descriptions I don't know why no packet is received or why HAL_ETH_IsRxDataAvailable() function can't find any received message.

I have also some questions I don't know why the automatic generated code doesn't use or initialize Rx_Buff array? Isn't it needed for the polling or interrupt mode?

I would really appreciate any help on this issue.

Thanks in advance,

Hossein

    This topic has been closed for replies.

    1 reply

    Explorer
    February 16, 2020

    Perhaps HAL_ETH_Start_IT hasn't been called.

    Check out https://community.st.com/s/question/0D50X0000C6eNNSSQ2/bug-fixes-stm32h7-ethernet too.

    HMora.1Author
    Visitor II
    February 17, 2020

    Hi alister,

    Thanks for your reply. At least someone is here to answer what ST have not done in their drivers!. That's a shame!. However, I have called HAL_ETH_Start_IT as well. I have also tried your mentioned changes in that post. Below are my main modifications:

    1. I have replaced two files completely from your modified ones(stm32h7xx_hal_eth.c & stm32h7xx_hal_eth.h).
    2. I am not using D-Cache.
    3. I am not using a middleware like FreeRTOS, it is a simple standalone project none of polling or interrupt modes are receiving. but, I do not have problem in TX side.
    4. Once I tried to configure MPU for the start address of Ethernet - 0x30040000 - and tried to protect 32KB which covers all RX/TX buffers. It did not work. Then I replaced your MPU configuration that I don't know why you have used two regions starting from 0x30040000!. - can't realize differences between these two regions. After these modifications now I see that HArdFault_Handler() happens immediately in the _ETH_Start() function that you have added HAL_ETH_BuildRxDescriptors() at the beginning of that.
    5. I have to also add that I don't know where in stm32h7xx_hal_conf.h file I have to add those new defines and include statements:

    /* Prevent "..\..\Core\Inc\stm32h7xx_hal_conf.h" from including stm32h7xx_hal_eth.h */

    #define STM32H7xx_HAL_ETH_H

    #include "..\..\Core\Inc\stm32h7xx_hal_conf.h"

    /* Fix incorrectly-configured ETH macros */

    #undef ETH_TX_DESC_CNT

    #undef ETH_RX_DESC_CNT

    #define ETH_TX_DESC_CNT 16

    #define ETH_RX_DESC_CNT 16

    /* Add not-yet-configured ETH macros */

    #define ETH_PMT_IT_ENABLED 0

    #define ETH_EEE_IT_ENABLED 0

    #define ETH_EXTI_IT_ENABLED 0

    /* Include stm32h7xx_hal_eth.h properly */

    #undef STM32H7xx_HAL_ETH_H

    #include "stm32h7xx_hal_eth.h"

    Once again thanks for your help,

    Hossein