Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Bluetooth SDK

gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

I'am trying to ble_mouse source on custom board with cyw20819.

For idle status, I got the 'HCI_ERR_INSTANT_PASSED' for connection_down reason.

I mean idle status is no mouse input. It works with slave latency. No sleep mode.

Ble configuration is follows.

conn_min_interval = conn_max_interval = 8

conn_latency = 99

conn_supervision_timeout = 500.

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim ,

Maybe the issue is because of high connection latency. Will you be able to have a reduced connection latency in your design?

Regards,
Bragadeesh

View solution in original post

0 Likes
27 Replies
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim ,

The following post explains the HCI_ERR_INSTANT_PASSED disconnection event.

https://stackoverflow.com/questions/48447645/android-ble-peripheral-disconnects-with-status-code-ble...

https://stackoverflow.com/questions/60459312/reduce-occurrence-of-instant-passed-0x28-ble-disconnect...

More details can be found in section 5.5 PROCEDURES WITH INSTANTS (Version 5.2 | Vol 6, Part B)

Can you please provide air logs when this issue happens to identify the root cause of this issue?

Regards,
Bragadeesh
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

If I try to make air logs, use BTSpy?

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim

BtSpy logs can give only the HCI level transactions. This issue happens at link layer level and hence we need air logs using some BT sniffer to identify the issue. Did you try to perform this experiment in a less noisy RF environment?

Also, can you please let us know which application (code example link) you are using? Also please share with us the steps to reproduce this issue.

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh,

I can't do in other environment.

But I can provide code link for a few days.

https://github.com/CLELECTRONICS/12345

Regards,

gykim

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim , Please share air logs to debug the issue. Also, share with us the steps to reproduce the issue.

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadessh.

I don't know how to create air logs. Can you tell me?

And I faced the issue when I was doing nothing. Just on connection.

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim ,

You need to use a BLE sniffer that can capture the BLE traffic sent over the air. If that is not available. Can you for now share the BtSpy logs of the transaction when the issue  occurs?

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh,

Actually I don't know how to use BTspy and client control.

Now I'm trying to study these.

I'm going to reply as soon as possible.

regards,

gykim

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim , This should be a good starting point 

https://github.com/Infineon/CypressAcademy_BT101_Files/blob/master/PDFs/WBT101-05-Debugging.pdf

 

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh.

First, I changed configurations.

.conn_min_interval = 20,
.conn_max_interval = 20,
.conn_latency= 98,
.conn_supervision_timeout = 500,

And the BTSpy logs is enclosed.

But the 'reason: 40' is not detected but 'reason: 8' is detected.

I think it will be occured reason: 40 too.

So, I put this log file first.

And... mouse sensor value is not read correctly.

The overflow flag is always set every interrupt.

The mouse sensor use interface SPI0.

Is this problem with HCI?

Regards,

gykim.

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim , The Connection Timeout error code indicates that the link supervision timeout has expired for a given connection. Looks like you are trying to disconnect by resetting the peer device.

Can you obtain BtSpy logs when you observe HCI_ERR_INSTANT_PASSED ? 

What is the peer device you are using? Also, is it possible to obtain HCI logs of the peer device as well? 

Did you try using a less slave latency to see if the issue reduces?

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Can you obtain BtSpy logs when you observe HCI_ERR_INSTANT_PASSED ? 

 -> I have been getting logs. I am going to reply if I get HCI_ERR_INSTANT_PASSED.

What is the peer device you are using?

 -> I'm using Bluetooth dongle.

  spec : Realtek RTL8761B, BT5.0

Also, is it possible to obtain HCI logs of the peer device as well?

 -> I'm afraid not now. I'am waitting for bluetooth sniffer, this product delivery is long.

Did you try using a less slave latency to see if the issue reduces?

 -> OK, I'm going to change configuration as first test.

.conn_min_interval = 8,
.conn_max_interval = 8,
.conn_latency= 99,

 

Regards,

gykim
.conn_supervision_timeout = 500,

0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh.

HCI_ERR_INSTANT_PASSED is occured.

I share this logs with you.

Regards,

gykim

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim , Can you set slave latency to 0 and perform this test again? 

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh.

I got no link down with conn_latency 0 for 9 hours.

Because windows is rebooted, it's done at 02:10 but It seems to be working fine.

Should I get more logs?

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim ,

