Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcp_echo_client test fails when trying to send 4096 byte packet #44

Open
simonqhughes opened this issue Jan 18, 2016 · 2 comments
Open
Labels

Comments

@simonqhughes
Copy link
Contributor

Hi

The tcp_echo_client test fails with the following error when trying to send a 4096 byte data packet:

MBED: Failed to send 4096 bytes. err=Memory allocation failed

The full serial console trace for the test is shown below.

$ mbedhtrun -v -d E: -f ".\build\frdm-k64f-gcc\test\sal-stack-lwip-test-tcp_echo_client.bin" -p COM40:9600 -C 4 -c default -m K64F -e test/host_tests
HOST: Inspecting 'd:\datastore\public\jobs\yr2016\2245\sdh_dev_3\sal-stack-lwip\test\host_tests' for local host tests...
HOST: Loading module 'sal_tcpclient.py':  <module 'sal_tcpclient' from 'd:\datastore\public\jobs\yr2016\2245\sdh_dev_3\sal-stack-lwip\test\host_tests\sal_tcpclient.pyc'>
HOST: Found host test implementation: sal_tcpclient.SalTcpClientTest -|> mbed_host_tests.host_tests.base_host_test.BaseHostTest
HOST: Registering 'sal_tcpclient.SalTcpClientTest' as 'sal_tcpclient'
HOST: Loading module 'sal_tcpserver.py':  <module 'sal_tcpserver' from 'd:\datastore\public\jobs\yr2016\2245\sdh_dev_3\sal-stack-lwip\test\host_tests\sal_tcpserver.pyc'>
HOST: Found host test implementation: sal_tcpserver.SalTcpServerTest -|> mbed_host_tests.host_tests.base_host_test.BaseHostTest
HOST: Registering 'sal_tcpserver.SalTcpServerTest' as 'sal_tcpserver'
HOST: Loading module 'sal_udpserver.py':  <module 'sal_udpserver' from 'd:\datastore\public\jobs\yr2016\2245\sdh_dev_3\sal-stack-lwip\test\host_tests\sal_udpserver.pyc'>
HOST: Found host test implementation: sal_udpserver.SalUdpServerTest -|> mbed_host_tests.host_tests.base_host_test.BaseHostTest
HOST: Registering 'sal_udpserver.SalUdpServerTest' as 'sal_udpserver'
MBED: Instrumentation: "COM40" and disk: "E:"
HOST: Copy image onto target...
        1 file(s) copied.
HOST: Initialize serial port...
...port ready!
HOST: Reset target...
HOST: Detecting test case properties...
HOST: Property 'timeout' = '20'
HOST: Property 'host_test_name' = 'sal_tcpserver'
HOST: Property 'description' = 'SalTcpServerTest'
HOST: Property 'test_id' = 'Socket Abstract Layer TCP Connection/Tx/Rx Socket Stream Test'
HOST: Start test...
MBED: MBED: SAL TCP Client waiting for server IP and port...
MBED:
MBED:
HOST: Sending server IP Address to target...
MBED: MBED: Address received: 10.2.203.21:56101
MBED: TCP client IP Address is 10.2.203.161
HOST: Connection received...

MBED: MBED: TCPClient IP Address is 10.2.203.161
MBED: {{summary socket_api_test_connect_close [PASS] (0/18 FAILED)}}
MBED:
HOST: Connection received...

HOST: Received 32 bytes of data

MBED: socket_api_test_echo_client_connected af: 1, pf: 2, connect: 1, server: 10.2.203.21:56101
MBED: TARGET sent 32 bytes
MBED: TARGET received 32 bytes
HOST: Received 64 bytes of data

MBED: TARGET sent 64 bytes
MBED: TARGET received 64 bytes
HOST: Received 128 bytes of data

MBED: TARGET sent 128 bytes
MBED: TARGET received 128 bytes
HOST: Received 256 bytes of data

MBED: TARGET sent 256 bytes
MBED: TARGET received 256 bytes
HOST: Received 512 bytes of data

MBED: TARGET sent 512 bytes
MBED: TARGET received 512 bytes
HOST: Received 1024 bytes of data

MBED: TARGET sent 1024 bytes
MBED: TARGET received 1024 bytes
HOST: Received 2048 bytes of data

MBED: TARGET sent 2048 bytes
MBED: TARGET received 2048 bytes
MBED: socket_api_test_echo_client_connected:466 err!=SOCKET_ERROR_NONE [FAIL]
MBED: Failed to send 4096 bytes. err=Memory allocation failed
MBED: socket_api_test_echo_client_connected:507 timedout!=0 [FAIL]
MBED: socket_api_test_echo_client_connected:542 rx_bytes!=nWords * sizeof(uint16_t) [FAIL]
MBED: Expected 4096, got 0
MBED: socket_api_test_echo_client_connected:552 match!=true [FAIL]
MBED: Mismatch in 4096 byte packet at offset 4
MBED: {{summary socket_api_test_echo_client_connected [FAIL] (4/75 FAILED)}}
HOST: Connection received...

MBED: server:10.2.203.21:56101
HOST: Received 8 bytes of data

HOST: Requesting server shutdown

MBED: {{summary tcp_ec_send_shutdown_host_script [PASS] (0/12 FAILED)}}
MBED: {{failure}}
MBED: {{end}}
HOST: Terminating Test
HOST: Passive mode...

Thanks
Simon

@ciarmcom
Copy link
Member

ARM Internal Ref: IOTSFW-1826

@bremoran
Copy link
Contributor

This is likely due to a limitation of our LwIP configuration. The maximum size of a TCP send buffer is 2xTCP_MSS, so 2920 bytes. There is a wishlist item for a Sockets API that allows sending large, constant buffers in-place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants