yabo国际娱乐Dialog Semiconductor客户支持- ad_i2c https://support.dialog-semiconductor.com/resource-keywords/adi2c 发送和接收不使用UART1 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/sending-and-receiving-wont-work-uart1

亲爱的对话框,

我使用的是DA14681 basic dev board。对于一个应用程序,我想从UART1接收一些数据,并将一些数据发送到I2C设备。来自UART的数据包含I2C设备的地址和数据。但是当我运行我的代码(仅与UART接收)时,代码停止在“ASSERT_WARNING(xSemaphorePM != NULL);”

当我删除所有I2C和UART代码时,代码工作正常(LED2闪烁测试)。我想要的是从UART接收数据,接收中断,解码并将其发送到i2c设备。因为我使用基本的开发板,我想使用UART1端口。< / p > < p >谢谢!

Device: 
2018年6月21日星期四20:19:39 +0000 DMeynen 197877在https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/sending-and-receiving-wont-work-uart1#comments
I2c从机使用适配器:待处理事务和SCLK保持在低水平 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/i2c-slave-using-adapter-pending

Hi Dialog,

我试图使用DA1468x设备作为I2C从设备使用I2C适配器(ad_i2c_start_slave)。在大多数情况下,它是有效的,但有时并不有效。

通信协议(或多或少)如下:
- wait for message header
ad_i2c_start_slave(ack, sizeof ack, msgHeader, sizeof msgHeader, callbacks, OS_EVENT_FOREVER);
- process and get result ready
ad_i2c_start_slave(ack, sizeof ack, msgPayload, sizeof msgPayload, callbacks, TIMEOUT);
- send result
ad_i2c_start_slave(ack, sizeof ack, waiting_for_result, callbacks, TIMEOUT);ad_i2c_start_slave()可以生成4个不同的回调,这取决于是否提供了读和/或写缓冲区。根据我的经验,我不能正确地处理读请求回调,所以我选择了始终为ad_i2c_start_slave()提供wbuf和rbuf,这样我只关心data_sent和data_received回调。所以在每个阶段(如上)都期望i2c主机发送数据和读取数据(比如确认)。因此,我基本上是在等待data_sent和data_received事件被触发,以便进入协议的下一阶段(见上文)。

然而,有时i2c总线挂起(SCLK保持低)。我猜这是因为请求的数据(或发送的数据)不是由软件处理的。这是怎么发生的? I think this can occur when during the switches of the buffer between each stage. However shouldn't the old buffers be used instead? or are these buffers used only one time?

Another issue that can occur I'm guess is that there's pending transactions that I do not know how to cancel in the case of timesouts. See my other post here : https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...

So my question is how can use the ad_i2c_start_slave() with timeouts the way how described in the protocol mentioned above and or do you have any suggestions on how I can implement this.

PS. The issue I was having before with read_request callback is that reading the data from the buffer didn't really stop the interrupt (RX_FULL) from continuously being triggered. Perhaps if you have suggestions how this can be done in combination with the protocol I'll be more than welcomed to hear it.

Device: 
2018年2月28日星期三15:34:30 +0000 rajames 155288, https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/i2c-slave-using-adapter-pending#comments
I2C适配器异步写:未决事务问题 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/i2c-adapter-async-write-pending

我正在使用i2c适配器(在主模式下)进行异步写或读,永远等待从回调发出OS_EVENT信号。然而,而不是等待永远我想能够设置一个超限时值,这样它不会卡住,如果说没有设备在总线上。但是在超时之后,如果我尝试发起另一个异步读或写,适配器挂起,因为有(例如2)未完成的未决事务。我如何取消这些悬而未决的事务,更好的是,什么是正确的方式,以便我可以使用超时ad_i2c_async_read或ad_i2c_async_write。< / p > < / div > < / div > < / div > < div class =”字段field-name-field-forum-keywords field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >关键词:,< / div > < div class = "字段条目" > < div class =”field-item甚至“> < a href = " / resource-keywords / i2c”“=“skos:概念”属性=“rdfs: label skos: prefLabel”数据类型= " " > i2c < / > < / div > < div class = " field-item古怪”> < a href = " / resource-keywords / adi2c”“=“skos:概念”属性=“rdfs: label skos: prefLabel”数据类型= " " > ad_i2c < / > < / div > < divclass="field-item even"> master

. 2018年2月28日星期三14:38:44 +0000 rajames 155272, https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/i2c-adapter-async-write-pending#comments