Maybe the issue is because of high connection latency. Will you be able to have a reduced connection latency in your design?

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh.

I can reduce connection latency, but I have some questions.

1. What is latency typically used in ble mouse?

2. Can you explain why my issue is occured?

Board design, noise of environment or other reason?

3. If I use the sniffer, can I get more accurate reason?

Regards,

gykim

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim ,

1. Slave latency depends on the amount of time the peripheral device can still not exchange data while still maintaining a connection. You need to set this based on your requirement. If you are performing any encryption or key exchange procedure, it is recommended to have less slave latency so that the procedure is completed fast. Otherwise, you can have increased slave latency values so that your device can be put to sleep.

2. Can you try your project in an EVAL board provided by Infineon and check if the issue is reproducible. This will tell us if the issue is in hardware or firmware (or environmental issue). 

3. Yes, this should give us a clear picture as of why this issue occurred.

4. Is the issue specific to a particular client? Were you able to reproduce the issue with some other client device? Please let us know your peer device.

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh,

 

2. Can you try your project in an EVAL board provided by Infineon and check if the issue is reproducible.

 -> I'm sorry I can't. I don't have EVAL board.

4. Is the issue specific to a particular client? Were you able to reproduce the issue with some other client device? Please let us know your peer device.

 -> I have 3 dongles, and these are connected wit PC.

https://www.tp-link.com/en/home-networking/adapter/ub500/#overview

http://iptime.com/iptime/?page_id=11&pf=17&page=&pt=525&pd=1

https://ko.aliexpress.com/item/4000203567475.html?gatewayAdapt=glo2kor&spm=a2g0o.order_list.0.0.21ef...

 

My board has been working for few days, HCI_ERR_INSTANT_PASSED is not occured.

But HCI_ERR_CONNECTION_TOUT is occured.

And I received sniffer, Adafruit Bluefruit LE Friend.

I used the LE Friend and wireshark v3.2.3. But I don't know it works well.

Wireshark's message is follows.

gykim_1-1643099188416.png

regards,

gykim

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim , the quality of this image seems bad, could you please reattach the wireshare file along with BTspy HCI logs?

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh,

I got this log via wireshark 3.0.7, a dongle from aliexpress.

On aother condition, it was able to get info 'ADV_IND'.

(On wireshark 3.2.7, tp-link, iptime, it wasn't able to info 'PDU' and 'Encryped packet'. )

image.png

And the error message.

image.png

Can you explain how to get other packet log?

 

Regards,

gykim.

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim , If the packet is encrypted using a key (after pairing), then it is not possible to view these packets in the logs without the keys. That is why you get this error message. Can you share the HCI logs when the issue occurs?

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh.

I upload the log file.

 

Regards,

gykim

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim ,

Thanks for sharing the HCI logs. From the HCI logs, we see "HCI_Authenticated_Payload_Timeout" event which means that a packet with valid MIC has not been received within the Authenticated Payload Timeout and that the Host is notified that the timer has expired. After the timeout expires, the controller will automatically disconnect the link with LMP response timeout event. Can you check if you are receiving a similar event from the client end?

Reference sections from Spec: 

Section 5.4 LE AUTHENTICATED PAYLOAD TIMEOUT , Vol 6, Part B

Section 6.13 LE PING, Vol 6, Part D

5.1.8 LE Ping procedure, Vol 6, Part B

6.13 LE PING, Vol 6, Part D

How often does this issue occur? We highly recommend you to run your project in this eval kit (CYW920819EVB-02 Evaluation Kit). This ensures that there are no issues in the hardware. 

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

Hi Bragadeesh.

I don't have received similar event.

And the "HCI_Authenticated_Payload_Timeout" is alway received with third dongle from ali-express.

With other dongles, the message is recieved many times.

I want to run my project in Evaluation Kit. But delivery of this product is longer than 10 weeks.

So now, I think the best way is that I configure 0 to slave latency.

I wonder your suggestion.

Regards,

gykim

0 Likes
BragadeeshV
Moderator
Moderator First question asked 1000 replies posted 750 replies posted
Moderator

Hi @gykim , We do not see any issues in using low slave latency values in your design.

Regards,
Bragadeesh
0 Likes
gykim
Level 3
25 sign-ins 10 replies posted 10 sign-ins
Level 3

OK, Thanks a lot your effort.

0 Likes