DSPS without flow control, BLE buffer overflow.

15个职位/0个新职位
Last post
Vadym
Offline
Last seen:1 year 1 month ago
Joined:2015-08-13 08:28
DSPS without flow control, BLE buffer overflow.

Hi.

I try to use the project DSPS version 5.150.2 on DA14580
In my project:
1) 睡眠被禁用(ARCH\ U sleep\ U OFF)。
2) Flow control are disabled too:
a) #未定义CFG_UART_HW_FLOW_CTRL
b) #未定义CFG_UART_SW_FLOW_CTRL

The BLE Device (peripheral) side connected to UART interface of some external processor. The external processor starts to send information to BLE UART immediately after initialization. Immediately, after initialization, BLE doesn't have established connection.
I get ASSERT_WARNING in function:
"user_periph_push"
on line:
"if (user_buffer_write_check(&periph_to_ble_buffer, wrdata, RX_CALLBACK_SIZE) != RX_CALLBACK_SIZE)"

How can i solve this trouble?
(缓冲区中的数据没有任何重要性,部分数据可能丢失)

谢谢。

Keywords:
设备:
MT_dialog
Offline
Last seen:1 month 2 days ago
Staff
Joined:2015-06-08 11:34
Hi Vadym,

Hi Vadym,

流控制不仅仅是睡眠所必需的,如果删除它,就不能保证系统中不会有任何数据丢失。您可以尝试删除ASSERT\u警告和写入缓冲区的检查,但是没有测试dsp的这种用法(没有流控制)。很可能旧数据会被新数据覆盖,您将丢失字节。

Thanks MT_dialog

Vadym
Offline
Last seen:1 year 1 month ago
Joined:2015-08-13 08:28
I removed the ASSERT_WARNING.

I removed the ASSERT_WARNING.
I come to "HardFault_HandlerC" from "uart_sps_rcv_data_avail_isr".
现在我试图禁用开发调试,但我没有得到WDT重置。

当我还未处于连接状态时,如何禁用UART接收数据?

MT_dialog
Offline
Last seen:1 month 2 days ago
Staff
Joined:2015-06-08 11:34
Hi Vadym,

Hi Vadym,

As as i ve allready mention the DSPS isn't tested for this kind of usage, another thing that you can try is to remove the user_sceduler_init() from the user_on_init() function and also remove the uart_sps_init() from the periph_init() and invoke both of the removed functions in the user_on_connection() function, the new user_on_connection() function should be something like this:

无效用户连接(uint8\u t connection\u idx,struct gapc\u connection\u req\u ind const*param)
{
default_app_on_connection(connection_idx, param);
user_gattc_exc_mtu_cmd(connection_idx);
app_easy_gap_param_update_start(connection_idx);
arch_printf(“设备已连接\r\n”);
uart\u sps\u init(uart\u sps\u波特率,3);
user_scheduler_init();
}

当然,您应该在连接和断开时分别设置和重置UART,因为如果没有任何睡眠,UART和中断将保持配置状态。

Thanks MT_dialog

Vadym
Offline
Last seen:1 year 1 month ago
Joined:2015-08-13 08:28
Hi.

Hi.

谢谢你的回答。它有帮助,但只是部分。
When central moves away from peripheral and connection becomes weak i still to get the buffer overflow.

p.s.
For me, don't need to insert "uart_sps_init" into "user_on_connection". The function is inside of "user_scheduler_init".

MT_dialog
Offline
Last seen:1 month 2 days ago
Staff
Joined:2015-06-08 11:34
Hi Vadym,

Hi Vadym,

如果你没有流量控制,我想这是意料之中的。

Thanks MT_dialog

naracontrol
Offline
Last seen:3年4个月前
Joined:2016-04-14 10:22
Hi, all.

Hi, all.
I interested in same issue and solved with following method.

1. condition:
1) No flow control and only use RX, TX signal
2) Always wake up
2. Change code at "user_sps_device.c"
枚举arch\u main\u loop\u callback\u ret user\u on\u system\u powered(void)
{
用户_sps_sleep_restore();
用户\u ble \u pull(true,NULL);
return保持\u通电;//<--------------返回到\u睡眠;
}

谢谢。

redcobaltbluedragon
Offline
Last seen:2年5个月前
Joined:2017-11-16 18:38
I am working on the same

I am working on the same lines where I only need Tx/RX. Did you do all the changes from the rest of the post plus the edit you made. Could you tell me more.

谢谢,

