⚠️
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 https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
19 posts / 0 new
Last post
Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
Connection drops

Hi there,

I am experimenting with a pair of DA14531 TINY modules connected to a computer via a 2-wire UART and USB/UART converter on CP2104 by using CodeLess firmware image codeless_531_standalone_set_two.hex. Establishing a connection between them works as described in Section 3.3 of  UM-B-140. But the probelm is that the modules drop the  connection after about 3 minutes. Is it possible to fix it so that the connection will remain active indefinitely?

Two other precompiled firmware images (codeless_531_standalone.hex and codeless_531_datapump.hex) are free of this disadvantage, but I need I2C support. I recompiled the standalone_set_two project from source, but it still drops connection after 2-3 minutes. Same happens if I recompile SET ONE firmware by adding I2C feature to it. Dialog team - please advise how to fix this.

 

PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

Thanks for your question.

>>> But the probelm is that the modules drop the  connection after about 3 minutes.

Can you please provide further details on this? When the connection drops? Are you sending any specific AT command? Can you please run it in debug mode?

>>>I2C support

Do you mean that there is an I2C interface connected to the TINE module, and your requirement is to read and transmit the I2C data?

I would recommend running the project in debug mode and check if it gets stuck into an assertion NMI etc.

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
Thanks for the prompt

Thanks for the prompt response!

I2C has nothing to do with the issue, since so far I even do not issue any I2C command to the module. Also, it has no slave connected to it. The only module pins I use are P0_5 and P0_6 to connect it to external USB-UART converter.

I use Codeless SDK 6.380.10.4 with a free version of Keil v5.27.1.0 and commented out some AT commands in file user_at_command.h (see attached) to bring the codeless_stand_alone image under 32K limit. Following your advise I ran it in debug under Segger J-Link debugger. Right after starting the code I give to it AT+SLEEP=0 command, the module responded with OK and +AWAKE on the next line. Then I use Cypress CySmart tool along with their dongle as a central device to connect to the TINY module. Upon establishing the connection the module responded with +CONNECTED (in TeraTerm) and I can explore its services and attributes in CySmart used as BLE scanner tool. At this point everything works fine as expected - I can see the module's characteristics outlined in the manuals. Then I leave the module idling in the connection mode, that is issue no commands from TeraTerm and also no command over Bluetooth from CySmart. The connection is dropped after ca. 3 min as I described before. The debugger does not show me anyhing suspicious, definitely no NMI, actually it does not show anything, just runs the module code. The TeraTerm reports +READY and CySmart reports connection drop.

If you unaware with CySmart, I did the same experiment by establishing a Bluetooth connection with a pair of 531 TINY modules. One of them runs pre-compiled image (does not matter which one), the other modules runs my compiled image. The same connection drop happens after 3 min. However, if both modules run pre-compiled datapump or standalone images (by pre-compiled I mean the images provided in SmartBond Flash Programmer) tool, then no connection drop is experienced. But once one of the moduled is loaded with pre-compiled standlone set two, the connection drop happens. So, something is wrong with pre-compiled set-two image and with the SDK source code.

I wrote about I2C only because I need that option. So far I even did not try how it works, so the problem is definitely not related to I2C.

Attachment: 
PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

Since the application code does not stuck anywhere (NMI /  WDOG / assertion) , then it would be very helpful to share a sniffer log in order to understand what is happening over the air.

Would it be possible to use a BLE sniffer tool and share an sniffer capture?

Do you have a custom board, or you are using any of or DKs? Additionally, if you are using sleep mode, then you should use 4 UART signals (URX/UTX/RTS/CTS).

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
Here you go. The attached

Here you go. The attached archive has a photo of my hardware (just DA14531 module and CP2104 USB-UART) and the BLE events Log. The Log shows that the 531 issued connection timeout 3 minutes after connection establishment (the last 3 records). I do not use SLEEP mode.

Attachment: 
PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

In the attached log, the disconnection reason is the connection timeout. According to Bluetooth LL core specifications, the Connection Timeout error code indicates that the link supervision timeout has expired for a given connection. The supervision timeout is set in the user_connection_param_conf structure.

Can please also indicate if the device starts advertising again after the disconnection? You can add a break point in the disconnection callback - user_on_disconnect() – and check the disconnection reason as well. Please see  gapc_disconnect_ind structure.

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
Yes, after dropping the

Yes, after dropping the connection the DA device starts advertizing again. You are right: the Link supervision is expired because DA14531 stopped responding to connection events.

I created a special app by using Silicon Labs Simplicity Studio and their Thunderboard Sense 2 board as Central that just connects to DA14531 and does nothing after that while keeping the connection active. In the attached archive there are two images provided by Simplicity Studio Network Analyzer. On those images the device 90:FD:9F:7B:86:16 is my Central and DA:E4:D9:A6:F6:E9 is DA14531. On image named  Connection_parameters you can see that DA14531 requested to set Connection latency 5 and Supervision Timeout 1250ms, which were accepted by the client (see Events Detail window). Then on image Log2 you see that DA14531 works according to the Connection Latency by not responding to 5 consequtive connection intervals in series. But after 138sec in this case it was a longer series of not responded packets which caused Superivision timeout at Central. I also see this reason (Error 0x208) on Tera-Term output from my central device on the 3rd image.

From these logs it follows that after some time (2-3min) DA14531 stops responding to connection events for no reason. So, Dialog - why don't you just fix your software. Such behavior is definitely a bug. You can easily convince yourself in that by compiling and loading your provided source code into two modules or dev boards.

Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
OK, Dialog, I decided to

