[sdk5]problem about ext_sleep

32个帖子/ 0新
Last post
kurbylee.
离线
Last seen:3 years 6 months ago
加入:2014-11-05 09:10
[sdk5]problem about ext_sleep

Background
1>项目名称:项目\ target_apps \ ble_examples \ ble_app_profile
2> #undef cfg_development_debug在da1458x_config_basic.h中
3>for simplify the problem,comment the line ://#include "custs1.h" in user_profiles_config.h;
4>将app_default_sleep_mode的值更改为user_config.h中的Arch_ext_sleep_on
const static sleep_state_t app_default_sleep_mode = arch_ext_sleep_on;
5>编译并刻录到外部闪光灯;

结果:
1>Phone will cann't scan the DA except just at power DA;
2> Powered DA后,我一旦扫描使用手机,我会发现DA,但连接失败;除了重置da之外,无法扫描da;

Background 2:
基于上面的背景,打开看门狗,并在init中切换一个LED,我发现芯片将再次重置,所以手机将永远
scan DA but connect failed.

我如何正确使用Arch_ext_sleep_on ??

关键词:
Device:
MT_dialog
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
Hi kurbylee,

Hi kurbylee,

我已经测试了你的设置,它似乎工作好。我的年代uppose that you are using Smart Snippets to burn your SPI, do you make your device bootable when you are promted from Smart Snippets ? After burning the flash do you reset your board in order for the bootloader to run and boot from your SPI ? By setting the app_default_sleep_mode to ARCH_EXT_SLEEP_ON is enough to set your device to extended sleep. Are you able to see your device correctly when you dont use sleep mode?

Thanks MT_dialog

kurbylee.
离线
Last seen:3 years 6 months ago
加入: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:我打开同一个项目Inda1458x_sdk_5.0.2.1,然后在SDK5.3中获得相同的结果:(
kurbylee.

MT_dialog
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
Hi kurbylee,

Hi kurbylee,

我再次使用Fresh 5.0.3 SDK测试了您的设置并将图像刻录到闪光灯,它通常在重置时启动,并通过卸下电源。您是否能够使用keil,如果是的,请使用keil,如果是设备广告,那么它应该是什么?

Thanks MT_dialog

kurbylee.
离线
Last seen:3 years 6 months ago
加入:2014-11-05 09:10
谢谢mt_dialog为你的

谢谢mt_dialog为你的information.
但我没有解决这个问题:
I burn the app hex with complied with app_default_sleep_mode=ARCH_SLEEP_OFF by smartSnippets 3.9, I can get expected result that the DA is running normal and android phone can scan/connect/access char it ;
if I change app_default_sleep_mode=ARCH_EXT_SLEEP_ON, and I can scan DA once only at time of DA powering.and then phone will never find DA;

今天,我做了一个Anthor测试,我在main_func中添加LED切换:(P07连接LED)
1>app_default_sleep_mode=ARCH_SLEEP_OFF in user_config.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,输出,pid_gpio,false);
while(1)
{
uint32_t i;
........................
if (((!BLE_APP_PRESENT) && (check_gtl_state())) ||
(ble_app_present))
{
GPIO_SetActive(GPIO_PORT_0, GPIO_PIN_7);
我= 0xfffff;
while (i)i--;
//Disable the interrupts
GLOBAL_INT_STOP();
......................
......................
......................
GPIO_SetInactive(GPIO_PORT_0, GPIO_PIN_7);
我= 0xfffff;
while (i)i--;
GLOBAL_INT_START();
}
.....
}
3>现在,我可以看到LED是闪烁,手机无法扫描它(app_default_sleep_mode = arch_sleep_off)

4>if I make app_default_sleep_mode=ARCH_EXT_SLEEP_ON, phone will scan and connect it now;

So I'm confused with the result :
when I add led toggle,DA is normal with app_default_sleep_mode=ARCH_EXT_SLEEP_ON; (it will disconnect after some seconds because of WDOG)
when I remove led toggle,DA is normal with app_default_sleep_mode=ARCH_SLEEP_OFF;

I think there is a strick related with Timer/Inteval and so on... for set app_default_sleep_mode ,but I have not find it:(

另一个信息:当我联系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.
离线
Last seen:3 years 6 months ago
加入:2014-11-05 09:10
Compared sdk5.03 and sdk3.0.8

比较SDK5.03和SDK3.0.8文件,最后我找到了罪魁祸首。
just chang SetWord16(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
离线
Last seen:1 year 10 months ago
加入:2016-02-20 20:10
Dear Dialog team,

Dear Dialog team,
你能解释它是如何影响的吗?什么是正确的?

Sprhawk.
离线
Last seen:3年1个月前
加入:2016-03-03 17:25
你确定这是

你确定这是reason of your question ?

I encountered the exact problem of yours.

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

MT_dialog
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
Hi ggotta,

Hi ggotta,

Can you please explain what your problem is ? In the SDK 5 if you want to enable the 580 in sleep mode all you have to do is to set your default sleep mode to ARCH_EXT_SLEEP_ON. The rf_nfm_disable has to do with the near field mode operation and not the sleep operation. The function isn't invoked in the SDK by default its just the API for disabling the near field mode if enabled.

Thanks MT_dialog

ggotta
离线
Last seen:1 year 10 months ago
加入:2016-02-20 20:10
你好,

你好,
Thanks for the details.
I enabled extended sleep mode and flashed the DA. After that I was not able connect via JTAG. But later I have gone through some more answers I found the solution. It is working now.
- 盖特

smdzjl007
离线
Last seen:3 years 10 months ago
加入:2015-08-04 15:07
Hi Ggotta,

Hi Ggotta,

我与您遇到同样的问题,在启用EXT_SLEEP_ON之后,我的手机无法扫描DA,除了LIT时间的电源。

How you solve the issue finally? Is it true to only change:
just chang SetWord16(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
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
Hi smdzjl007,

Hi smdzjl007,

如上所述在上面的注释中,RF_NFM_DISABLE与睡眠不一致,但默认情况下禁用近场模式。为了仅在睡眠模式下放置580,app_default_sleep_mode = arch_ext_sleep_on;足以将设备放在睡眠模式下。您正在使用的SDK是什么,您是否在DEV套件上或在定制董事会上进行实验?如果您能够仅扫描该设备几秒钟,那么低功耗时钟或德国uguger留在您的设备上的禁止留下,如果您在SDK之前使用SDK,则防止其睡眠状态5.0.4。

Thanks MT_dialog

smdzjl007
离线
Last seen: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
离线
Last seen:2个月1周前
Staff
加入: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将照顾其余的并配置系统按时唤醒和睡觉也是如此。

Thanks MT_dialog

smdzjl007
离线
Last seen:3 years 10 months ago
加入:2015-08-04 15:07
谢谢,MT_Dialog团队,非常

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

我尝试修改user_config.h进行广告和连接间隔,如下所示,实际user_connection_param_conf未更改:

static const struct advertise_configuration user_adv_conf = {
.addr_src = GAPM_PUBLIC_ADDR,
.grenew_dur = 0,
.addr = {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),
};

但测试结果仍然失败,设备可以为非常短的时间播放BLE广告消息,然后睡眠,我的智能手机无法扫描设备。

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

谢谢和最好的问候

MT_dialog
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
嗨smdzj007,

嗨smdzj007,

我建议不要修改任何东西(以验证580不是广告的原因不是FW),只需从5.0.4那样拍摄示例并将其运行到睡眠模式(const static sleep_state_t app_default_sleep_mode = arch_ext_sleep_on;)在user_config.h文件中也使用const static sleep_state_t app_default_sleep_mode = Arch_sleep_off运行相同的示例;并检查您是否这样做是设备广告,如果您必须始终设置睡眠模式(Arch_sleep_off)。这样做,让我知道。另外,如果您使用自定义板或DEV套件,请告诉我,如果您使用的是外部XTAL,或者您使用RCX运行。

Thanks MT_dialog

smdzjl007
离线
Last seen:3 years 10 months ago
加入:2015-08-04 15:07
谢谢,MT_Dialog团队!

谢谢,MT_Dialog团队!

我将我的.hex文件上传到其他对话框支持工程师,他看到与我的结果相同。
https://support.dialog-semicondiondiondum/smartsnippets-spi-flash-program ...

他正在使用580 dev kit pro。我的设计也使用对话框参考设计与外部XTAL时钟。如果关闭睡眠,它可以正常工作。

无论如何,我会再次尝试下载5.0.4 sdk示例以查看任何区别。

与此同时,您可以确认我以前的关于广告和连接间隔调整的问题吗?这两个结构是否正确?我的间隔设置有效吗?

谢谢和最好的问候

smdzjl007
离线
Last seen:3 years 10 months ago
加入:2015-08-04 15:07
Hi MT_Dialog team,

Hi MT_Dialog team,

在与以前的同事进行检查后,他告诉我,我们的设计基于对话框SDK参考设计:
https://support.dialog-semiconductor.com/connectivity/reference-designs?...

I tried to download wechat sdk reference design 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. The problem is the same as mine, device sleep and can't be discovered by smart phone app: AirSyncDebugger

这里有两个问题:
- did wechat SDK reference design tested for extended sleep mode?
- how to replace wechat SDK reference design used dialog SDK to 5.0.4 standard SDK?

谢谢,最好的问候,

MT_dialog
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
Hi smdzjl007,

Hi smdzjl007,

- Yes, the wechat is tested to operate under extended sleep mode and i am also able to see the advertising string when the device is in sleep mode.

——我不问题,你的意思是如何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.

Thanks MT_dialog

smdzjl007
离线
Last seen:3 years 10 months ago
加入:2015-08-04 15:07
Hi MT_Dialog team,

Hi MT_Dialog team,

The question is coming from fact that: wechat reference design was released with 14580 SDK version x at Nov'15, as there is new 14580 sdk version 5.0.4 recently, if I need upgrade wechat reference design sdk source into 5.0.4 sdk, what procedure should I do?

谢谢,最好的问候,

MT_dialog
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
Hi smdzji007,

Hi smdzji007,

Depending on where the the fw is located and if the fw that you are using is the wechat as provided by dialog, you should compile the code and download it to your device. If the device is using a flash memory or an EEPROM memory in order to load the fw you can erase and reburn the device via the Smart Snippets tool, either via JTAG or via UART (depending on the interface your device has available). In case the wechat is burned in OTP you wont be able to update the OTP since you can only program it once. You can also test the new source code via downloading the new fw directly to the sysram via keil and the JTAG interface (again if this interface is available on your device, you can also debug the code in that case) also you can download code into the sysram via UART through the Smart Snippets tool.

Thanks MT_dialog

smdzjl007
离线
Last seen:3 years 10 months ago
加入:2015-08-04 15:07
Dear MT_dialog,

Dear MT_dialog,

今天我要求我的同事测量时钟输出信号。您可以找到附加的3 jpg。
If disable sleep, we can measure both 32KHz and 16MHz clock: 32K_withoutsleep.jpg and 16M_withoutsleep.jpg
如果启用睡眠,只能看到32kHz信号: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寄存器吗?

谢谢和最好的问候

Attachment:
MT_dialog
离线
Last seen:2个月1周前
Staff
加入: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.

Thanks MT_dialog

smdzjl007
离线
Last seen: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
离线
Last seen:2 weeks 2 days ago
Staff
加入:2016-11-01 05:47
Hi smdzjl007,

Hi smdzjl007,

你可以尝试职能app_easy_timerif the sleep time you specify is not too long(like under 5min)

布罗尔,

smdzjl007
离线
Last seen:3 years 10 months ago
加入:2015-08-04 15:07
谢谢你的反馈,Qinjiny

感谢您从对话小组的反馈,Qinjiny,

As previous support engineer said, the XTAL16 clock is disabled when sleeping is enabled, whether app_easy_timer can work normally? Should I write one call back function to enable XTAL32 clock by registering call back function like below?

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,
};

smdzjl007
离线
Last seen:3 years 10 months ago
加入:2015-08-04 15:07
嗨mt_dialog,

嗨mt_dialog,

I re-study the ble_app_sleepmode example and found below definition within da1458x_config_advance.h

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

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

不确定是否与先前的答案对齐,即BLE_APP_SLEEPMODE落入永久睡眠状态,直到外部按钮按触发唤醒。那么,这个示例代码如何拒绝外部唤醒,但使用外部唤醒?

Confusing for me

Best regards,
smdzjl

MT_dialog
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
Hi smdzjl007,

Hi smdzjl007,

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

  • user_app_adv_start() - >将ke_timer与Adv_Data_update_Timer_CB()作为处理程序启动,以便在经过时执行。
  • 当时间经过adv_data_update_timer_cb()执行并停止广告过程。
  • 当广告过程停止时,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.

Thanks MT_dialog

Liang Yun Hao
离线
Last seen: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
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
嗨梁云浩,

嗨梁云浩,

请不要在无关主题中发布问题,您可以始终创建一个新的线程。

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

Thanks MT_dialog

Zhounaichun
离线
Last seen: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,即确定。
but i have a another problem that is when i set the sleep mode to deep sleep my phone will not find the ble device.
如果有人能告诉我为什么?

SDK:5.0.3 5.0.4
device:not Unofficial device

MT_dialog
离线
Last seen:2个月1周前
Staff
加入:2015-06-08 11:34
Hi zhounaichun,

Hi zhounaichun,

Well, if you are under development mode and you 've set the ARCH_DEEP_SLEEP_ON and you ve also changed the memory configuration to CFG_MEM_MAP_DEEP_SLEEP (undefine CFG_MEM_MAP_EXT_SLEEP and set the CFG_MEM_MAP_DEEP_SLEEP) then you should be able to test the fw in deep sleep mode. But to see the proper power consumption of the device you will have to burn the OTP with your fw, so in every wake up the image will be copied from the OTP to the sysram, since in deep sleep the sysram will be shut down.

Thanks MT_dialog