找回密码
 立即注册

微信扫码登录

楼主: Flole

[BLE SDK] Missing retransmits causing connection drops

[复制链接]

48

主题

243

回帖

965

积分

版主

积分
965
发表于 2025-7-7 09:57:43 | 显示全部楼层 来自 上海
It is an error that you changed the CHAR_PROP_NOTIFY in my_batCharVal to CHAR_PROP_INDICATE, because Battery Level only can be Read or Notify, so please don't change it. You can refer to https://www.bluetooth.com/specifications/specs/battery-service/

3

主题

17

回帖

161

积分

荣耀黄金

积分
161
 楼主| 发表于 2025-7-7 20:29:00 | 显示全部楼层 来自 德国
That was an attempt to do as little modification to the sample as possible to reproduce the issue. In my real application I added a new service with the indicate property.

I can add a new service which then sends out the indicate if you think that makes a difference for reproducing this issue. Just let me know if I should try that. This change was just to reproduce the issue with minimal changes possible to the example. There is no example which already uses the indicate functionality as far as I can see, otherwise I would have used that. Maybe you could add a test for the indicate feature to the feature test project so I can use that?

48

主题

243

回帖

965

积分

版主

积分
965
发表于 2025-7-8 20:10:51 | 显示全部楼层 来自 上海
本帖最后由 TL_SW 于 2025-7-9 09:01 编辑

Sorry, I just noticed that you previously mentioned setting the connection interval to 2750ms and the latency to 7. These parameters will cause the slave to disconnect. The SDK supports a maximum sleep interval of 3 seconds during connection when using 32kRC. You can refer to the handbook for more details: https://doc.telink-semi.cn/doc/e ... ck-source-selection.
However, the problem you encountered is indeed something that should be handled within the SDK. We will find a way to avoid this issue later. Thank you

3

主题

17

回帖

161

积分

荣耀黄金

积分
161
 楼主| 发表于 2025-7-21 08:26:50 | 显示全部楼层 来自 德国
本帖最后由 Flole 于 2025-7-21 08:27 编辑

Hi,

thank you very much! Please let me know if you have a fix or something I should test.

I am also trying to use the external oscillator to get even longer sleep times, but the results are not good at all: The clock deviation is much worse and sometimes the CPU seems to get stuck in sleep, for example the first time after flashing it never wakes up again once it goes to sleep. I need to power cycle the CPU once. So Flash FIrmware->Run->Sleep->No Wakeup but when I do Power On->Sleep->Normal wakeup.

I have verified the oscillator frequency by doing
  1.     unsigned int t1 = pm_get_32k_tick();
  2.     sleep_us(1000000);
  3.     unsigned int t2 = pm_get_32k_tick();
  4.     printf("Diff %d   %d %d\n", t2 - t1, t1, t2);
复制代码

and it is perfectly accurate. For some reason periodic sleeps when using the external oscillator still cause a huge deviation in the clock and also the complete CPU freezes sometimes for some reason. Something seems to be broken there, possibly related to the sleep/wakeup procedure. I am building a clock and the drift is multiple seconds per minute, which is a lot higher than expected.

48

主题

243

回帖

965

积分

版主

积分
965
发表于 2025-7-21 20:54:53 | 显示全部楼层 来自 上海

Please confirm the following items:
1. Use blc_pm_select_external_32k_crystal
2. Confirm if 32k crystal exists or is connected.
image.png


3

主题

17

回帖

161

积分

荣耀黄金

积分
161
 楼主| 发表于 2025-7-22 18:15:09 | 显示全部楼层 来自 德国
I am using blc_pm_select_external_32k_crystal to select the external crystal and I have verified that it's connected. It is always happening when I flash a new firmware and then try to run it directly without power cycling. After a power cycle at least the wakeup from sleep is working most of the time. I'm testing this on the b85m_ble_sample and have only changed the crystal selection to blc_pm_select_external_32k_crystal, and it always happens when flashing the new firmware, so you should be able to easily reproduce it. In that state the CPU is also not reachable from the debugger, so it looks like it just gets stuck sleeping.

The datasheet mentions a programmable on chip load capacitor for the 32k oscillator, how can I program the load? I would like to test with the lowest load possible to see if that makes a difference.

0

主题

4

回帖

36

积分

英勇黄铜

积分
36
发表于 2025-7-24 09:36:32 | 显示全部楼层 来自 上海
We will analyze this issue, and once a conclusion is reached, we will promptly provide you with an update.

0

主题

4

回帖

36

积分

英勇黄铜

积分
36
发表于 2025-7-24 10:14:30 | 显示全部楼层 来自 上海
I was unable to reproduce the issue you described. Please verify using the provided binary file.

825x_ble_sample.zip

34.48 KB, 下载次数: 2

3

主题

17

回帖

161

积分

荣耀黄金

积分
161
 楼主| 发表于 2025-7-28 05:09:51 | 显示全部楼层 来自 德国
I flashed that file and then reset the CPU from the programmer. It ran fine the first time, so I issued a halt and reset the CPU again, and then it stalled. On the UART I see
  1. [FLASH][INI] 512K Flash, MAC on 0x76000
  2. [FLASH][PROT] flash lock low 256K block!
  3. [FLASH][PROT] initialization, lock flash
  4. [APP][INI]Public Address: xx xx xx xx xx xx
  5. [APP][INI] BLE sample init
  6. [FLASH][INI] 512K Flash, MAC on 0x76000
  7. [FLASH][PROT] flash lock low 256K block!
  8. [FLASH][PROT] initialization, lock flash
  9. [APP][INI]Public Address: xx xx xx xx xx xx
  10. [APP][INI] BLE sample init
复制代码


I then power-cycle the CPU and it runs again. If I issue a halt and then a reset over SWS again it stalls again. So it looks like the second halt-and-reset is the issue here.

I left this running for about a minute and then I was also seeing that it appeared to have stalled, there was no broadcasts anymore and a short power disconnect could not bring it back to life, so its likely in sleep mode using very little power (super impressive what you managed to do there by the way!!). I had to do a longer disconnect so it fully discharged all capacitors, and then it would work again (but it eventually stalled again).

0

主题

4

回帖

36

积分

英勇黄铜

积分
36
发表于 2025-7-28 16:26:21 | 显示全部楼层 来自 上海
Hi, do you have any other boards available for testing? Maybe you could try swapping to a different board to see if the issue persists. Could you also take a photo of your board so we can inspect it?
By the way, regarding the one-minute sleep issue you mentioned, you can wake up the board by pressing the button.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-8-17 19:48 , Processed in 0.102666 second(s), 22 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表