[sdk5]problem about ext_sleep

32 posts / 0 new
最后一篇
kurbylee.
Offline
最后一次露面:3年6个月前
加入:2014-11-05 09:10
[sdk5]problem about ext_sleep

背景
1>项目名称:项目\ target_apps \ ble_examples \ ble_app_profile
2> #undef cfg_development_debug在da1458x_config_basic.h中
3>为了简化问题,评论行://#在user_profiles_config.h中包含“custs1.h”;
4>change value of app_default_sleep_mode to ARCH_EXT_SLEEP_ON in user_config.h
const static sleep_state_t app_default_sleep_mode = arch_ext_sleep_on;
5>编译并刻录到外部闪光灯;

Result:
1>手机无法扫描除电源DA外的DA;
2>After powered DA,I scan use phone as soon as quick,I will find DA,but connect fail; and can't scan DA any more except reset DA;

背景2:
基于上面的背景,打开看门狗,并在init中切换一个LED,我发现芯片将再次重置,所以手机将永远
扫描DA但连接失败。

我如何正确使用Arch_ext_sleep_on ??

关键词:
Device:
mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
Hi kurbylee,

Hi kurbylee,

我测试了你的设置,它似乎工作正常。我想你正在使用智能片段燃烧你的spi,你可以让你的设备从智能片段引出时启动吗?刻录闪光后,您可以重置电路板,以便引导加载程序从SPI运行和启动?通过将App_default_sleep_mode设置为Arch_ext_sleep_on足以将您的设备设置为扩展睡眠状态。当您不使用睡眠模式时,您是否能够正确地查看您的设备?

谢谢mt_dialog.

kurbylee.
Offline
最后一次露面:3年6个月前
加入:2014-11-05 09:10
嗨,mt_dialog

嗨,mt_dialog
1>是,我使用智能片段(Ver 3.9)将BLE_APP_PROFILE_580.HEX刻录为SPI,SDK Ver是DA1458x_sdk_5.0.3
2>我没有使用bootloader(secondery bootloader.hex),只需刻录ble_app_profile_580.hex使用smartsnippert并使其启动;我可以看到添加的可引导标志(8bytes以7050开头)
3>After burn , I always reboot the board by repower;
4>如果我将app_default_sleep_mode更改为arch_ext_sleep_off,它将非常好;
5>when I use sdk3.0.8,no problem occured,whether define/undef CFG_EXT_SLEEP

