STM32F7 and FreeRTOS+TCP

I am having trouble getting the TCP stack to work with my STM32F746 Nucleo. I have been able to port the stack to my project and can compile the program. I am trying to use a static IP address and I am directly connected to my computer with a USB-Ethernet adapter, which seems to be working fine. I am seeing that after I call FreeRTOS_IPInit(), the network hook vApplicationIPNetworkEventHook() gets correctly called and the network goes up.

The problem I am having is that I cannot ping the board. Using wireshark I am seeing that there are some gratuitous ARP from the STM32, but when I ping I get host unreachable.

My project can be found here if that helps. I’ve done some debugging but I haven’t been able to find anything obvious. Any advice on this would be appreciated.

Is your static IP address on the same subnet as your host computer?
Do you have ipconfigREPLY_TO_INCOMING_PINGS set to 1 in FreeRTOSIPConfig.h?
If you are connected point to point with your host computer - are you using a Crossover/point-to-point Ethernet cable (necessary unless the Ethernet jack on the target will auto-switch).

Yes the subnets are the same, I have for the target and my host is

I do have the reply to pings config set to 1

As for the cable, I’m not using a crossover cable and I do not have access to one at the moment. Although I am able to connect a router as a buffer between the host and target, although there is no change when I do this.

Ref the IP addresses - you also need to check the netmask. In this case I’m going to guess it would be

Probably the next thing to do would be to set a break point in receive path in the MAC driver to see if it is receiving anything at all. If it is, then you can step through the code to follow the received data through the receive path to see how far it gets.

Netmask is on both ends. I will report back what I can find when stepping the code.

A few notes:

  • I am seeing that ETH_IRQHandler() is never called even when I ping the device.

  • I am also seeing the LinkStatus for xETH is always 0. But this piece of code in NetworkInterface.c …

    if( xPhyObject.ulLinkStatusMask != 0 )
      xETH.Instance->DMAIER |= ETH_DMA_ALL_INTS;
      xResult = pdPASS;
      FreeRTOS_printf( ( "Link Status is high\n" ) ) ;

… gets entered so I guess the interface is going up?

Sorry for basic question - but are you enabling the ETH interrupt, and setting its priority appropriately (it can’t be left at its default if it makes calls to
FreeRTOS API functions).

1 Like

Well, I’m glad you asked the basic question because that was totally the issue. When I generated the CubeMX project, I left the ETH setting untouched and by default it is in polling mode, so in the MSP Init function it generated it didn’t enable the ETH interrupt. Thank you!