OK, Dialog, I decided to follow your advise by adding several break points in user_on_disconnect()  function in file user_codeless.c. It turns out that your provided code does not go into this function after connection is dropped. Further investigation showed that the module resets itself after dropping a connection and if one adds a breakpoint in main(), the code stops there. So, I believe you need to create a ticket for your software development group. If you want me to do it, please give me instructions.

PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

Could you please run it with the debugger attached and share a screenshot where the code gets stuck after the disconnection?

Does the device boot from System-RAM or SPI flash?

To be honest, I am little bit confused. Can you replicate this issue with the SmartConsole mobile application?

In my side I am not able to replicate it and the CodeLess is working perfectly.

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
I ran it in a debugger again,

I ran it in a debugger again, the screenshot is attached. The code does not stuck anywhere, it just resets the module and the main() function starts over. You will see it on the screenshot which shows where the debugger stopped after dropping the connection. So, the module is ready to establish a new one, and this works if I keep running it. But the new connection is also dropped after ~3 minutes. Again, I do not communicate with the module after establishing a connection - just leave it idling. It looks to me like a Watchdog behavior.

I do not use any (external) flash, just a bare module connected to CP2104 USB converter, see the attached image, and am not sure how the device boots internally. I just compiled Codeless software (v6.380.10.4) image for codeless_531_set_two_standalone without any changes and loaded it into my two modules via SWD interface. So, it boots according to the algorithm in your software. And it works the same on each of the modules - drops connection after 3 min of inactivity.

The same connection drop behavior is observed by using SmartConsole app on Android (Samsung Galaxy S8) as client. Any ideas what else to check?

Added later (IMPORTANT): I just noticed that if I issue the ATI command to the module running under debugger, the response is CodeLess DA14531 v_6.380.10.4 and this matches the SDK version that I use. However, if I now reboot the module with the debugger disconnected, the response to the ATI command becomes CodeLess DA14531 v_6.380.9.10 (??!!!) Maybe this is the reason for the misbehavior?

Attachment: 
Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
OK, these days I learned that

OK, these days I learned that if one programs the module from within Keil (in degug mode) and externally with Dialog SmartBond Flash programmer, then the results are different. Namely, after flashing my compiled code with the Flash programmer it shows the right firmware image version  DA14531 v_6.380.10.4 no matter how you boot it (I mean during the debug session in Keil and also with JLink debugger disconnected). So, the mismatch between the firmware images outlined in the Added later section of my post above is resolved. However, the module still drops the connection after 3 minutes. Am I the only one who experiences that?

Dialog team: if the connection is not dropping for you, could you please send me the HEX image for codeless_531_set_two_standalone.hex that works fine for you?

PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Sergei,

Hi Sergei,

Do you have a BLE sniffer tool in the university? We would like to share a BLE capture, so that we can understand what is happening over the air. This will really help us to understand better the root cause.

Can you replicate this issue with another mobile phone running the SmartConsole application? Did you try ito only with the Samsung Galaxy S8?

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
Dear Dialog Team! I have

Dear Dialog Team! I have provided above already two BLE captures collected by different capturing software and hardware. One of them is collected by Cypress CySmart tool and their dongle CY5677 and the other one by Silicon Labs Network Analyser. Attached is yet another most detailed capture collected by Nordic Semiconductor BLE dongle PCA10031 and their Sniffer 3.0 software that works in tandem with Wireshark (v3.2.5). The attached capture involves two devices (my Galaxy S8 phone running SmartConsole and DA14531 module with MAC 48:23:35:00:07:AA) and it can be opened with Wireshark. In each of these cases I left the connection idling after establishing it. These are my all BLE sniffer tools.

I have replicated the connection drop issue on another another Galaxy S8 phone of my wife, on my older Galaxy S5 phone, and with at least 3 other non-phone BLE devices that I use as a master. DA14531 module just stopps responding on Master connection events and resets itself (I am not sure what comes first, though). Again, I experience this only if I load codeless_531_standalone_set_two image into the module. Connection with other two available pre-compiled images (codeless_531_datadump and codeless_531_standalone) seems working fine, i.e. without connection drops after 3 minutes, unless I compile them myself from the provided source. In the latter case connection drops appear no matter which image I compile.

The pre-compiled images that I used are the ones provided by Dialog SmartBond Flash Programmer. I asked you above to send me the image that you are using for testing. Please do it. Also, please try my attached hex on your hardware.

Attachment: 
PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
 

 

Hi Sergei,

My apologies for the confusion – just saw the attached sniffer log. Finally I can replicate it with the codeless_531_standalone_set_two.hex and using the Flash programmer tool. Let me escalate it to the team internally and I’ll get back to you as soon as possible.

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Sergei, 

Hi Sergei, 

My apologies for my late response. i got feedback from the Team internally and will have a fix soon. I'll let you know in this forum thread, once the fixes is released.

Any other comments / feedback reggarding the CodeLess would be more than welcome!

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
Thank you. I am looking

Thank you. I am looking forward for the issues to be resolved.

PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Sergei Bezroukov,

Hi Sergei Bezroukov,

The new Codeless SW version 6.380.12.6 has been released online. It is now available for download from the CodeLess portal:

https://www.dialog-semiconductor.com/products/smartbond-codeless-commands

Thanks, PM_Dialog

Sergei Bezroukov
Offline
Last seen: 1 year 2 months ago
Joined: 2020-06-25 00:28
Thank you, Dialog Team. This

Thank you, Dialog Team. This issue is resolved. Waiting for resolving the I2C issues...

PM_Dialog
Offline
Last seen: 2 days 9 hours ago
Staff
Joined: 2018-02-08 11:03
Hi Sergei,

Hi Sergei,

Thanks for accepting my answer and glad that the new CodeLess release fixes this issue. I’ll get back to you in your other forum thread regarding the I2C questions..

Thanks, PM_Dialog