ps:I open the same project inDA1458x_SDK_5.0.2.1,and then get same result as in sdk5.3:(
ths kurbylee

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
Hi kurbylee,

Hi kurbylee,

I tested your setup again with a fresh 5.0.3 SDK and burn the image to the flash, it booted normally in reset and by removing the power. Are you able to donwload code by using keil, if yes is the device advertising as it should be ?

谢谢mt_dialog.

kurbylee.
Offline
最后一次露面:3年6个月前
加入:2014-11-05 09:10
谢谢mt_dialog.for your

谢谢mt_dialog.for your information.
但我没有解决这个问题:
我刻录了App_default_sleep_mode = Arch_Sleep_off的App Hex 3.9,我可以获得预期的结果,DA运行正常和Android手机可以扫描/连接/访问CHAR IT;
如果我更改app_default_sleep_mode = arch_ext_sleep_on,我只能在da powering的时间扫描da.and,然后手机永远不会找到da;

今天,我做了一个Anthor测试,我在main_func中添加LED切换:(P07连接LED)
1> app_default_sleep_mode = ash_config.h中的Arch_sleep_off.h
#undef CFG_DEVELOPMENT_DEBUG
#define CFG_WDOG in da1458x_config_basic.h (for more tests:))
2>在Arch_Main.c:
int main_func(void)
{
sleep_mode_t sleep_mode;
system_init();
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_7, OUTPUT, PID_GPIO, false );
而(1)
{
uint32_t i;
........................
if (((!BLE_APP_PRESENT) && (check_gtl_state())) ||
(BLE_APP_PRESENT))
{
gpio_setactive(gpio_port_0,gpio_pin_7);
i=0xfffff;
(i)我 - ;
//Disable the interrupts
GLOBAL_INT_STOP();
......................
......................
......................
gpio_setinactive(gpio_port_0,gpio_pin_7);
i=0xfffff;
(i)我 - ;
global_int_start();
}
.....
}
3>现在,我可以看到LED是闪烁,手机无法扫描它(app_default_sleep_mode = arch_sleep_off)

4>如果我制作app_default_sleep_mode = arch_ext_sleep_on,则手机将扫描并立即连接;

所以我与结果混淆了:
当我添加LED切换时,da与app_default_sleep_mode = ARCH_EXT_SLEEP_ON正常;(由于WDOG,它会在几秒钟后断开连接)
when I remove led toggle,DA is normal with app_default_sleep_mode=ARCH_SLEEP_OFF;

我认为有一个与计时器/ inteval相关的strick ... for set app_default_sleep_mode,但我找不到它:(

另一个信息:当我联系WDOG时,LED将闪烁5次,然后用app_default_sleep_mode = arch_ext_sleep_on保持灯

Another infor: By toggle led, I found that the app into infinit loop while(!ble_deep_sleep_stat_getf());====>in func sleep_mode_t rwip_sleep(void)

kurbylee.
Offline
最后一次露面:3年6个月前
加入:2014-11-05 09:10
Compared sdk5.03 and sdk3.0.8

Compared sdk5.03 and sdk3.0.8 files one by one, finally I found the culprit.
刚刚chanceword16(rf_enable_config13_reg,pref_rf_enable_config13_reg);
to SetWord16(RF_ENABLE_CONFIG13_REG, 0);
在Func rf_nfm_disable,
Everything come back to OK.

GGOTTA.
Offline
最后一次露面:10个月前1年
加入:2016-02-20 20:10
Dear Dialog team,

Dear Dialog team,
Can you explain how does it effects? What is correct?

Sprhawk.
Offline
最后一次露面:3 years 1 month ago
加入:2016-03-03 17:25
你确定这是

你确定这是reason of your question ?

I encountered the exact problem of yours.

我搜索了,rf_nfm_disable叫做,所以我认为这不是原因。

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
嗨ggotta,

嗨ggotta,

你能解释你的问题吗?在SDK 5中,如果要在睡眠模式下启用580,您所要做的就是将默认睡眠模式设置为Arch_ext_sleep_on。RF_NFM_DISABLE与近场模式操作有关,而不是睡眠操作。默认情况下,该函数不会在SDK中调用,仅为API禁用近场模式如果启用。

谢谢mt_dialog.

GGOTTA.
Offline
最后一次露面:10个月前1年
加入:2016-02-20 20:10
Hi,

Hi,
Thanks for the details.
我启用了扩展睡眠模式并闪烁DA。之后我无法通过JTAG连接。但后来我经历了一些答案,我找到了解决方案。它现在正在运作。
-gotta

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
Hi Ggotta,

Hi Ggotta,

我遇到和你同样的问题,使EXT_SLE之后EP_ON, my phone can't scan the DA now except power on DA time.

你最终如何解决问题?只有改变是真的:
刚刚chanceword16(rf_enable_config13_reg,pref_rf_enable_config13_reg);
to SetWord16(RF_ENABLE_CONFIG13_REG, 0);
在Func rf_nfm_disable.

Or other time setting is also necessary?

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
嗨smdzjl007,

嗨smdzjl007,

As mentioned above in the previous comment, the rf_nfm_disable doesn't have to do with the sleep but with the near field mode which is disabled by default. In order to put the 580 in sleep mode only the app_default_sleep_mode = ARCH_EXT_SLEEP_ON; is enough to put the device in sleep mode. What is the SDK that you are using, and are you experincing this on a dev kit or on a custom board ? If you are able to scan the device only for a couple of seconds, then either something is wrong with your low power clock or the debuuger stays attached to your device and prevents it from going to sleep if you are using an SDK prior to the SDK 5.0.4.

谢谢mt_dialog.

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
亲爱的mt_dialog团队,

亲爱的mt_dialog团队,

Thanks for your help. Yes, I do find out that modification within rf_nfm_disable function doesn't work at all. I am using SDK 5.0.3. How to locate the problem is related with low power clock or other reason? Should I upgrade to SDK 5.0.4?

另一个问题,da14580输入到睡眠模式后,控制醒来的定时器设置从睡眠中?控制持续时间的计时器是什么?

谢谢,最好的问候,

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
Hi smdzji007,

Hi smdzji007,

The rf_nfm_disable() function doesn't have to do anything with the sleep, if you move to the new SDK 5.0.4 the debugger isn't disabled during sleep so your device should continue advertise even if the debugger stays attached. If by moving into the new SDK doesn't help and you have a custom board check the setting of your LP clock should be either XTAL or RCX, if you are operating under buck mode and you switch to RCX and then you are able to see advertising, then your problem is the external XTAL32 that you have on your custom board.

SDK照顾设备将留在睡眠模式和何时醒来的时间,您所要做的就是设置广告和连接间隔,SDK将照顾其余的并配置系统按时唤醒和睡觉也是如此。

谢谢mt_dialog.

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
谢谢,MT_Dialog团队,非常

谢谢,MT_Dialog团队,非常timely feedback!

I tried to modify user_config.h for advertising and connection intervals as below, actual user_connection_param_conf is not changed:

static const struct advertise_configuration user_adv_conf = {
.ddr_src = gapm_public_addr,
.renew_dur = 0,
.ddr = {0x1,0x2,0x3,0x4,0x5,0x6},
.intv_min = 1000, // 625 ms (1000*0.625ms)
.intv_max = 2000, // 1250 ms (2000*0.625ms)
.channel_map = 0x7,
.mode = gap_gen_discoverable,
.adv_filt_policy = ADV_ALLOW_SCAN_ANY_CON_ANY,
.peer_addr = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6},
.peer_addr_type = 0,
};

static const struct connection_param_configuration user_connection_param_conf = {
.intv_min = MS_TO_DOUBLESLOTS(20),
.intv_max = ms_to_doubleslots(100),
.latency = 0,
.time_out = MS_TO_TIMERUNITS(125),
.ce_len_min = MS_TO_DOUBLESLOTS(0),
.ce_len_max = MS_TO_DOUBLESLOTS(0),
};

But the test result is still failed, the device can broadcast BLE advertisement message for very short time, then sleep and my smartphone can't scan the device anymore.

我应该修改其他内容,以使其睡眠/唤醒作为正常可穿戴设备?

谢谢和最好的问候

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
Hi smdzj007,

Hi smdzj007,

I would suggest not to modify anything (in order to verify that the reason for the 580 not advertising is not the fw), just take ble example from the 5.0.4 as is and run it to sleep mode (const static sleep_state_t app_default_sleep_mode = ARCH_EXT_SLEEP_ON;) in the user_config.h file also run the same example with const static sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF; and check if you do that is the device advertising and if it does you will have to set the sleeping mode always to off (ARCH_SLEEP_OFF). Do the above and let me know. Also please let me know if you are using a custom board or a dev kit and if you are using an external XTAL or you are operating with the RCX.

谢谢mt_dialog.

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
Thanks, MT_Dialog team!

Thanks, MT_Dialog team!

I upload my .hex file to other dialog support engineer, he see the same result as me.
https://support.dialog-semicondiondiondum/smartsnippets-spi-flash-program ...

He is using 580 dev kit pro. My design is also use dialog reference design with external XTAL clock. It works fine if switch off sleep.

Anyway, I will try again to download 5.0.4 sdk example to see any difference or not.

In the meanwhile, can you confirm my previous question about advertising and connection intervals adjustment? Are those 2 structures correct? Is my interval setting valid?

谢谢和最好的问候

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
嗨mt_dialog团队,

嗨mt_dialog团队,

After checking with previous colleague, he told me that our design is based on dialog wechat sdk reference design:
https://support.dialog-semicondiondiondum/connectivity/reference-designs?...

我试图下载微信SDK参考设计并将其运行到睡眠模式(const static sleep_state_t app_default_sleep_mode = Arch_ext_sleep_mode = Arch_ext_sleep_on;)。问题与我的设备睡眠相同,无法通过智能手机应用程序:Airsyncdebugger发现

这里有两个问题:
- 是否测试了延长睡眠模式测试的微信SDK参考设计?
- how to replace wechat SDK reference design used dialog SDK to 5.0.4 standard SDK?

谢谢,最好的问候,

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
嗨smdzjl007,

嗨smdzjl007,

- 是的,在延长睡眠模式下测试微信经运行,并且当设备处于睡眠模式时,我也能够看到广告字符串。

——我不问题,你的意思是如何replace the fw ? You can run directly one of the SDK examples via JTAG or you can download the .hex file of the examples via UART or if you have a flash, you can burn the flash and upon power up the 580 will download the code from the flash.

谢谢mt_dialog.

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
嗨mt_dialog团队,

嗨mt_dialog团队,

问题来自于:近期11.15年11月15日,X XDK版本X释放了,最近,如果我需要将微信的参考设计SDK源升级为5.0.4 SDK我应该做什么程序?

谢谢,最好的问候,

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
Hi smdzji007,

Hi smdzji007,

根据FW所在的位置,如果您使用的fW是由对话框提供的WeChat,则应编译代码并将其下载到您的设备。如果设备使用闪存或EEPROM内存以加载FW,可以通过JTAG或VIA UART通过智能片段工具擦除和销售设备(取决于设备可用的接口)。如果在OTP中刻录微信燃烧,您不会能够更新OTP,因为您只能编程一次。您还可以通过直接通过Keil和JTAG接口下载新FW来测试新源代码(再次如果在您的设备上使用此界面,您也可以在该案例中调试代码)也可以下载代码通过智能片段工具通过UART的Sysram。

谢谢mt_dialog.

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
亲爱的mt_dialog,

亲爱的mt_dialog,

Today I ask my colleague to measure clock output signals. You can find attached 3 jpg.
If disable sleep, we can measure both 32KHz and 16MHz clock: 32K_withoutsleep.jpg and 16M_withoutsleep.jpg
If enable sleep, only can see 32KHz signal:32K_withsleep.jpg

I am using SDK5.0.4, the ble_app_sleepmode from SDK example folder. According to example code, the wakeup duration is 0.5s, so it should be very quick. But my test result looks that the 14580 failed to wakup and I can't scan the 14580 device from my smartphone

你能帮助暗示更麻烦的射击吗?

BTW,应该在睡眠前/之后配置clk_16m_reg作为xtal16_bias_sh_enable寄存器吗?

谢谢和最好的问候

附件:
mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
Hi smdzji007,

Hi smdzji007,

The ble_app_sleepmode falls to permanent sleep after a specific period of time (a few seconds) and the XTAL16 is disabled when sleep is enabled, you can try using a another project that doesn't sleep constantly but wakes up in predefined periods in order to advertise and check again. You dont have to configure the CLK_16M_REG explictly, the SDK will take care of that in the periph_init() function.

此外,特定项目也实现了按钮按下,当按下设备唤醒并继续宣传,必须尝试按下该按钮以唤醒设备。

Also please dont post questions in irrelevant topics, you can always create a new thread if theres any follow up question.

谢谢mt_dialog.

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
Hi MT_dialog,

Hi MT_dialog,

如果确认BLE_APP_SLEEPMODE行为在我的电路板上是正确的,那么我应该在14580进入延伸或深睡眠后启用自动唤醒添加一个XTL32定时器回拨功能或还有什么?我应该使用哪个示例项目参考?

The reason for me to post question here is because I found my problem is relevant with current thread topic, and I can't find where is the button to create new thread. If my posting cause any in-convenience to you, I need say apology to you.

谢谢,最好的问候,

Qinjiny_Dialog
Offline
最后一次露面:2周2天前
职员
加入:2016-11-01 05:47
嗨smdzjl007,

嗨smdzjl007,

You could try functionapp_easy_timer.if the sleep time you specify is not too long(like under 5min)

布罗尔,

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
谢谢你的反馈,Qinjiny

谢谢你的反馈,Qinjinyfrom Dialog team,

正如以前的支持工程师所说,启用睡眠时禁用XTAL16时钟,App_easy_timer是否可以正常工作?如果我写一个回拨函数,请通过将呼叫回函数(如下)启用XTAL32时钟?

static const struct arch_main_loop_callbacks user_app_main_loop_callbacks = {
.app_before_sleep = my_app_enable_xtal32_clock,
.app_resume_from_sleep = my_app_disable_XTAL32_clock,
};

SMDZJL.007
Offline
最后一次露面:3 years 10 months ago
加入:2015-08-04 15:07
嗨mt_dialog,

嗨mt_dialog,

我重新研究BLE_APP_SLEEPMODE示例,并在DA1458x_config_Advance.h中找到以下定义

/ **************************************************************************************************************** /
/* Wakeup from external processor running host application. */
/ **************************************************************************************************************** /
#undef cfg_external_wakeup.

/ **************************************************************************************************************** /
/ *当消息发送到GTL * /时,唤醒外部处理器
/ **************************************************************************************************************** /
#undef cfg_wakeup_ext_processor.

Not sure whether it is aligned with your previous answer that the ble_app_sleepmode fall into permanent sleep until external button press trigger wake up. So, how this example code to undefine the external wake up but using external wake up?

Confusing for me

此致,
SMDZJL.

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
嗨smdzjl007,

嗨smdzjl007,

您在那里看到的定义与BLE_APP_SLEEPMODE项目无关,但在580以完全嵌入模式(由SDK定义)时,使用外部唤醒。如果您有兴趣查看指示Pargulullar项目的代码,您可以检查以下内容:

  • user_app_adv_start() -> a ke_timer is started with adv_data_update_timer_cb() as a handler to execute when elapsed.
  • When time elapses adv_data_update_timer_cb() executes and stops the advertising procedure.
  • 当广告过程停止时,user_app_adv_undirect_complete()处理程序被调用。
  • In the user_app_adv_undirect_complete() the functions arch_ble_ext_wakeup_on() is called in order to prevent the waking up of the 580 in steady intervals and the app_button_enable() sets the wakeup timer and the corresponding GPIO that is used for waking up as well as the corresponding callbacks for the waking up events.

谢谢mt_dialog.

梁云浩
Offline
最后一次露面:3年2个月前
加入:2016-03-05 13:38
嗨mt_dialog,

嗨mt_dialog,

Now I use Da14580 pro kit, and I set the app_default_sleep_mode to ARCH_SLEEP_OFF. It can work well when I burned hex file to SPI falsh, press reset button and pull the daughter board away from mother board.(It's powered by external battery.) It can be scanned from my cellphone. But when I set app_default_sleep_mode to ARCH_EXT_SLEEP_ON, it cannot be scanned from my phone. Does any else code I have to set? Which oscilator does the chip use when it enter the sleep mode? Thanks.

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
嗨梁云浩,

嗨梁云浩,

Please dont post questions in irrelevant topics, you can always create a new thread.

关于您的问题,尝试直接从Keil运行项目,并在延长睡眠状态并检查您是否能够查看您的设备广告,也尝试使用SDK示例进行操作并检查。当设备处于睡眠模式时,使用LP时钟,这意味着设备与外部XTal32或使用RCX操作,可以从DA1458x_config_Advanced.h文件中的CFG_LP_CLK定义配置此选项。

谢谢mt_dialog.

zhounaichun
Offline
最后一次露面:3年4个月前
加入:2017-07-17 02:54
那是工作!

那是工作!
我的问题:当我设置扩展睡眠模式时,我的手机无法连接到我的BLE设备,但如果我设置sleep_mode = arch_sleep_off,则是正常的。然后我将cfg_lp_clk(da458x_config_advance.h)的值从lp_clk_xxtal32更改为lp_clk_rcx20,即确定。
但我有另一个问题,即当我将睡眠模式设置为深睡眠时,我的手机就找不到BLE设备。
如果有人能告诉我为什么?

SDK:5.0.3 5.0.4
device:not Unofficial device

mt_dialog.
Offline
最后一次露面:2 months 1 week ago
职员
加入:2015-06-08 11:34
Hi zhounaichun,

Hi zhounaichun,

嗯,如果您正在开发模式和您的arch_deep_sleep_on,并且您也将内存配置更改为cfg_mem_map_deep_sleep(undefine cfg_mem_map_ext_sleep并设置cfg_mem_map_deep_sleep),那么您应该能够在深度睡眠模式下测试FW。但是要看到设备的适当功耗,您将不得不用FW刻录OTP,因此在每个唤醒中,图像将从OTP复制到Sysram,因为在深度睡眠中,Sysram将关闭。

谢谢mt_dialog.