DSP没有流量控制,BLE缓冲区溢出。

15 posts / 0 new
最后一篇
Vadym.
离线
最后一次露面:1 year 2 months ago
加入:2015-08-13 08:28
DSP没有流量控制,BLE缓冲区溢出。

你好。

我试图在da14580上使用项目DSPS版本5.150.2
在我的项目中:
1) The sleep is disabled (ARCH_SLEEP_OFF).
2)禁用流量控制:
a) #undef CFG_UART_HW_FLOW_CTRL
b) #undef CFG_UART_SW_FLOW_CTRL

BLE设备(外围)侧连接到某些外部处理器的UART接口。外部处理器开始在初始化之后立即将信息发送到BLE UART。初始化后立即,BLE没有建立连接。
我在功能中得到了assert_warning:
“user_periph_push”
在线的:
“如果(user_buffer_write_check(&periph_to_ble_buffer,wrdata,rx_callback_size)!= rx_callback_size)”

如何解决这个问题?
(There isn't any importance of the data in the buffer and part of the data can be lose)

Thanks.

关键词:
Device:
mt_dialog.
离线
最后一次露面:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
嗨Vadym,

嗨Vadym,

The flow control isn't only necessary for the sleeping, if you remove this there is no guarantee that there is not going to be any dataloss in your system. You can try to remove the ASSERT_WARNING and the checking for writing into the buffer but the DSPS isn't tested for this kind of usage (without flow control). Most probably old data will be overwritten by new data and you are going to lose bytes.

谢谢mt_dialog.

Vadym.
离线
最后一次露面:1 year 2 months ago
加入:2015-08-13 08:28
我删除了assert_warning。

我删除了assert_warning。
我从“UART_SPS_RCV_DATA_AVAIL_ISR”来到“hardfault_handlerc”。
Now I tried to disable DEVELOPMENT_DEBUG but I doesn't get WDT reset.

How can I disable the UART receiving data while i have not yet in connection state?

mt_dialog.
离线
最后一次露面:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
嗨Vadym,

嗨Vadym,

由于我已经提到了这种用法没有测试DSP,你可以尝试的另一件事是从user_on_init()函数中删除user_sceDuler_init(),也可以从periph_init()中删除uart_sps_init()和调用user_on_connection()函数中的删除功能,新user_on_connection()函数应该是这样的:

void user_on_connection(uint8_t connection_idx, struct gapc_connection_req_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("Device connected\r\n");
uart_sps_init(UART_SPS_BAUDRATE, 3);
user_scheduler_init();
}

Of course you should set and reset your UART in connections and disconnections respectively since if there isn't any sleep the UART and the interrupts will stay configured.

谢谢mt_dialog.

Vadym.
离线
最后一次露面:1 year 2 months ago
加入:2015-08-13 08:28
你好。

你好。

Thanks for you answer. It helps but only partly.
当中央远离外围和连接变得弱时,我仍然可以获得缓冲区溢出。

P.S.
对我来说,不需要将“UART_SPS_INIT”插入“USER_ON_CONNECTICE”。该函数位于“user_scheduler_init”的内部。

mt_dialog.
离线
最后一次露面:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
嗨Vadym,

嗨Vadym,

If you dont have a flow control i suppose that this is expected.

谢谢mt_dialog.

Naracontrol.
离线
最后一次露面:3年5个月前
加入:2016-04-14 10:22
大家好。

大家好。
我对同样的问题感兴趣,并解决了以下方法。

1.条件:
1)无流量控制,仅使用Rx,TX信号
2)总是醒来
2.在“user_sps_device.c”处更改代码
enum arch_main_loop_callback_ret user_on_system_powered(void)
{
user_sps_sleep_restore();
user_ble_pull(true, NULL);
return KEEP_POWERED; // <-------------------return GOTO_SLEEP;
}

Thanks.

RedcobaltlupuedRagon.
离线
最后一次露面:2年7个月前
加入:2017-11-16 18:38
我正在努力

我正在使用我只需要tx / rx的同一条线。您是否从帖子的其余部分以及您所做的编辑完成所有更改。你能告诉我更多。

Thanks,

RedcobaltlupuedRagon.
离线
最后一次露面:2年7个月前
加入:2017-11-16 18:38
这是适用于Naracontrol,我

这是适用于Naracontrol,我正在沿着同一条线工作。你能发布更多信息吗?您是否从上面完成了所有步骤,然后是您提到的编辑。

