Hi Dialog,
我的任务之一是负责发送/发射ing 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)
I got same result via two modes, debug mode and production. Should the results be different? I used "pm_mode_idle" when the problem happened. You mentioned that The BLE interrupt is served with higher priority (PRIORITY_1) than the I2C (PRIORITY_2). I think so, the BLE event (resposne ACK) leads to the irregular I2C transmission, and let DA14681 go to unknow state ( reboot later) or still waiting for external data all the way.
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,
What is the behavior in debug mode? Does the code get stuck? For example, are you getting any assertion or anything else.. This is happening only when the DA1468x is connected with a peer device?
Thanks, PM_Dialog
hi Dialog,
Generally, tuck by I2C transmission. I do not use assertion. I use mobile App TX/RX data to DA14681, and process the data, then TX/RX data with external chip via I2C.
I hope I could exactly know when the BLE event (acknowledge) happens, allow me to do I2C transmission between two connection events. Is it possible to know the interrupt of BLE connection event ? if yes, how to know?
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