Skip to content

Commit 9021eb8

Browse files
STM32H legacy driver fix: request usable RX size in legacy zero-copy path
The STM32H legacy zero-copy RX path still requested ETH_RX_BUF_SIZE for replacement RX buffers even though BufferAllocation_1 now limits allocations to the interface-reported usable size. For this driver the usable size is ETH_RX_BUF_SIZE - ipBUFFER_PADDING. Requesting the full hardware buffer size caused every replacement allocation to fail, left pxReceivedBuffer as NULL, and dropped all received frames before they reached the IP task. Request ETH_RX_BUF_SIZE - ipBUFFER_PADDING in the RX fast path so the receive path matches the enforced allocation limit.
1 parent c123610 commit 9021eb8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

source/portable/NetworkInterface/STM32/Legacy/STM32Hxx/NetworkInterface.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,9 @@ static BaseType_t prvNetworkInterfaceInput( void )
780780

781781
#if ( ipconfigZERO_COPY_RX_DRIVER != 0 )
782782
{
783-
/* Reserve the maximum length for the next reception. */
784-
uxLength = ETH_RX_BUF_SIZE;
783+
/* Request the usable Ethernet payload area, excluding the descriptor
784+
* metadata stored in front of pucEthernetBuffer. */
785+
uxLength = ETH_RX_BUF_SIZE - ipBUFFER_PADDING;
785786

786787
if( data_buffer.buffer != NULL )
787788
{

0 commit comments

Comments
 (0)