Thanks,

罗密欧
离线
最后一次露面:3个月1周前
加入:2018-07-24 06:58
这个问题已经解决了吗?

这个问题已经解决了吗?I'm also worried about this. Please share your information with anyone who has solved it.

PM_DIALOG.
离线
最后一次露面:2 days 18 hours ago
职员
加入:2018-02-08 11:03
嗨罗密欧,

嗨罗密欧,

Could you please clarify your issue? If I am able to understand correctly, you want to use the DSPS without flow control? In case you mean that, you won’t be able to operate the DSPS with sleep when having no flow control. If you prefer to have no flow control, you should run the DSPS in active mode configuration. Otherwise, if you have only RX/TX pins and sleep mode configuration, you will have data loss. Be aware that the DSPS project is designed to operate by default with software and hardware flow control. If you disable the sleep mode and remove the software flow control functionality from your project, I am not 100% sure that there will be no missing data.

谢谢,PM_DIALOG.

罗密欧
离线
最后一次露面:3个月1周前
加入:2018-07-24 06:58
Hi,MT_dialog

嗨,pm_dialog.

随着Vadym所说,我在同样的情况下。
1) The sleep is disabled (ARCH_SLEEP_OFF).
2)禁用流量控制:
a) #undef CFG_UART_HW_FLOW_CTRL
b) #undef CFG_UART_SW_FLOW_CTRL

The RX data overflow BLE down after connection with the BLE.
我不关心如果我丢失数据,但我不希望BLE down from it.
I tried it here, but it didn't work. I don't want sleep mode.
请特别告诉我如何将RX溢出数据丢弃。
我不知道在哪里扔掉它。
请给我一个特定的代码。

Please help me don't the BLE down.

Thanks,

PM_DIALOG.
离线
最后一次露面:2 days 18 hours ago
职员
加入:2018-02-08 11:03
Hi romeo ,

Hi romeo ,

Can you please try this and let me know?

1)无流量控制,仅使用Rx,TX信号

2)总是醒来

2.在“user_sps_device.c”处更改代码

enum arch_main_loop_callback_ret user_on_system_powered(void)

{

user_sps_sleep_restore();

user_ble_pull(true, NULL);

return KEEP_POWERED; // <-------------------return GOTO_SLEEP;

}

此外,下面的过去的论坛线程可能会有所帮助。

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

谢谢,PM_DIALOG.

罗密欧
离线
最后一次露面:3个月1周前
加入:2018-07-24 06:58
亲爱的pm_dialog,

亲爱的pm_dialog,

结果是一样的。
Does Always wake up mean ARCH_SLEEP_OFF?
const static sleep_state_t app_default_sleep_mode = arch_sleep_off;
This is what I did.

We used various methods, but they were not resolved.
波特率从115200到19200年,
Although it blocked RX at the time BLE was Overflow , the connection was no longer received and the connection had to be reconnected.
This is not what we want.

There are many sensors that use only TX,RX. It must be solved.
Please come up with a solution.

Thanks,

PM_DIALOG.
离线
最后一次露面:2 days 18 hours ago
职员
加入:2018-02-08 11:03
Hi romeo,

Hi romeo,

如果您没有流量控制方案,那么您将无法控制传入的数据,并且您将丢失数据,因此DSP不设计用于无流量控制操作。使用BLE中断发送数据时,580无法应对BLE和UART交互,因此您需要流量控制,以便在需要时停止在另一方的数据过渡。在SW流量控制(CFG_UART_SW_FLOW_CTRL)的情况下,睡眠不起作用,因为您的UART需要使用16MHz XTAL时钟作为通信的源。在启用HW流量控制(CFG_UART_HW_FLOW_CTRL)的情况下,只有在数据缓冲区中有0个字节的数据时,设备才会休眠,即使单个数据的数据也将保持设备唤醒。因此,随着HW Flow Control,当缓冲区中存在0个数据时,设备会睡眠,并且RTS将在设备唤醒时切换。这就是为什么流量控制在DSP上如此重要的原因,即使没有睡眠模式,如果您不想使用额外的CTS / RTS信号,则建议使用S / W流量控制。如果您想删除睡眠模式并将设备设置为睡眠模式,则应将App_default_sleep_mode修改为ARCH_SLEEP_OFF。为了获取更多信息,我会非常建议您查看DSP用户手册。

谢谢,PM_DIALOG.