基本设计套件开发
DA14580(Murata module on custom board)
SDK 5.0.4.
你好对话框,
我以前使用过SDK 5.0.3并在没有问题的情况下调用扩展睡眠和唤醒功能。现在我有一个新的设计,我正在使用SDK 5.0.4。出于某种原因,唤醒似乎没有运行相当相同。在设置唤醒引脚活动时,我没有得到唤醒。我尝试关注BLE_APP_SLEEPMODE示例,这似乎与我以前在SDK 5.0.3中进行过的几乎相同。他们添加了app_easy_wakeup_set(app_wakeup_cb);我以前没有使用过的线。我包含这个和回调,看起来它只是重新启动广告。我想知道我是否应该只有一个回调并重新启动那里的广告,但我尝试过,它也不工作。
是否有任何配置参数,我应该检查?在我必须使用#define wkup_enable之前,但似乎似乎要求这个例子。
我有app_default_sleep_mode = arch_ext_sleep_on和#define cfg_mem_map_ext_sleep set。
在广告完整的例程中调用睡眠我正在做的:
app_easy_wakeup_set(app_L0_wakeup_cb);
wkupct_register_callback(app_L0_wakeup_cb);
wkupct_enable_irq(wkupct_pin_select(gpio_port_0,gpio_pin_7),//选择dialog_wakeup pin p0_7
wkupct_pin_polarity(gpio_port_0,gpio_pin_7,wkupct_pin_polarity_high),//极性高
1,// 1事件
0);// debouncing time = 0
arch_ble_ext_wakeup_on ();/ /去睡觉等待wakeup pin input
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
当我切换p0_7引脚时,我没有看到广告重启,所以我不确定我曾经去过wakeup_register_callback,但我有:
static void app_L0_wakeup_cb(void)
{
if (GetBits16(SYS_STAT_REG, PER_IS_DOWN))
{
periph_init();
}
if (arch_ble_ext_wakeup_get())
{
ARCH_SET_SLEEP_MODE(app_default_sleep_mode);
arch_ble_force_wakeup();
ARCH_BLE_EXT_WAKEUP_OFF();
app_easy_wakeup();
//启动30秒的计时器
//如果在30秒内没有连接,将返回睡眠
sleep_timer = app_easy_timer(3000,sleep_timer_cb_handler);//设置为30秒
//重新启动广告
user_app_adv_start();
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please let me know if you see anything obviously wrong with this.
谢谢,最大
嗨max44,
我没有看到已经实现的代码的任何错误,代码与ble_app_sleepmode相同,因此它应该工作,我可以看到最可能出错的是用arch_ble_ext_wakeup_get()检查的条件,在函数返回0的情况下,将在该条件中执行任何内容,因此检查是否触发中断并执行App_L0_WakeUp_cb()函数。除此之外,您还应该检查P07上连接的线路实际上由外部设备或SESNOR或在P07引脚上连接的任何内容。
谢谢mt_dialog.
公吨,
Thanks. for the inputs.
This morning I did verify that the P0_7 pin is being set. It's being driven by an external MCU and I set up a test toggle. I can read the state from within the DA14580 code, so the connection looks good.
I' also looked at the DA registers and I see P0_7 being slected and set for high polarity in WKUP_SELECT_P0_REG and WKUP_POL_P0_REG. I also see the wakeup interrupt being enabled in the WKUP_CTRL_REG.
我以前尝试过刚刚消除Arch_ble_ext_WakeUp_get()条件,但将重新审视,看看我是否可以以某种方式验证正在触发中断。当调用睡眠模式时,我发现很难调试。
问候,最大
公吨,
Some additional info. This design compared to our previous does not have a 32KHz crystal attached. I was assuming that we can use the internal low speed oscillator and I configured GFG_LP_CLK to LP_CLK_RCX20. Looking at the setting there's a bit for "Extra low lrequency" set. I'm not sure exactly what this means. Also, I had read on another post concerning using the RCX20 that some PMU settings might be required? I'm not sure what to do there and if this would affect getting the wakeup interrupt. We're running off a couple AA batteries for testing that are at 3.3V, but will eventually move to a coin cell that may have a slightly lower voltage.
谢谢,最大
嗨max44,
Since you are operating in buck mode there is no need to use a external XTAL32 and you can configure that just by defining the CFG_LP_CLK using the LP_CLK_RCX20, i dont get what you mean with the "Extra Low Frequency", what i ve mentioned above is the only configuration you should do in order to operate with the internal RCX oscillator, and i dont think that this will affect the wake up timer module of the 580.
谢谢mt_dialog.
公吨,
So buck mode occurs automatically? No configuration settings required?
我提到的“额外的低频”在数据表中的寄存器clk_rcx20k_reg中有点。我看着那个寄存器来验证RCX20是否已启用。如果您说LP_CLK_RCX20正确配置的RCX20,我将不会担心它。
所以.....感谢附加信息。我回到试图确定唤醒中断是否触发。
问候,最大
嗨max44,
Yes, the device will automatically detect the mode of operation of the application depending on the external connections made using a hardwired state machine that is activated every time the system powers up, there are no additional confiigurations that should be done in the SDK. The same stands for changing LP clocks from RCX and XTAL32 via that #define the device will be automatically be configured and enable the proper oscillator via the SDK.
谢谢mt_dialog.
Hi Max,
the basic source of my development is also the ble_app_sleepmode reference design.
也许你有同样的问题,我也有了。
in the function void user_app_adv_start it is written : arch_set_deep_sleep() !
This is wrong, if you are working with extended sleep mode.
然后你必须更改为ARCH_SET_EXTEDDE_SLEEP()
Cost me 2 days, because in sleepmode the debugger function is limited.
Have a nice days
欢呼Siegmar.
Thanks Siegmar. I'll stay clear of deep sleep mode.
最大限度
公吨,
我终于得到了这一切。正如您所说,RCX20振荡器正常工作,我正在通过外部MCU切换P0_7的中断和回调。我发现的是app_easy_wakeup_set的设置中的错误。我从这个例子中复制了回调,并没有将其更改为我的例程,从而导致故障。我在原来的帖子中纠正了这一点,所以不会被视为看这个的其他人的榜样。
So we're good on this issue and you can close this topic. Thanks again for your usual good support.
最大限度
嗨max44,
Thanks for letting us know, always a pleasure.
Best Regards MT_dialog