As
xNetworkInterfaceInitialise()
had become quite large and therefore less readable, I’ve split up some code into separate functions:
~~~
/* Initialise TX-descriptors. */
prvDMATxDescListInit();
/* Initialise RX-descriptors. */
prvDMARxDescListInit();
~~~
This time I also I included the latest iperf3 module. I tested on a STM3240G-EVAL, using the following defines for iperf:
~~~
/* Some defines for iperf, optimised for speed.
/
/ Put these in your ‘FreeRTOSIPConfig.h’ */
#define ipconfigIPERF_DOES_ECHO_UDP 0
#define ipconfigIPERF_VERSION 3
#define ipconfigIPERF_STACK_SIZE_IPERF_TASK 680
#define ipconfigIPERF_TX_BUFSIZE ( 8 * ipconfigTCP_MSS )
#define ipconfigIPERF_TX_WINSIZE ( 6 )
#define ipconfigIPERF_RX_BUFSIZE ( 8 * ipconfigTCP_MSS )
#define ipconfigIPERF_RX_WINSIZE ( 6 )
/* The iperf module declares a character buffer to store its send data. */
#define ipconfigIPERF_RECV_BUFFER_SIZE ( 2 * ipconfigTCP_MSS )
~~~
The above parameters are optimised for speed.
The iperf driver can be started by calling
vIPerfInstall()
once after the network is up (
vApplicationIPNetworkEventHook()
is called with eNetworkUp ).
Here is an example optimised for memory usage:
~~~
/* Defines for iperf, optimised for memory usage. */
#define ipconfigIPERF_TX_BUFSIZE ( 3 * ipconfigTCP_MSS )
#define ipconfigIPERF_TX_WINSIZE ( 2 )
#define ipconfigIPERF_RX_BUFSIZE ( 3 * ipconfigTCP_MSS )
#define ipconfigIPERF_RX_WINSIZE ( 2 )
~~~
Today I re-tested the
memcpy()
mode: it still functions. Using zero-copy is especially profitable when the device is sending data.