Can ble_app_sleepmode work with XTAL16M and without XTAL32K

⚠️
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//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
anushiya
Offline
Last seen:4 months 1 week ago
加入:2017-12-20 02:30
Can ble_app_sleepmode work with XTAL16M and without XTAL32K

Hi,

I have a custom board with XTAL16M connected and no XTAL32K connected. When I run ble_app_sleepmode example in non_connectable mode, WDOG timeout happens and come into the function/routine NMI_HandlerC.

When I commented the line #define CFG_WDOG in da1458x_config_basic.h, I notice the code stays in while(!ble_deep_sleep_stat_getf()); for ever.

I cannot use RCX20 either. The code complains.

How can I resolve this without connecting XTAL32K?

I am using SDK 6.0.10.511

Thank you,

Anushiya

Device:
PM_Dialog
Offline
Last seen:13 hours 8 sec ago
Staff
加入:2018-02-08 11:03
Hi anushiya,

Hi anushiya,

由于没有XTAL32定制板上,你should switch the Low Power clock the RCX in order to operate when going to sleep. Please check da1458x_config_advanced.h file and change the CFG_LP_CLK from LP_CLK_XTAL32 to LP_CLK_RCX20. In addition, keep in mind that the XTAL16M adaptive settling algorithm works only with XTAL23K and not with RCX, as the LP clock, so you should undefine the CFG_XTAL16M_ADAPTIVE_SETTLING macro check da1458x_config_advanced.h file. Regarding the WDOG, you should not comment it out, since it’s SDK definition and you will not be able to build you project. If you don’t want to use it, you should undefine it. However, if the WDOG is disabled and your firmware gets stuck somewhere, you the WDOG will never hit. So, me recommendation is to keep the WDOG enabled for your debugging.

Thanks, PM_Dialog

anushiya
Offline
Last seen:4 months 1 week ago
加入:2017-12-20 02:30
>Regarding the WDOG, you

>Regarding the WDOG, you should not comment it out, since it’s SDK definition and you will not be able to build you project. If you don’t want to use it, you should undefine it. However, if the WDOG is disabled and your firmware gets stuck somewhere, you the WDOG will never hit. So, me recommendation is to keep the WDOG enabled for your debugging.

As I mentioned in the original message, this was done temporarily to see what is happening.

>In addition, keep in mind that the XTAL16M adaptive settling algorithm works only with XTAL23K and not with RCX, as the LP clock, so you should undefine the CFG_XTAL16M_ADAPTIVE_SETTLING macro check da1458x_config_advanced.h file.

How will it affect the system when it is in non-connectable configuration? Will the power consumption affected? what is the benifit of "the XTAL16M adaptive settling algorithm"?

anushiya
Offline
Last seen:4 months 1 week ago
加入:2017-12-20 02:30
Hi,

Hi,

When I did the suggested approach above, I am facing a new problem related to the above solution.

(I am using DA14586 with 6.0.10.511 SDK. Modified the code ble_app_sleepmode to non_connectable modewith the advice inhttps://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-hardware-device-reference-designs/mnfdata-update#comment-24042.

No external interrupts possible. Sleep inbetween advertisements and need to wake up automatically)

The system transmitted for about 20 minutes and then went into assert warning in the below line in rwble.c.

#if (USE_XTAL16M_ADAPTIVE_SETTLING)
if(( && ()) && ()) { }

#else
if(DEVELOPMENT_DEBUG)
/ /如果这个断言击中LP ISRlasts longer than the time
// that has been reserved via LP_ISR_TIME_XTAL32_CYCLES and LP_ISR_TIME_USEC.
if (sleep_lp_cycles && (sleep_lp_cycles < slp_period))
ASSERT_WARNING(0); //(it entered here)
#endif

So I changed the definition of LP_ISR_TIME_XTAL32_CYCLE to (127) (from 110) and LP_ISR_TIME_USEC to (3876) (from 3357).

It hang in the line

//wait until BLE core de-asserts the LP IRQ

while (GetWord16(GP_CONTROL_REG) & BLE_WAKEUP_LP_IRQ) ;

How can I overcome this situation.

I looked athttps://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/some-porblem-sleep-mode.

Still not sure how to overcome this problem.

PM_Dialog
Offline
Last seen:13 hours 8 sec ago
Staff
加入:2018-02-08 11:03
Hi anushiya,

Hi anushiya,

Can you please indicate if you have the following configurations?

  • #undefCFG_XTAL16M_ADAPTIVE_SETTLING
  • #define CFG_LP_CLK LP_CLK_RCX20 (since you don’t have a XTAL32K in your board)

Can you please clarify the “No external interrupts possible”? You mean that you stop advertising – put your device in permanent sleep mode and you are unable to wake it up through the wake-up controller?

Thanks, PM_Dialog

anushiya
Offline
Last seen:4 months 1 week ago
加入:2017-12-20 02:30
I fixed this problem:

I fixed this problem:

The reason was I had my custom board accelerometer initialising code inside periph_init function in use_periph_setup.c file and due to the initialisation time was longer than allowed, it caused problem.

I had to leave the SPI bus initialisation in there and move the rest to user_app_init in user_sleepmode.c and then the system works fine.

To answer your question below, Yes I have them all along.

>Can you please indicate if you have the following configurations?

> #undefCFG_XTAL16M_ADAPTIVE_SETTLING

> #define CFG_LP_CLK LP_CLK_RCX20 (since you don’t have a XTAL32K in your board)