3 posts / 0 new
Last post
smarly
Offline
Last seen:2 years 2 weeks ago
Master
加入:2014-02-05 14:50
SPS -软流控制

Hi,

I managed to get the Serial Port Service example running fine using the following configuration: Mobile <=> Da14580 <=> UART.

年代ince i only have TX/RX connected on the UART side I need to use software flow control which is ok for me. The thing is I keep receiving Xon/Xoff data on the UART even when no data are being transfered. The rate is the same as advertising/connected interval (which means it gets much faster when the connection has been established).

My question is: is there any way to disable these XON/XOFF messages when nothing is being transmitted? I've been looking around the example to figure out where I could disable this but could not find it so any help would be welcomed!

Thanks in advance.

Loic

NB: I'm using SDK 3.0.8 and DSPS 3.150.2.

smarly
Offline
Last seen:2 years 2 weeks ago
Master
加入:2014-02-05 14:50
This is due to the functions

This is due to the functions app_sleep_prepare and app_scheduler_reinit in app_sps_scheduler.c. Each time the chip enters and wakes up from sleep a XON/XOFF pair is emitted.

I removed the xon/xoff call in these functions and everything seem to keep working fine. Nevertheless I'm worried that this workaround would have some side effects. Basically I guess this was meant to avoid a caracter to be received while in sleep mode. I just don't know why this is needed since all input characters should be read in irq anyway? Perhaps there are not or the normal process doesn't get waken up by the irq?

Thanks for your help.

Loic

RvA
Offline
Last seen:19 hours 10 min ago
年代taff
加入:2014-02-07 14:10
Hi Loic, When nothing has

Hi Loic, When nothing has been transimtted you shouldn't see any flow control characters unless sleep mode is enabled. If DA14580 is sleeping and UART peer sends out a byte, there will be data loss. To get rid of the flow control only during sleep mode, please try to comment out the call of app_sleep_check() in line 112 of app_sleep.h.

Best regards, RvA