找回密码
 立即注册

微信扫码登录

楼主: Flole

[BLE SDK] Missing retransmits causing connection drops

[复制链接]

3

主题

19

回帖

187

积分

荣耀黄金

积分
187
 楼主| 发表于 2025-8-8 18:04:46 | 显示全部楼层 来自 德国
本帖最后由 Flole 于 2025-8-9 21:59 编辑

I have just tested on another board, same result. Halting and resetting it with the programmer causes it to not wake up from sleep again on the second run.

3

主题

19

回帖

187

积分

荣耀黄金

积分
187
 楼主| 发表于 2025-8-11 04:23:01 | 显示全部楼层 来自 德国
本帖最后由 Flole 于 2025-8-11 18:08 编辑

I have done additional testing and setting
  1. pm_set_xtal_stable_timer_param(216, 20, 320);
复制代码
eliminates the clock drift now. Also it seems like it runs mostly stable with these parameters. With higher parameters it crashes/resets after about 8 minutes. How can I fine-tune those, the documentation doesn't really explain what each parameter does and when to increase/decrease them. The first parameter basically indicates in microseconds how long the loop for the third parameter takes? When is that loop executed and what is it for? The second parameter is also a loop/delay, when is that loop executed?

Do I also need to adjust blc_pm_setDeepsleepRetentionEarlyWakeupTiming after setting the xtal stable timer param?

Unfortunately even with these parameters the stall after a reset remains. If the CPU resets for any reason (halt/reset from the debugger, exception, watchdog timeout) it will not wake up from sleep again. A power-cycle fixes it. Any idea how I can do further debugging? I suspect a difference between power-on and another reset is, that the oscillator would be not oscillating on a power-on, so the initial "kick" to start it might not work properly after a reset? Is there anything I can do to manually power-down the oscillator after a reset (like driving the oscillator GPIOs as outputs low) and then re-start it? Maybe that could help after a non-power-on-reset?

3

主题

19

回帖

187

积分

荣耀黄金

积分
187
 楼主| 发表于 2025-8-12 04:10:00 | 显示全部楼层 来自 德国
I am slowly making progress. Adding
  1. analog_write(0x3c, 0);
  2. cpu_wakeup_init();
复制代码
to my user_init_normal() fixes the lockups where the CPU does not wake up from sleep anymore after a reset, so I am calling cpu_wakeup_init() twice now (once in main, once in user_init_normal() while doing the analog_write before). Maybe that can help you to pinpoint the problem? What I wanted to do is trigger the oscillator-kick to make sure the oscillator is running, so it looks like it was not running properly before for some reason.

0

主题

9

回帖

52

积分

不屈白银

积分
52
发表于 2025-8-12 20:44:27 | 显示全部楼层 来自 上海
本帖最后由 TL_HWJ 于 2025-8-12 20:46 编辑

The bin file I previously sent you can run successfully on our EVK board. Could you please try running that same bin file first to see if it works properly? This would help rule out any potential hardware issues on your side.

3

主题

19

回帖

187

积分

荣耀黄金

积分
187
 楼主| 发表于 2025-8-13 00:52:53 | 显示全部楼层 来自 德国
I tried running the bin file and it shows the issue. If for whatever reason the CPU resets without a power-cycle it never wakes up from sleep again when it goes to sleep after the reset.

The crystal has a connection to the CPU and has 2 load capacitors to match the crystals 12.5pF expected load. I attached a picture of it. How can I configure the internal load capacitor of the TLSR8251 that is mentioned in the datasheet? At https://doc.telink-semi.cn/doc/e ... n_en/#other-modules it's mentioned how to configure the capacitor for the 24 MHz crystal but not how to configure the capacitor of the 32.768 kHz crystal.

Crystal.png

48

主题

268

回帖

1029

积分

版主

积分
1029
发表于 2025-8-19 10:03:57 | 显示全部楼层 来自 上海
If you are using the EVK we provided, you can use 12pf. However, from your picture, it doesn't seem to be an EVK. This may not be applicable to you because different manufacturers' crystals may have different recommended values for capacitors.

3

主题

19

回帖

187

积分

荣耀黄金

积分
187
 楼主| 发表于 2025-8-21 01:18:58 | 显示全部楼层 来自 德国
本帖最后由 Flole 于 2025-8-21 04:51 编辑

Correct, it's not an evaluation kit but it's the product we're trying to use the chip in. I need to know how to configure the on-chip capacitor in the TLSR8251 for the 32,768 kHz crystal. Which registers do I need to write to in order to disable it or set the value? I am talking about this:
image.png

48

主题

268

回帖

1029

积分

版主

积分
1029
发表于 2025-8-21 11:43:12 | 显示全部楼层 来自 上海
OK, I will confirm the issues you mentioned with my colleagues.

48

主题

268

回帖

1029

积分

版主

积分
1029
发表于 2025-8-22 13:52:48 | 显示全部楼层 来自 上海
It has been confirmed that this is an error in the datasheet. The on-chip capacitor used for the 32,768 kHz crystal in the TLSR8251 is not supported.

3

主题

19

回帖

187

积分

荣耀黄金

积分
187
 楼主| 发表于 2025-8-22 18:28:59 | 显示全部楼层 来自 德国
Is there any way I can adjust the code to compensate for a frequency deviation? We have already manufactured many devices based on the wrong information in the datasheet, so it is important for us that those devices can still be used. Maybe it's possible to adjust the sleep/wakeup code to compensate for a slight deviation in frequency? I did some testing but even if I adjust the clock time after wakeup the BLE timing would still deviate, so I think there is more that I need to consider/adjust so it works with a frequency slightly different from 32.768 kHz?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-8-31 18:03 , Processed in 0.107381 second(s), 22 queries .

Powered by Telink 隐私政策

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

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