Hi Dialog,
My one of tasks is responsible for sending/ receiving massive data to external chip via I2C. I often enounter the problem that DA14681 sends wrong I2C signal( re-launch start condition ) and losing BLE connection within couple seconds. I found as long as I increase connection interval, the rate of this problem happening is decreasing. Furthermore, the result is better after I added many slave latency. I guess BLE TX/RX event of every interval might take place during I2C transmission. please take a look at the attached PDF file for understanding what I mean. Is the problem possible ? if yes, how to prevent from BLE TX/RX event and I2C trnasmission happen at the same time? Is it possible to know when BLE TX/RX event happens in advance, then do I2C transmission in following step?
thanks for your help.
Hi nigelyang,
Let me check it and I’ll let you know.
Thanks, PM_Dialog
hi Dialog,
Is there any solution for my problem? thanks for your help
Hi nigelyang,
My apologies for the delay. So, if I understood correctly your description, the problem exists as soon as a I2C transaction is happening at the same time with a BLE event. Is this correct?
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
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.
Hi nigelyang,
调试模式中的行为是什么?代码是否陷入困境?例如,您是否有任何断言或其他任何东西..只有当DA1468X与对等设备连接时,才会发生这种情况?
Thanks, PM_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
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
hi Dialog,
Yes, I want to do I2C transmisstion between connection events. Please teach me how to do ?
thanks for your help
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
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
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