2017-01-30 02:57 PM
We are trying to reach real-time 50mS per round trip of 20 byte TCP messages of receive and then send response. I'm actually seeing closer to 150mS round trip time. Much of this time is taken up in switching between data and command mode. Our measurements indicated 88mS or 44mS per side. Switching to command mode requires the following characters Tx:'at+s' and Rx:'+WIND:59:Back to Command Mode'. At 115,200 bps that's 0.00295sec at 10 bits per char which is 6.8% of 44mS delay. What is the other 93.2% of the delay time? How long should it take to switch from data mode to command mode? This appears to be putting excessive overhead on our message traffic?
2017-01-31 10:04 AM
Hi,
are you using
XNUCLEO-WIFI firmware library for STM32?
Ciao
j
2017-01-31 10:40 AM
Yes, it is the same ST Middleware used for
XNUCLEO-WIFI.
The X-CUBE-WIFI1 software package is an expansion for STM32Cube. This software provides software APIs running on STM32 for STM's X-NUCLEO-IDW01M1. It is built on top of STM32Cube software technology that ease portability across different STM32 microcontrollers.
X-CUBE-WIFI1 software features:
Complete middleware to build applications using the Wi-Fi module (SPWF01Sx).
Easy to use abstract APIs to configure and use SPWF01Sx.
Easy portability across different MCU families thanks to STM32Cube.
Sample applications that the developer can use to start experimenting with the code.
Free user-friendly license terms.
Examples implementation available for X-NUCLEO-IDW01M1 STM32 expansion board plugged on top of one NUCLEO-F103RB, NUCLEO-F401RE or NUCLEO-L053R8.
2017-02-01 10:53 AM
Ok, understood.
I think 'SPWF00xx Poor Wi-FI Peformance - Switching Between AT Data and Command Modes' is not related to SPWF01S itself.
Module's side, I can suggest to reduce sockd_timeout to detect escape sequence, but this is not the solution to your point.
Host's side, check UART management, and improve it eventually. Which interrupt are you using four your application? DMA? etc...
2017-02-02 09:02 AM
The sockd_timeout=5 for traffic as the message sizes are only 20 bytes. At 115.2K the factory default rate is adequate for this application. Raising the baud rate would have a negilable effect on performance as the messages are small. The interrupt timing is specified by the ST middleware, but, in answer your question the event handler is TIM3 and Process_ISR is 1mS ISR. The serial Tx/Rx character interrupts happen on USART1 and not DMA enabled. It might be possible the character interrupts are blocking the event timer or process ISR. Have you every measured the data/command mode switch time on the SPWF?
2017-02-02 10:16 AM
6 ms
So, total amount of time: 5 bytes @115k + sockd_timeout + 6ms
2017-02-02 10:34 AM
The issue is not related with socket timeouts. The SPWF module is commanded to switch to data mode by the ST Middleware AT command 'at+s.' and some time later (i.e.44mS) the confirmation '+WIND:59 Back to Command Mode' arrives to the middleware. If you examine the ST Middleware ASCII traffic it switches between data/command mode for every TCP message read/write in the 'SOCKD' mode. This switching between data and command mode slows the TCP round trip (RT) traffic dramatically.
2017-02-02 10:42 AM
'The SPWF module is commanded to switch to 'command mode'...
2017-02-02 02:09 PM
Problem is clear, but I'm not an expert on
X-CUBE-WIFI1 library...
2017-02-02 02:51 PM
The problem is not an issue with the ST Middleware as it is slow switching times in the SPWF module between data and command mode in SOCKD mode. This picture shows in blue a TCP message receive and red a message send. The switch time total is 88mS for a 20 byte message.