在I2C传输过程中丢失BLE连接。

⚠️
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.
12 posts / 0 new
Last post
nigelyang
Offline
Last seen:1 month 3 weeks ago
加入:2018-03-20 08:24
在I2C传输过程中丢失BLE连接。

Hi Dialog,

我的任务之一负责通过I2C向外部芯片发送/接收大量数据。我经常诱惑DA14681在速度秒内发送错误的I2C信号(重新启动启动条件)并丢失BLE连接。我发现只要我增加连接间隔,就会发生这种问题的速度正在减少。此外,在添加许多从等待时间后,结果更好。我猜每个间隔的BLE TX / RX事件可能会在I2C传输期间发生。请查看附加的PDF文件以了解我的意思。问题是否可能?如果是,如何防止BLE TX / RX事件和I2C Trnasmsion同时发生?是否有可能知道BLE TX / RX事件提前发生,然后在以下步骤中执行I2C传输?

thanks for your help.

Device:
PM_Dialog
Offline
Last seen:1 day 2 hours ago
Staff
加入:2018-02-08 11:03
Hi nigelyang,

Hi nigelyang,

Let me check it and I’ll let you know.

Thanks, PM_Dialog

nigelyang
Offline
Last seen:1 month 3 weeks ago
加入:2018-03-20 08:24
hi Dialog,

hi Dialog,

Is there any solution for my problem? thanks for your help

PM_Dialog
Offline
Last seen:1 day 2 hours ago
Staff
加入:2018-02-08 11:03
Hi nigelyang,

Hi nigelyang,

我为延迟道歉。因此,如果我正确地理解您的描述,就会在使用BLE事件的同时发生I2C交易时,问题存在。这样对吗?

Does the application send the I2C values over notification in the peer device? When this issue occurs, does the device reboots or it just disconnects? Did you run it debug mode? Additionally, are you using any of the sleep modes?

I assume that an event with higher priority than the I2C might be that it is served in the ISR. The BLE interrupt is served with higher priority (PRIORITY_1) than the I2C (PRIORITY_2).

Thanks, PM_Dialog

nigelyang
Offline
Last seen:1 month 3 weeks ago
加入:2018-03-20 08:24
hi Dialog,

hi Dialog,

Yes, my problem is the BLE event (ack) and I2C transmission ( especially reading) take place at the same time.

It seems to reboot or I2C return 0x8001 failure( I use I2C adapter, e.g ad_i2c_read();). I observed the I2C signal transmission is devided into two (seems re-launch start condition because DA14681 cannot give a ACK when a byte finished)

我通过两种模式,调试模式和生产得到了相同的结果。结果是否有所不同?当问题发生时,我使用了“PM_Mode_Idle”。您提到的是,BLE中断具有比I2C(Priority_2)更高的优先级(Priority_1)。我认为这样,BLE事件(RESPOSNE ACK)导致不规则的I2C传输,让DA14681转到未知状态(稍后重新启动)或仍然等待外部数据。

I intend to know which task or function is responsible for sending BLE ACK in every connection interval, and allow me to do I2C tramission in the following step.

PM_Dialog
Offline
Last seen:1 day 2 hours ago
Staff
加入:2018-02-08 11:03
Hi nigelyang,

Hi nigelyang,

调试模式中的行为是什么?代码是否陷入困境?例如,您是否有任何断言或其他任何东西..只有当DA1468X与对等设备连接时,才会发生这种情况?

Thanks, PM_Dialog

nigelyang
Offline
Last seen:1 month 3 weeks ago
加入:2018-03-20 08:24
hi Dialog,

hi Dialog,

一般来说,由I2C传输达到。我不使用断言。我将移动应用程序TX / RX数据与DA14681一起使用,然后通过I2C处理数据,然后使用外部芯片进行TX / RX数据。

我希望我能完全了解BLE事件(确认)何时发生,允许我在两个连接事件之间进行I2C传输。是否有可能知道BLE连接事件的中断?如果是,如何知道?

One more question, if DA14681 launches a request to change connection rate parameters, how long will it complete and adapt the new connection rate parameters? one connection interval or longer ?

thanks for your help.

nigel

PM_Dialog
Offline
Last seen:1 day 2 hours ago
Staff
加入:2018-02-08 11:03
Hi nigelyang,

Hi nigelyang,

Sorry for my late response. So, if I understood correctly, you want to trigger the application in every connection interval, Is this your requirement?

Regarding your second question, do you mean the connection update parameters procedure? Generally, the connection intervals are defined by the central, so what you can do, is to issue a connection update request and the central will decide if it will accept the connection parameters that you have requested. Do you mean how much it will take once the master has accepted the update parameter request?

Thanks, PM_Dialog

nigelyang
Offline
Last seen:1 month 3 weeks ago
加入:2018-03-20 08:24
hi Dialog,

hi Dialog,

Yes, I want to do I2C transmisstion between connection events. Please teach me how to do ?

thanks for your help

nigel

PM_Dialog
Offline
Last seen:1 day 2 hours ago
Staff
加入:2018-02-08 11:03
Hi Nigel,

Hi Nigel,

Yes, but is the device configured in sleep mode? In general, the system can go into sleep mode btween advertisign or connection intervals.

Thanks, PM_Dialog

nigelyang
Offline
Last seen:1 month 3 weeks ago
加入:2018-03-20 08:24
Hi Dialog

Hi Dialog

Where is the code (or function) which is responsible for sending the acknowledgment of BLE ? I want to know timing the code is executed, allows me to do i2c transmission immediately after the sending acknowledgment in order to ensure finishing i2c job before the next ack. Thanks

PM_Dialog
Offline
Last seen:1 day 2 hours ago
Staff
加入:2018-02-08 11:03
Hi Nigel,

Hi Nigel,

Please take a look at Section 7.7 BLE Interrupt Generation in theUM-B-044: DA1468x Software Platform Referenceuser guide. Please check the following bullet :

ble_event_irq: End of Advertising / Scanning / Connection event. Used to cleanup/reinitialize state and defer TX/RX handling operations.

After that see section 8.3.4 Hooks inUM-B-056: DA1468x Software Developer's Guide文档。BLE钩子机制提供了the user application a way to be notified about the exact time of occurrence of specific BLE events. Please see figure Figure 41: Connected.

Thanks, PM_Dialog