Skip to main content
Michael Steinecke
Associate II
Aug 28, 2014 1:57 PM UTC
Question

Low TCP/IP transmit perormance with STM32CubeMX and STM32F429ZG

Posted on August 28, 2014 at 15:57

Hello,

currently I'm porting a STM32F103ZG / Wiznet W5300 Ethernet and SPL based  to a STM32F429ZG / STM32CubeMX / LwIP based application. Both versions using FreeRTOS. In both cases its a custom board.

I'm struggling on a quite low performance of the Ethernet part. The application transmits a large amount of data from the SD Card to a remote PC using the TCP RAW API of LwIP. The transmit rate is about 20 kB/s. Currently, I guess the biggest berformance gain would be optimizing the low level Ethernet device driver.

low_level_output() needs about 25 us for 60 bytes and 200us for 1524 bytes. This indicates a limitation to ~45 MBit/s just by writing data to the output. And then, the device would had no time to do anything else.

low_level_output() uses memcpy() to copy the data. Is this an actual DMA transfer or CPU bound work?

In my case, the copy wouldn't necessary at all. With LwIP, all the data is statically in the RAM, as long as the package hasn't been acknowledged. Is there a zero-copy driver implementation around? There is a big

http://forum.chibios.org/phpbb/viewtopic.php?f=3&t=857

in the ChibiOS forums, regarding that topic. Has someone already tried to use their findings together with the CubeMX driver and FreeRTOS? Unfortunately, I'm unable to download the Dropbox stuff from work.

Any other tips to increase the performance?

Versions used:

STM32F429ZG 180 MHz clock

IM2516SDBATG 16 MB SDRAM holding the buffered data

STM32CubeMX V4.3.0 together with FW lib 1.3.0

FreeRTOS 7.60

LwIP V4.1.? (provided by Cube)

#tcp/ip #stm32 #lwip #stm32f4 #cubemx
This topic has been closed for replies.

12 replies

Michael Steinecke
Associate II
Oct 2, 2014 8:22 AM UTC
Posted on October 02, 2014 at 10:22

FreeRTOS asserts a Semaphore- or QueueFull error without

the pendingRxFrames, on subsequent interrupts

. In default, this assert is not reported. It's bad design to let this happen, in my opinion. Someone may struggle on this, later on.

metin2
Visitor II
May 12, 2015 8:48 AM UTC
Posted on May 12, 2015 at 10:48

Hi!

I'm really interested in your zero-copy ethernet driver. Does it work with zero-copy in both directions?