Hi! This is my first FreeRTOS project. I’m working in STMCubeIDE under Ubuntu20 with a config for the STMH745ZI-Q Nucleo I generated from STMCubeMX using GCC as the compiler. I’ve followed the bits of advice I’ve gathered from here, including deleting the CubeMX-generated stm32h7xx_eth.c, enabling ethernet global interrupt, set HAL Timer to TIM1, increased configTOTAL_HEAP_SIZE to 120000, updating the linker to include .ethernet_data, externing NetworkInterface.c’s references to the DMARxDscrTab (and Tx) in main.c and indicating the linker section for .ethernet_data and verified it from the .map file. Here’s my repo: GitHub - diydsp/safertos_tcptest: testing SafeRTOS/FreeRTOS with FreeRTOS-plus-TCP
I can compile successfully and step through the initial creation of tasks, but I’m stuck on the networking when I attempt to ping my board. I see the ARP packet enter, get processed and the proper functions call to transmit it, but no packet comes out? Any advice?
My setup:
I set up a point to point network from my laptop’s wired ethernet to the Nucleo with the linux command:
sudo ip a add 192.168.2.1/24 dev enx00e04c680286
Note, there’s nothing else on that network, just the cable between the laptop and the dev board. I see the green link light, and the orange light is steady on, except for going dark about once per second when pinging:
ping 192.168.2.2
Here’s my config from main.c:
static uint8_t ucMACAddress[ 6 ] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 };
static const uint8_t ucIPAddress[ 4 ] = { 192, 168, 2, 2 };
static const uint8_t ucNetMask[ 4 ] = { 255, 255, 255, 0 };
static const uint8_t ucGatewayAddress[ 4 ] = { 192, 168, 2, 1 };
static const uint8_t ucDNSServerAddress[ 4 ] = { 208, 67, 222, 222 };
When I ping the ethernet on my Nucleo, I can see the request come through with wireshark, and I see the packet get processed inside FreeRTOS, all the way up through the point where it should be re-transmitted. However, the ping ends with “host unreachable,” and I don’t see a packet transmitted from the dev board with wireshark.
Here is an outline of key points I see stepping through the code on the ping receive. However, after the WRITE_REG, no packet is visible on wireshark Any advice?
prvProcessEthernetPacket()
switch( pxEthernetHeader->usFrameType )
case ipARP_FRAME_TYPE:
eReturned = eARPProcessPacket( ipCAST_PTR_TO_TYPE_PTR( ARPPacket_t, pxNetworkBuffer->pucEthernetBuffer ) );
( void ) memcpy( pvCopyDest, pvCopySource, sizeof( ulSenderProtocolAddress ) );
uint32_t ulHostEndianProtocolAddr = FreeRTOS_ntohl( ulSenderProtocolAddress );
traceARP_PACKET_RECEIVED();
iptraceSENDING_ARP_REPLY( ulSenderProtocolAddress );
eReturn = eReturnEthernetFrame;
case eReturnEthernetFrame:
vReturnEthernetFrame( pxNetworkBuffer, pdTRUE );
case ipARP_FRAME_TYPE:
pvCopySource = &pxEthernetHeader->xSourceAddress;
( void ) xNetworkInterfaceOutput( pxNetworkBuffer, xReleaseAfterSend );
if( HAL_ETH_Transmit_IT( &( xEthHandle ), &( xTxConfig ) ) == HAL_OK )
if( ETH_Prepare_Tx_Descriptors( heth, pTxConfig, 1 ) != HAL_ETH_ERROR_NONE )
WRITE_REG( heth->Instance->DMACTDTPR, ( uint32_t ) ( heth->TxDescList.TxDesc[ heth->TxDescList.CurTxDesc ] ) );
xResult = pdPASS;
Thank you.