DSP从I2C推送数据

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
9 posts / 0 new
最后一篇
Ahiggs.
离线
最后一次露面:7 months 3 days ago
加入:2019-12-17 07:10
DSP从I2C推送数据

你好,

我目前在DA14585开发套件上运行DSPS_DEVICE示例,并尝试将其自己的数据推向缓冲区以发送到主机。对于主机,我可以使用DSPS Android应用程序与我的手机连接到14585,并能够将数据发送到14585,但未收到它。

我试图使用user_ble_push()函数和计时器将数据推向缓冲区。该函数每5秒运行每5秒,测试数据显示在设备的COM端口上,但不在我手机DSP应用程序上的收到数据中。

The only change I have made to the code is defining FLOW_CONTROL_CONFIG as 1 (in user_periph_setup.h) and the addition of my function to user_sps_scheduler.c (code below).

我不是正确地将数据推到缓冲区吗?

Thanks!

void test_function(){ uint8_t msgs[] = "test_fn_buf_push \r\n"; user_ble_push(msgs,sizeof(msgs)); //restart timer timer = app_easy_timer(TIMER_DELAY,test_function);//timer_delay 500 }

Device:
PM_DIALOG.
离线
最后一次露面:5 days 16 hours ago
职员
加入:2018-02-08 11:03
Hi ahiggs,

Hi ahiggs,

在论坛线程的名字,您提到that you would like to push data from I2C. Is that correct? The DSPS emulates a serial cable communication and push data to/from UART. The FLOW_CONTROL_CONFIG sets the UART flow control either to Software Flow Control (XON/XOF) or the Hardware Flow Control (RTS/CTS). In case of extended sleep mode configuration, hardware flow control is required in order to wake up the device. The DSPS is never permanently inactive it falls asleep and wakes up in order to serve ble events, even if there isn't any data to send the da will wake up to keep the connection with the host active. When the device wakes up, it will toggle the RTS line to low in order to indicate that it he is ready (the device will pull the RTS low whenever it wakes up, in every connection interval or advertising interval). Also be aware that when the device is receiving, when the data transmitted reach the internal FIFO threshold the RTS will go back to high to notify to the other side that it should stop send data. The user_ble_push() function is called by the user_sps_server_data_rx_ind_handler() in peripheral mode when there is available data in the BLE interface. It pushes data in the ble_to_periph_buffer cyclic buffer and checks whether the buffer level gets above the high watermark to send a flow off signal to the peer device. Please refer to theUM-B-088 : User Manual for Dialog Serial Port Profile (DA14585)想要查询更多的信息。

谢谢,PM_DIALOG.

Ahiggs.
离线
最后一次露面:7 months 3 days ago
加入:2019-12-17 07:10
Thank you for your reply.

Thank you for your reply.

我们的项目目前设置的方式有一个关于传感器的Agyiny,并将数据发送到DA上的UART,通过蓝牙发送到DSPS_Central设备以登录计算机。

一世would like to eliminate the ATTiny and have the peripheral DA read the I2C sensor (already done in a different project) and then send the data via bluetooth to the central. So to start, I'm attempting to push test data into the periph_to_ble buffer using the test_function() I gave above.

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

Hi ahiggs,

user_ble_push()函数正在寻找一个指针和长度。这将通过数据传递给FIFO缓冲区并通过BLE发送数据。请在调试模式下运行它,并将一个断点添加到user_ble_push()中?您是否在DSP设备项目中完成了任何其他修改?请分享它们,我会尝试复制它。

谢谢,PM_DIALOG.

Ahiggs.
离线
最后一次露面:7 months 3 days ago
加入:2019-12-17 07:10
一世placed a breakpoint at the

一世placed a breakpoint at the user_ble_push function and verified that it is reached. From what I understand from the datasheet, the user_ble_pull function also needs to be run after the data is pushed to start the ble transmission. I've included the new code for test_function below

我所做的唯一修改是user_scheduler_init()中的test_function()和关联的计时器,以及在user_periph_setup.h中更改为sw flow control

谢谢你的帮助,我明天会有时间(在〜16小时)继续工作

void test_function(){user_ble_push(msgs,sizeof(msgs));user_ble_pull(true,null);timer = app_easy_timer(timer_delay,test_function);}

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

Hi ahiggs,

感谢分享代码。我会尝试在我身边复制。

谢谢,PM_DIALOG.

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

Hi ahiggs,

很抱歉,我答复晚了。您提到您使用的是SW流量控制。我可以问您是否在DSP固件中使用扩展睡眠模式配置?如果是,则应使用HW Flow Control或删除睡眠配置。

谢谢,PM_DIALOG.

Ahiggs.
离线
最后一次露面:7 months 3 days ago
加入:2019-12-17 07:10
延迟没问题。一世

延迟没问题。一世ended up finding a workaround by using the user_send_ble_data() command.

一世am using SW flow control. Under ''user_config.h" I haveapp_default_sleep_mode.set toarch_ext_sleep_on,但你建议将其设置为arch_sleep_off

我显然没有烧毁OTP,而是最终的申请willhave OTP burnt.

Edit:

一世just tried to change the sleep setting but the function user_ble_push() function still did not cause anything to be sent to the DSPS app.

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

Hi ahiggs,

如果延长睡眠模式配置(app_default_sleep_mode = Arch_ext_sleep_on),则需要硬件流控制才能唤醒设备。DSP永远不会永久无效地睡着,醒来才能为BLE事件服务,即使没有任何数据发送DA将唤醒以保持与主机的连接。当设备醒来时,它会将RTS线切换到低,以指示他准备好(设备将在每个连接间隔或广告间隔中唤醒RTS低电平。另请注意,当设备接收时,当传输的数据到达内部FIFO阈值时,RTS将返回高电平,以通知它应该停止发送数据的另一侧。根据用户手册,注2页第7页,在扩展睡眠模式下部分支持软件流量控制。只能通过DA14580设备控制即可串行数据。在睡眠时间内将忽略任何传入的XON / XOFF。相反,在活动模式下完全支持软件流控制。在流关信号(0x19)的接收时,DA14580可以通过DA14580发送高达16个字节的量直到传输停止。不确定您的设置发生了什么,但我的建议是在睡眠模式下使用HW流量控制。

谢谢,PM_DIALOG.