Dialog Semiconductor customer support - CTS https://support.dialog-semiconductor.com/resource-keywords/cts en Custom DSPS application not receiving all bytes https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/custom-dsps-application-not-receiving < div class = "字段field-name-taxonomy-forums字段-type-taxonomy-term-reference field-label-above">
Forums: 

Hi Dialog,

I am currently developing firmware using the DSPS application with a DA14580 chip on a custom board. In this project, I am using a GPIO pin to turn on and off an external microcontroller in order to conserve power when the microcontroller is not in use. When I need to use the microcontroller, I send a short command to the DA14580 using a mobile phone, the DA14850 then wakes up the external microcontroller with a GPIO pin, sets up the UART, sends the short command, then waits to receive data to send to the phone.

Without turning on/off the external microcontroller, I am able to send data back and forth between the microcontroller and phone successfully. However, I think that when I am reconfiguring the pins during runtime, it is causing data to be lost when receiving and sometimes causing the DA14580 to get hung up somewhere. (a watchdog reset occurs if watchdog is enabled, and the phone is disconnected from Bluetooth and the device no longer advertises if watchdog is disabled)

On bootup, in the "set_pads_function" the pins will be set to GPIO output low to prevent any voltage on the pins of the external microcontroller.

When I connect to the device from a phone, I disable sleep mode.

In the function "user_sps_server_data_rx_ind_handler", I start a timer I use to handle my application processes.

The first time the timer callback occurs, I configure the pins to turn on my external microcontroller and set up my UART pins. TX, RX, CTS, and RTS. (I have HW flow control defined)

After a couple seconds, for testing purposes, I disable the timer in case it is causing any problems. Then, I send the outgoing command to the external microcontroller. I can see that the external microcontroller has received and processed the command correctly.

The external microcontroller then sends 3000+ bytes to the DA14580 in 240 byte chunks.

At this point, I can see that all of the bytes have been sent over UART on a scope. The DA14580 will respond either one of two ways:
1. The device is disconnected from the DSPS mobile app and is stuck in some state.
2. If the device doesn't get stuck. I can look at the amount of bytes received from the DSPS mobile app, there will be ~1940 bytes in the last receive file.

If I initially set up the pins as UART and have the microcontroller "on", the DA14580 is able to handle the 240 byte chunks without HW flow control enabled. The DA14580 is also able to handle the 240 byte chunks with flow control enabled without setting the RTS pin during a transmission.

There are a couple things I suspect could be causing the problem:
Is there anything I need to do when I reconfigure the pins from GPIO to UART during runtime?
Is there anything I need to do with the SPS scheduler when I am reconfiguring the pins that could be causing me to not be able to process all 3000+ bytes?

Anything helps, thank you for your time

Keywords: 
Device: 
Mon, 11 Feb 2019 22:13:26 +0000 ao 284054 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/custom-dsps-application-not-receiving#comments
UART RTS CTS Hardware flow control and wakeup https://support.dialog-semiconductor.com/uart-rts-cts-hardware-flow-control-and-wakeup < div class = "字段field-name-taxonomy-forums字段-type-taxonomy-term-reference field-label-above">
Forums: 

Hi

I am trying to implement hardware flow control for UART. I notice that the CTS and RTS pins are active low.
Are there any code samples available for how to initialise the UART for hardware flow control ? I have done the GPIO configurations, is there anything else to be done ? I did not find how to enable hardware flow control, and what that affects.

As an add on question :
In AN-B-026, in the section on "Waking up the DA14580 using the UART CTS signal", I notice that CTS is low by default, then toggled high and low. Does that mean it is active high in case I want to use it as a wake up? If it is active high in order to be used as wake up , how do I configure it to keep on receiving data with hardware flow control, which needs CTS to be active low

Keywords: 
Device: 
Mon, 30 May 2016 10:25:42 +0000 一个kitdaf 3482 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/uart-rts-cts-hardware-flow-control-and-wakeup#comments
AN-B-026 : External Processor Wake-up Mechanisms https://support.dialog-semiconductor.com/resource/b-026-external-processor-wake-mechanisms
Version date: 
22/08/2014
Version number: 
1.0
Fri, 22 Aug 2014 16:31:33 +0000 JE_Dialog 603年https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/resource/b-026-external-processor-wake-mechanisms#comments