lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] ERR_MEM when sending large data, LWIP stats show no err


From: address@hidden
Subject: Re: [lwip-users] ERR_MEM when sending large data, LWIP stats show no error
Date: Fri, 15 Sep 2017 20:34:52 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Adrian Figueroa wrote:
There is a list of chained DMA transmit descriptors, as they seem to be called. 
There is always four of them, this is hard coded.

My version of the STM32F4xx HAL driver leaves this as a define to the application... But you're limited by DMA-capable RAM, of course.

For sending, HAL_ETH_TransmitFrame(...) comes next. It checks, how many DMA TX 
buffers were used for the packet to be sent. This seems stupid, as 
low_level_output(...) knows how many of them it allocated. It could just pass 
this number on to HAL_ETH_TransmitFrame(...) but it does not.

Well,

There is a check, if a DMA descriptor is already in use or not before writing to it. So, 
I assume that it does not happen that a descriptor is overwritten. However, a DMA 
descriptor is marked as "in use" only in the HAL_ETH_TransmitFrame(...) 
function. So, if low_level_output(...) makes use of more than four DMA descriptors, some 
WILL be overwritten.

If every DMA buffer has room for 1514 bytes and you have netif->mtu set to 1500 (I hope), than low_level_output() will never fill more than one DMA descriptor!

I am not sure where to look next.

Me neither, sorry. I can confirm the HAL driver of my F4 fails as well, but I haven't yet found the time or the motivation to debug it. Using it with this driver is a toy project for me, so there hasn't been a strong need for it...

Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]