redcobaltbluedragon
Offline
Last seen:2年5个月前
Joined:2017-11-16 18:38
This is for naracontrol , I

This is for naracontrol , I am working along the same line are you are. Could you post a little more information. Did you do all the steps from above and then the edit you mentioned.

谢谢,

罗密欧
Offline
Last seen:1 month 3 weeks ago
Joined:2018-07-24 06:58
Has this problem been solved?

这个问题解决了吗?我也很担心这个。请将您的信息与解决此问题的任何人共享。

PM_Dialog
Offline
Last seen:2天15小时前
Staff
Joined:2018-02-08 11:03
Hi Romeo,

Hi Romeo,

你能澄清一下你的问题吗?如果我能正确理解,你想使用没有流量控制的DSP吗?如果你的意思是这样的话,在没有流量控制的情况下,你将不能在睡眠状态下操作DSP。如果您希望没有流控制,则应在活动模式配置下运行DSP。否则,如果您只有RX/TX引脚和睡眠模式配置,您将有数据丢失。请注意,DSPS项目设计为默认情况下使用软件和硬件流控制进行操作。如果您禁用睡眠模式并从您的项目中删除软件流控制功能,我不能100%确定是否没有丢失的数据。

谢谢,PM_Dialog

罗密欧
Offline
Last seen:1 month 3 weeks ago
Joined:2018-07-24 06:58
嗨,MT\u dialog

Hi,PM_dialog

As Vadym said, I am in the same situation.
1) 睡眠被禁用(ARCH\ U sleep\ U OFF)。
2) Flow control are disabled too:
a) #未定义CFG_UART_HW_FLOW_CTRL
b) #未定义CFG_UART_SW_FLOW_CTRL

与BLE连接后,RX数据溢出BLE关闭。
I don't care if I lose data, but I don't want the BLE down from it.
我在这里试过,但没用。我不想要睡眠模式。
Please tell me specifically how to throw RX overflow data away.
I don't know where to throw it away.
Please give me a specific code.

请帮帮我别把这玩意儿摔下来。

谢谢,

PM_Dialog
Offline
Last seen:2天15小时前
Staff
Joined:2018-02-08 11:03
嗨,罗密欧,

嗨,罗密欧,

你能试试这个让我知道吗?

1) No flow control and only use RX, TX signal

2) Always wake up

2. Change code at "user_sps_device.c"

枚举arch\u main\u loop\u callback\u ret user\u on\u system\u powered(void)

{

用户_sps_sleep_restore();

用户\u ble \u pull(true,NULL);

return保持\u通电;//<--------------返回到\u睡眠;

}

Also, the past forum thread below might be helpful.

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/read-buffer-overflow

谢谢,PM_DIalog

罗密欧
Offline
Last seen:1 month 3 weeks ago
Joined:2018-07-24 06:58
Dear PM_DIalog,

Dear PM_DIalog,

The result is the same.
总是醒来意味着睡不着觉吗?
const static sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;
我就是这么做的。

我们用了各种方法,但都没有解决。
baud rate from 115200 to 19200,
虽然它在BLE溢出时阻止了RX,但连接不再被接收,必须重新连接。
这不是我们想要的。

有许多传感器只使用TX、RX。必须解决。
请想出一个解决办法。

谢谢,

PM_Dialog
Offline
Last seen:2天15小时前
Staff
Joined:2018-02-08 11:03
嗨,罗密欧,

嗨,罗密欧,

If you don’t have a flow control scheme then you won’t be able to control the incoming data and you are going to lose data, so the DSPS isn't designed to operate without flow control. When sending data with BLE interrupts, the 580 isn't able to cope with the BLE and the UART interaction, so you need flow control in order to stop data transition on the other side when needed. In case of sw flow control (CFG_UART_SW_FLOW_CTRL), the sleep does not work as your UART needs to use 16MHz XTAL clock as a source to communicate. In case of hw flow control( CFG_UART_HW_FLOW_CTRL) enabled then the device will go to sleep only if there is 0 byte of data in the data buffer even a single byte of data will keep the device awake. Therefore with hw flow control the device goes to sleep when there is 0 byte of data in the buffer and RTS will toggle when the device will wake up. This is the reason why flow control is so important on DSPS, even with no sleep mode S/W flow control is advised if you don’t want to use the additional CTS / RTS signals. If you would like to remove the sleep mode and set you device into sleep mode, yes, you should modify the app_default_sleep_mode as ARCH_SLEEP_OFF. For getting more information, I would highly suggest you to have a look at the DSPS user manual.

谢谢,PM_Dialog