cancel
Showing results for 
Search instead for 
Did you mean: 

Data loss using SPWF01SA (multiples of 2kiB)

gsiebke
Associate II
Posted on October 13, 2015 at 10:31

Hi,

i'm using the SPWF01SA with high baud rates (460k or 920k) and continuous transmission at maximum speed. From time to time (minutes for 460k, all the time for 920k), data sent via UART is not transmitted via WIFI. It is always a multiple of 2kiB that is lost. RTS/CTS is working fine (see attached picture; upper channel is RX, lower channel RTS (both at WIFI-module)). Firmware should be up-to-date; at least I can use ADC command.

Thanks for your help,

Georg
18 REPLIES 18
Posted on October 14, 2015 at 10:32

     I would guess that the problem occurs after UART transmission inside the module.

I expect data loss over the air only in UDP mode. In TCP, packets are ack-ed, retransmitted, etc.

     My SPWF01SA is directly connected to a STM32F4.

USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_CTS | USART_HardwareFlowControl_RTS, right ?

gsiebke
Associate II
Posted on October 14, 2015 at 10:43

Hi jerry,

RTS/CTS is activated:

  

  huart6.Init.BaudRate = 460800;

  huart6.Init.WordLength = UART_WORDLENGTH_8B;

  huart6.Init.StopBits = UART_STOPBITS_1;

  huart6.Init.Parity = UART_PARITY_NONE;

  huart6.Init.Mode = UART_MODE_TX_RX;

  huart6.Init.HwFlowCtl = UART_HWCONTROL_RTS_CTS;

  huart6.Init.OverSampling = UART_OVERSAMPLING_16;

Could it be that the complete buffer content is dropped inside the module and it is simply overwritten by the next data arriving over UART? If the buffer is 1kiB this could be somehow related to a multiple of 2kiB of data being lost.

Posted on October 14, 2015 at 11:03

There are 2 buffers inside the module.

The main important one is filled by DMA, stopping external MCU (by RTS line) on second (smaller) ''application'' buffer-full event. Bytes are copied from the first one to the second one.

Even if smaller buffer is full, DMA continues working on bigger buffer until external MCU stops.

This works fine until external MCU stops when RTS moves. How can we check this point?

I need some time to perform tests with an F4 MCU...
gsiebke
Associate II
Posted on October 14, 2015 at 12:43

OK, let me know if I can help you. Thank you for your help.

gsiebke
Associate II
Posted on October 14, 2015 at 15:30

I carried out some additional tests (see attached pictures, at 921400 baud), maybe it helps you to understand the problems.

First, I added a 10ms delay after each 1kiB. RTS is issued, but only after a while that I stopped transmission, probably when the second buffer is full. I could imagine that there are situations in which RTS comes to late, so one of the buffers overrun.

Second, I checked the data rate arriving at my computer.

I STA mode, RTS is rarely issued and the data rate is about 25kB/s (921400 should be about 90kB/s).

in miniAP mode, RTS is high about 1/3 of the time, but the data rate is higher, about 35kB/s. In both cases, a lot of data gets lost in the module. In STA mode, UART rate is almost 90kB/s, so 2/3 of data is lost; in miniAP mode, UART rate is about 60kB/s, so 1/2 of data is lost.

________________

Attachments :

delay_10ms.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1RU&d=%2Fa%2F0X0000000bn2%2FrQBxuZoxr9ybmjYy3bxFUqvrYdDMKAT03H77uVszA5U&asPdf=false

miniAP.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Qw&d=%2Fa%2F0X0000000bn3%2F51UXL70YID0U5isexRSRyT3LIoVbBr6E4XzwTf.GDTs&asPdf=false

STA.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1RK&d=%2Fa%2F0X0000000bn0%2FGht038STZJ9Vf5tdmZU9zqDaFSSmijyLPgb2Wy7Y8RU&asPdf=false
Posted on October 18, 2015 at 11:27

Hi Georg,

issue verified (it's a trivial overrun!). Thanks for your detailed tests. Very very helpful.

I used a Discovery-F4 board, and a simple application DMA-based for uart transmit. Probably using the eval board on PC is not enough to stress module's flow control.

Problem will be solved in the near coming next release.

Thanks again.

jerry

gsiebke
Associate II
Posted on October 21, 2015 at 10:09

Hi jerry,

great! I'm glad if I could help. 

Posted on April 03, 2017 at 23:21

Hello! 

I am interested if the problem has been solved. I am planning to use the SPWF01SA module to continuously stream data from STM32F4 to a PC. I need data rate of ~50kBytes/s, so I believe it will be essential for my application that the problem described in this post has been addressed. 

Are there any other potential issues with the module for continuous streaming at such rates? 

I can see there is another module 

SPWF04SA - do you think this module will be better option for such use?

Thank you.

Posted on April 05, 2017 at 20:30

Hello. I think SPWF01 is ok for your tput requirements. Use latest available fw. Get 3.5 from website, or 3.5.3 from distributors or St contact.

j