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.
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?
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.
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.
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.
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.
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:
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?