if( ipconfigDRIVERINCLUDEDTXIPCHECKSUM != 0 )
{ ProtocolPacket_t *pxPacket; /* If the peripheral must calculate the checksum, it wants the protocol checksum to have a value of zero. */ pxPacket = ( ProtocolPacket_t * ) ( pxDescriptor->pucEthernetBuffer ); if( pxPacket->xICMPPacket.xIPHeader.ucProtocol == ipPROTOCOLICMP ) { pxPacket->xICMPPacket.xICMPHeader.usChecksum = ( uint16t )0u; } }endif
/* Copy data from the FreeRTOS+TCP buffer into the peripheral driver’s own buffer The start of the data is located by pxDescriptor->pucEthernetBuffer. The length of the data is located by pxDescriptor->xDataLength. */ /** ————————————–QUESTION——————————————— HAL ETH ImplementationETH_BufferTypeDef Txbuffer; Txbuffer.buffer = pxDescriptor->pucEthernetBuffer; Txbuffer.len = pxDescriptor->xDataLength; Txbuffer.next = NULL;
/* ETH packet TxConfig is defined and initialized in eth.c*/
TxConfig.Length = pxDescriptor->xDataLength;
TxConfig.TxBuffer = &Txbuffer;
HAL_StatusTypeDef status = HAL_ETH_Transmit(&heth, &TxConfig, 0);
// I get error! because …
// (heth->Instance->DMACSR & ETHDMACSRFBE) != (uint32t)RESET)
if(status == HALERROR){
// Error.
}
—————————————————————————————————–*/
/* Call the standard trace macro to log the send event. */
iptraceNETWORK_INTERFACE_TRANSMIT();
if( xReleaseAfterSend != pdFALSE )
{
/* It is assumed SendData() copies the data out of the FreeRTOS+TCP Ethernet
buffer. The Ethernet buffer is therefore no longer needed, and must be
freed for re-use. */
vReleaseNetworkBufferAndDescriptor( pxDescriptor );
}
return pdTRUE;
}
~~~
This is my first time with HAL and Ethernet and is confusing to understand how I should proceed.
Thanks for any help or suggestion.