⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
Greavesinator85
Offline
Last seen:3 years 2 months ago
Joined:2016-09-20 17:02
DSPS Buffer Limitations

Hi,

I'm currently using the DSPS program for the DA14580. I understand that the DSPS contains buffers for out and inbound transmission in regards to the host microcontroller, my question is what size are these buffers by default, can this size be changed and what are the size limitations?

Also, what is the expected behaviour of the DSPS if a host microcontroller writes to the buffer continuously while no bluetooth device is connected? I found the device stops operating, but should I be monitoring the flow control hardware lines after writing each individual character? Or is there a way to detect if a device is connected?

Regards,
Jake

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi Greavesinator,

Hi Greavesinator,

The DSPS device implements two buffers, one for incomming data and an additional buffer for outgoing (ble_to_periph_buffer and periph_to ble_buffer), the size of those buffers is 1800 and 500 bytes respectively, you can change the size of the buffers (although i dont see any reason for doing that) and your limitation about this how much heap memory you can allocate on the 580.

If we assume that a host writes to the 580 that is loaded with the DSPS fw, the DSPS will stay awake (will not sleep between the advertising events since it will have at least one byte to send but no connection to send to), capture the data until it reaches the RX's buffer watermark, as soon as that happens the device will issue a flow off in order to prevent the external device to send more data, if you dont use flow control, or the extenral device wont respect the flow off the device will simply fill in the entire buffer and will eventually assert a warning (stuck in a fw break point due to the fact that its buffer is filled). Yes there is a way to detect if the device is connected you can simply check the state of your TASK_APP (ke_state_get(TASK_APP)). If the device is in APP_CONNECTABLE state that means that the device is ready and its advertising.

Thanks MT_dialog

Greavesinator85
Offline
Last seen:3 years 2 months ago
Joined:2016-09-20 17:02
Thanks MT_dialog,

Thanks MT_dialog,

So I'm currently using hardware flow control. Once the RX watermark is reached, I should see the RTS line be set by the device? So by writing to the DA14580 and monitoring the RTS line between bytes I should be able to avoid overfilling the buffer and causing a warning?

Apologies, I meant a way for the host to detect if the DA14580 was currently connected to a device, such as the DSPS App.

Regards,
Jake

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi Greavesinator,

Hi Greavesinator,

设备没有问题只有当一个流buffer is filled up to the RX watermark it also issues a flow off when the device is sleeping, between the advertising strings for example (when there are no data in the buffer) or between the connection events. The fact that you will get a flow off doesn't indicate that the device is connected.

Thanks MT_dialog