Skip to content

Commit 65942ba

Browse files
committed
MIMXRT1050: Fix ENET issues
This is a fix for Issue 10239. The change aligns the receive buffer lengths Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent d8dc981 commit 65942ba

File tree

1 file changed

+4
-2
lines changed
  • features/netsocket/emac-drivers/TARGET_NXP_EMAC/TARGET_IMX

1 file changed

+4
-2
lines changed

features/netsocket/emac-drivers/TARGET_NXP_EMAC/TARGET_IMX/imx_emac.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ bool Kinetis_EMAC::low_level_init_successful()
189189

190190
/* Create buffers for each receive BD */
191191
for (i = 0; i < ENET_RX_RING_LEN; i++) {
192-
rx_buff[i] = memory_manager->alloc_heap(ENET_ETH_MAX_FLEN, ENET_BUFF_ALIGNMENT);
192+
rx_buff[i] = memory_manager->alloc_heap(ENET_ALIGN(ENET_ETH_MAX_FLEN, ENET_BUFF_ALIGNMENT),
193+
ENET_BUFF_ALIGNMENT);
193194
if (NULL == rx_buff[i])
194195
return false;
195196

@@ -279,7 +280,8 @@ emac_mem_buf_t *Kinetis_EMAC::low_level_input(int idx)
279280
memory_manager->set_len(p, length);
280281

281282
/* Attempt to queue new buffer */
282-
temp_rxbuf = memory_manager->alloc_heap(ENET_ETH_MAX_FLEN, ENET_BUFF_ALIGNMENT);
283+
temp_rxbuf = memory_manager->alloc_heap(ENET_ALIGN(ENET_ETH_MAX_FLEN, ENET_BUFF_ALIGNMENT),
284+
ENET_BUFF_ALIGNMENT);
283285
if (NULL == temp_rxbuf) {
284286
/* Re-queue the same buffer */
285287
update_read_buffer(NULL);

0 commit comments

Comments
 (0)