iperf with LWIP/FreeRTOS

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiMc_1688136
Level 5
Level 5
10 sign-ins 50 questions asked 10 solutions authored

I can only run UDP with iperf and LWIP in SDK 6.2.1. If i attempt to run TCP mode, the system crashes with an assert in the network stack:

CYW43907

Function: low_level_output

Line: 202

Thread: tcpip_thread

LWIP_ASSERT( "No chained buffers", ( ( p->next == NULL ) && ( ( p->tot_len == p->len ) ) ) );

Any ideas for a fix to allow TCP and lwip?

With UDP, the transmit buffer is limited to 4.28KB which appears to negatively impact the throuhhput result but I cannot change it with the -w arugment so i guess it is based on a LWIP configuration? Anyone know where to change this?

0 Likes
10 Replies
NiMc_1688136
Level 5
Level 5
10 sign-ins 50 questions asked 10 solutions authored

Per #1, the console test app in 6.2.1 works with TCP. Strange that it works here and not in my application, both are running FreeRTOS and LWIP.

Per #2, in the console app, the UDP buffer size is 14.3 KBytes so this seems like defines in the console makefile setup this.

0 Likes

Higher UDP throughput is working by pulling some defines from the console makefile for the CYW43907

GLOBAL_DEFINES += TX_PACKET_POOL_SIZE=40 \

                  RX_PACKET_POOL_SIZE=40 \

                  WICED_TCP_TX_DEPTH_QUEUE=32 \

                  WICED_ETHERNET_DESCNUM_TX=32 \

                  WICED_ETHERNET_DESCNUM_RX=8 \

                  WICED_ETHERNET_RX_PACKET_POOL_SIZE=40+WICED_ETHERNET_DESCNUM_RX \

                  WICED_TCP_WINDOW_SIZE=32768

TCP with IPERF is still failing on my end. I have asserts enabled to catch fatal errors in the network stack but maybe the no chained buffer assert is not fatal

0 Likes

I checked the test.console example in SDK 6.2.1 with FreeRTOS/LwIP combination. I don't seem to hit any asserts with tcp with iperf.

Platform CYW943907AEVAL1F initialised

Started FreeRTOS v9.0.0

WICED_core Initialized

Initialising LwIP v2.0.3

DHCP CLIENT hostname WICED IP

WWD SoC.43909 interface initializing with US/0

WLAN MAC Address : A4:08:EA:D9:D4:E6

WLAN Firmware    : wl0: Feb 26 2019 18:16:13 version 7.15.168.126 (r711020) FWID 01-bc2dab52

WLAN CLM        : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2019-02-26 18:10:19

Console app

> iperf -v

iperf version 2.1.0 (20 Feb 2012) single threaded

>

>

>

> join CY-IOT-HOTSPOT wpa2 12345678

Joining : CY-IOT-HOTSPOT

Successfully joined : CY-IOT-HOTSPOT

Setting IPv6 link-local address

Obtaining IPv4 address via DHCP

Waiting for IPv6 address validation

IPv6 Network ready IP: FE80::A608:EAFF:FED9:D4E6

IPv4 Network ready IP: 10.40.2.18

>

>

>

>

>

> iperf -c 10.40.2.166

------------------------------------------------------------

Client connecting to 10.40.2.166, TCP port 5001

TCP window size: 35.6 KByte (default)

------------------------------------------------------------

[ ID] Interval      Transfer    Bandwidth

[  0]  0.0-10.0 sec  11.2 MBytes  9.38 Mbits/sec

Could you please provide a stripped down version of your application so that we can reproduce this on our end?

To increase the throughput; i.e window size tunables are located in console.mk for iperf as you have already found out.

Thanks for the feedback.

Did you run the project in a debug build? Typically the asserts are disabled in normal builds but enabled in debug. In my application i have enabled asserts in normal builds so they can be logged and then reset the processor.

0 Likes

I checked it in the debug build only hoping to see the assert. Is there anything else that you think might be differing in our setups (or some piece of assert enabled etc)?

0 Likes

Raktim Roy wrote:

