Forums - TCP packets lost with the GT202 Addon

7 posts / 0 new
Last post
TCP packets lost with the GT202 Addon
vvasiu
Join Date: 18 Apr 17
Posts: 3
Posted: Thu, 2017-11-02 03:55

Hello,

 

I have the following problem with a STM32F7 board connected to a GT202 module (QCA4004 based).

A server/client application is running in the following way:

- The server is an echo server (supporting both TCP and UDP), that waits for a client connection (TCP only), then receives data on a socket and echoes it back. This server is running on PC

- The client is running on the STM32F7 board, and does the following:

  - Scans all available wifi access points

  - Connects to a wifi access point (same as the PC, WPA2 encryption)

  - Updates the time via an NTP request

  - Start a TCP test loop, generating 1MB of random data and sending it to the server in chunks of 256 bytes. Then, it waits for each chunk to be received and compares the sent/received data

  - Start a UDP test loop, generating 1MB of random data and sending it to the server in chunks of 4096 bytes. Then, it waits for each chunk to be received and compares the sent/received data

  - Start a multithreaded TCP/UDP test loop, with 1 socket opened per protocol, generating 1MB of random data on each socket and sending it to the server in chunks of 256/4096 bytes. Then, it waits for each chunk to be received and compares the sent/received data

 

Test results:

- Single TCP socket test works fine, all the data is sent/received, no data corrupted

- Single UDP socket test works fine, there are some UDP packets being lost, but this is normal, due to the unreliability of the UDP protocol (and no re-transmission)

- Issue observed when testing with 2 opened sockets, one TCP and one UDP. In this scenario, I have lost TCP packets, which should never be the case. Note that I've set the socket receive timeout to 5 seconds, and the wifi rssi is very high (2 meters away from the wifi router)

 

More information:

- The Atheros Driver is integrated from QCA4002/4 Firmware/Software SDK v3.3.5

- The following configuration of the driver was enabled:

  - Enable DRIVER_CONFIG_MULTI_TASKING

  - Enable DRIVER_CONFIG_IMPLEMENT_RX_FREE_QUEUE

  - Enable ENABLE_STACK_OFFLOAD

  - Enable MULTI_SOCKET_SUPPORT

  - Enable NON_BLOCKING_RX

- The module is plugged into the Arduino connectors of the STM32F7 board, and it is communicating on SPI at 12.5MHz, with SPI communication in DMA mode (for rx/tx transfer) and in polling mode (for command transfer).

 

Some analysis was performed on my side, and in case of missing packets, the interrupt from the GT202 chip (over SPI_INT) is not comming. Normally, this interrupt should come to indicate that a packet was received by the wifi chip, and it can be read by the host.

Also, another issue was found with enabling of NON_BLOCKING_TX option, that caused some data to be corrupted in the exchanged stream.

 

Could someone provide support for this issue?

 

Thank you,

Valentin

 

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 76
Posted: Mon, 2017-11-13 02:49

Dear Valentin,

Is you device is under low perf mode?

Please give wmiconfig command to check power mode of the device. 

 

Could you please kindly, also disable NON_BLOCKING_RX to verify the issue ?

Also you can refer benhrx demo code to verify this. Please have a look at that. 

 

Best Regards

Jyotiranjan

  • Up0
  • Down0
vvasiu
Join Date: 18 Apr 17
Posts: 3
Posted: Tue, 2017-11-14 08:56

Dear Jyotiranjan,

 

Thank you for your reply. To answer your questions:

- The device is not in low perf mode. I've set the device to max perf via max qcom_power_set_mode(0, MAX_PERF_POWER, USER) and Tx power to 17dBm via qcom_set_tx_power(0, 17)

- I don't understand your comment about "please give wmiconfig". Please detail.

- Disabling the NON_BLOCKING_RX is not an option for my application, as receiving should never be blocking. Anyway, I tried it and I have a lot of problems. Is there any known issue with NON_BLOCKING_RX or NON_BLOCKING_TX?

- I don't know what is "benhrx demo code". Please detail.

 

Thank you,

Valentin

  • Up0
  • Down0
svegesna Moderator
Join Date: 7 Jun 17
Posts: 20
Posted: Tue, 2017-11-14 10:32

Dear Valentin,

In answer to your questions, the user guide of QCA4004 has information about throughput and power measurements using TCP uplink/Downlink test using benchrx and benchtx.

If you are accessing the QCA4004 board using putty or minicom, please give the below command:

wmiconfig --version 

The above command gives the details of the image and when it was built. 

Please provide the details of the QCA4004 board using above command.

Thanks,

Santhosh

 

 

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 76
Posted: Tue, 2017-11-14 20:26

I don't know what is "benhrx demo code"

Jyotiranjan> Dear Valentin,

Could you please downlaod the QCA4002 hosted relaese notes (3.3.6) from below link

https://developer.qualcomm.com/hardware/qca4002-4/tools . 

Basciaclly GT202 module has some demo code with Freescale Freedom board. (FRDMK22F) . So if you will follow above guide and install all the hosted driver  and demo code from  NXP Wbsite , next you can refer the throughput.c file(TCP/UDP receive) present inside Freescale_MQX_4_1\demo\throughput_demo\custom\throuhput.c . 

Inside demo folder all demo example code is there is , so please have a look  on those. . 

Anyway Could you please let me know your host MCU uses which os?I

 

  • Up0
  • Down0
vvasiu
Join Date: 18 Apr 17
Posts: 3
Posted: Tue, 2017-11-14 22:45

Dear Santhosh and Jyotiranjan,

 

I see in the SP140/SP141 document how to connect the module to PC via UART (J9 connector) in order to send the wmiconfig --version. However, I have a longsys GT202 Adapter v1.04 with Arduino connectors, which doesn't have a J9 UART connector, but only a J6 uUSB connector. Is is possible to have a shell communication with this module? If so, how?

 

Then, you refer to the 3.3.6 release note. I see the latest SDK being 3.3.5, which is what I used. I have a STM32F746G-DISCO board, with the GT202 module plugged in the arduino connectors. I'm using the FreeRTOS which was included in the STM driver package. The atheros_wifi package was not completely adapted for FreeRTOS, so I had to do a lot of changes myself to get it running. If you want, I can upload here the atheros_wifi package with all my modifications.

 

Finnally, I found the point of failure for this lost TCP packet, but the root cause is not yet clear. Please have a look at file cust_api_stack_txrx.c, function custom_receive_tcpip(). When the TCP packet gets "lost", this function is called as a new packet arrives, but extracting the socket handle from the customer header reveals an invalid handle:

- eg. in good case (99% of the time), a socket handle is something like 0x00458FA4, leading to a valid index found in socket context, and the packet being processes correctly

- eg. in bad case (1% of the time), a socket handle is something like 0x04020201, leading to an invalid index found in socket context, and the packet is being dropped (first return case from custom_receive_tcpip()).

 

Now, I'm investigating on my side if this could be a SPI transfer issue, although it is strange to have a transfer issue with such low occurrence rate. Could this be an issue on the QCA4004 firmware, or in the atheros_wifi package?

 

Thanks,

Valentin

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 76
Posted: Wed, 2017-11-15 05:09

Dear Valentin,

By the time could you please check also ath_udp_recv and ath_tcp_recv APIs in throughput.c file in throughput_demo sample application. 

apart from SPI transfer issue. 

Regards

Jyotiranjan

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.