I checked the test.console example in SDK 6.2.1 with FreeRTOS/LwIP combination. I don't seem to hit any asserts with tcp with iperf.

  1. Platform CYW943907AEVAL1F initialised 
  2. Started FreeRTOS v9.0.0 
  3. WICED_core Initialized 
  4. Initialising LwIP v2.0.3 
  5. DHCP CLIENT hostname WICED IP 
  6. WWD SoC.43909 interface initializing with US/0 
  7. WLAN MAC Address : A4:08:EA:D9:D4:E6 
  8. WLAN Firmware    : wl0: Feb 26 2019 18:16:13 version 7.15.168.126 (r711020) FWID 01-bc2dab52 
  9. WLAN CLM        : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2019-02-26 18:10:19 

The WLAN firmwaree shows you tested a newer sdk version rather than sdk-6.2.1.

0 Likes

Good catch axel.lin_1746341

RaktimR_11, are you testing with 6.2.1 or the latest internal branch that will become the SDK (6.4)?

0 Likes

I am testing in SDK 6.2.1. Please check the log below but I am not seeing any asserts. The firmware/ blob file was different in the earlier log. Thanks for pointing that out.

Starting WICED vWiced_006.002.001.0013

Platform CYW943907AEVAL1F initialised

Started FreeRTOS v9.0.0

Initialising LwIP v2.0.3

DHCP CLIENT hostname WICED IP

WWD SoC.43909 interface initializing with US/0

WLAN MAC Address : A4:08:EA:D9:D4:E6

WLAN Firmware    : wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905

WLAN CLM        : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-05-15 19:33:15

Init took ~449 ms

Console app

> wl ver

7.16 RC99.19

wl0: May 15 2018 19:39:17 version 7.15.168.114 (r689934) FWID 01-d6f88905

>

>

>

>

> join CY-IOT-HOTSPOT wpa2 10t12356b1

Successfully joined : CY-IOT-HOTSPOT

Setting IPv6 link-local address

Obtaining IPv4 address via DHCP

Waiting for IPv6 address validation

IPv6 Network ready IP: FE80::A608:EAFF:FED9:D4E6

IPv4 Network ready IP: 10.40.2.180

>

>

> iperf -c 10.40.2.164

------------------------------------------------------------

Client connecting to 10.40.2.164, TCP port 5001

TCP window size: 24.6 KByte (default)

------------------------------------------------------------

[ ID] Interval      Transfer    Bandwidth

[  0]  0.0-10.0 sec  1.33 MBytes  1.11 Mbits/sec

Raktim Roy wrote:

I am testing in SDK 6.2.1. Please check the log below but I am not seeing any asserts. The firmware/ blob file was different in the earlier log. Thanks for pointing that out.

  1. Starting WICED vWiced_006.002.001.0013 

Your SDK 6.2.1 (vWiced_006.002.001.0013) is different from the public download sdk-6.2.1 (vWiced_006.002.001.0002).

Anyway, I just want to point out that you had better use the same sdk to reproduce the user reported issue.

BTW, I remember that I observed the same assert.

0 Likes

Hello,

I have the same problem, after analysis, I concluded that WICED SDK 6.4 with LWIP/FreeRTOS for CYW43907 is not finished yet, wish Cypress will make LWIP/FreeRTOS for CYW43907 ready as soon as possible.

LwIP uses chained pbuf when sending TCP packets, but WWD is not support yet:

1. in WICED/platform/MCU/BCM4390x/peripherals/shared/m2m_hnddma.c, function m2m_dma_txfast is the last function which will send packet to wifi MCU, the code that support chained buffers is commented, it will only send the first packet of the buffer chain, if ignore LWIP_ASSERT( "No chained buffers", ( ( p->next == NULL ) && ( ( p->tot_len == p->len ) ) ) ) in low_level_output/wwd_network.c, data will not send correctly.

m2m_dma.png

2. in WICED/WWD/internal/wwd_sdpcm.c, some code in wwd_sdpcm_send_common also implied this( SUPPORT_BUFFER_CHAINING was not defined):

截屏2020-02-29下午12.25.15.png