Background
1>project name: projects\target_apps\ble_examples\ble_app_profile
2>#undef CFG_DEVELOPMENT_DEBUG in da1458x_config_basic.h
3>for simplify the problem,comment the line ://#include "custs1.h" in user_profiles_config.h;
4> 在user\u config.h中将app\u default\u sleep\u mode的值更改为ARCH\u EXT\u sleep\u ON
const static sleep_state_t app_default_sleep_mode=ARCH_EXT_SLEEP_ON;
5>compile and burn into external flash;
结果:
1>Phone will cann't scan the DA except just at power DA;
2> DA通电后,我尽快扫描使用手机,我会找到DA,但连接失败;除重置DA外,不能再扫描DA;
背景2:
Base on Background above,open watchdog, and toggle a led in init, I found that the chip will reset again and again ,so phone will always
scan DA but connect failed.
how I can use ARCH_EXT_SLEEP_ON correctly??
Keywords:
设备:
嗨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
HI,MT_dialog
1> Yes, I use Smart Snippets(ver 3.9) to burn ble_app_profile_580.hex into SPI,SDK ver is DA1458x_SDK_5.0.3
2>I had not use bootloader(secondery bootloader.hex),just burn ble_app_profile_580.hex use smartsnippert and make bootable; I can see the bootable flag added(8bytes begin with 7050)
3>烧伤后,我总是通过重力重新启动董事会;
4>If I change app_default_sleep_mode to ARCH_EXT_SLEEP_OFF,It will works very well;
5>当我使用SDK3.0.8时,没有问题,无论是定义/ undef cfg_ext_sleep
ps:我在DA1458X\ U SDK\ U 5.0.2.1中打开相同的项目,然后得到与sdk5.3中相同的结果:(
库比利
嗨Kurbylee,
我用一个新的5.0.3SDK再次测试了您的设置,并将映像烧录到闪存中,它在重置和断电时正常启动。你能用keil加载代码吗?如果是的话,这个设备应该是广告吗?
Thanks MT_dialog
谢谢mt_dialog以获取您的信息。
But I have not resolved the problem:
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;
Today , I do anthor test,I add a led toggle in main_func:(P07 is connected a led)
1>app_default_sleep_mode=ARCH_SLEEP_OFF in user_config.h
#undef CFG\开发\调试
#define cfg_wdog在da1458x_config_basic.h(有关更多测试:))
2>in arch_main.c:
int main_func(void)
{
sleep_mode_t sleep_mode;
system_init();
GPIO\ U配置引脚(GPIO\ U端口\ U 0,GPIO\ U引脚\ U 7,输出,PID\ GPIO,false);
while(1)
{
uint32_t i;
........................
if(((!ble_app_present)&&(check_gtl_state()))||
(存在)
{
GPIO_SetActive(GPIO_PORT_0, GPIO_PIN_7);
i=0xfffff;
while (i)i--;
//禁用中断
global_int_stop();
......................
......................
......................
GPIO_SetInactive(GPIO_PORT_0, GPIO_PIN_7);
i=0xfffff;
while (i)i--;
GLOBAL_INT_START();
}
.....
}
3>now,I can see the led is shinning,and phone will cann't scan it(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)
当我删除LED切换时,DA与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:(
another information : when I undef wdog, the led will shinning 5 times and then keep light with app_default_sleep_mode=ARCH_EXT_SLEEP_ON
另一个信息:通过切换LED,我发现应用程序进入INFINIT循环(!BLE_DEEP_SLEEP_STAT_GETF()); ====>在func sleep_mode_t rwip_sleep(void)中
把sdk5.03和sdk3.0.8文件逐一比对,终于找到了罪魁祸首。
just chang SetWord16(RF_ENABLE_CONFIG13_REG, PREF_RF_ENABLE_CONFIG13_REG);
到setword16(rf_enable_config13_reg,0);
in func rf_nfm_disable,
一切都回来了。
亲爱的对话团队,
你能解释一下它的作用吗?什么是正确的?
你确定这是你问题的原因吗?
我遇到了你的确切问题。
我的年代earched though, the rf_nfm_disable is called nowhere, so I think it is not the reason .
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
你好,
谢谢你的细节。
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.
-必须
嗨ggotta,
我遇到了和你一样的问题,在启用EXT\u SLEEP\u ON后,我的手机现在无法扫描DA,除非打开DA时间。
How you solve the issue finally? Is it true to only change:
just chang SetWord16(RF_ENABLE_CONFIG13_REG, PREF_RF_ENABLE_CONFIG13_REG);
到setword16(rf_enable_config13_reg,0);
in func rf_nfm_disable
或其他时间设置也是必要的?
Hi smdzjl007,
如上一条评论中所述,rf\u nfm\u disable与睡眠无关,而是与默认禁用的近场模式有关。为了使580进入睡眠模式,只有app\u default\u sleep\u mode=ARCH\u EXT\u sleep\u ON;足以使设备进入睡眠模式。您正在使用的SDK是什么?您是在开发工具包还是在定制板上体验过这一点?如果您只能扫描设备几秒钟,则可能是低功耗时钟有问题,或者如果您使用的是SDK 5.0.4之前的SDK,则Debugger会一直连接到您的设备并阻止它进入睡眠状态。
Thanks MT_dialog
Dear MT_dialog team,
谢谢你的帮助。是的,我确实发现rf_nfm_disable函数中的修改根本不起作用。我正在使用SDK 5.0.3。如何定位问题与低功率时钟或其他原因有关?我应该升级到SDK 5.0.4吗?
Another question, after DA14580 enter to sleep mode, what timer setting to control the wake up from sleep? what timer to control wake up duration?
Thanks & Best regards,
嗨smdzji007,
RF_NFM_Disable()函数不必用睡眠做任何事情,如果转移到新的SDK 5.0.4,则在睡眠期间,调试器未禁用,因此即使调试器停留也应继续通告。如果通过进入新的SDK没有帮助,并且您有一个自定义板检查LP时钟的设置应为XTAL或RCX,如果您在降压模式下运行,请切换到RCX,然后您就可以看到广告,那么您的问题是您在自定义板上的外部XTAL32。
The SDK takes care of how long the device will stay in sleep mode and when to wake up, all you have to do is set the advertising and connection intervals and the SDK will take care of the rest and configure the system to wake up on time and sleep as well.
Thanks MT_dialog
谢谢,MT_Dialog团队,非常及时反馈!
我尝试修改user_config.h以进行广告和连接间隔,如下所示,实际的user_connection_param_conf没有更改:
static const struct _configuration user_adv_conf = {
.addr_src = GAPM_PUBLIC_ADDR,
.renew_dur=0,
.addr = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6},
.intv_min=1000,//625毫秒(1000*0.625毫秒)
.intv_max=2000,//1250毫秒(2000*0.625毫秒)
.channel_map = 0x7,
.mode = GAP_GEN_DISCOVERABLE,
。adv_filt_policy = adv_allow_scan_any_con_any,
.peer\u addr={0x1、0x2、0x3、0x4、0x5、0x6},
.peer\u addr\u 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\u len\u min=MS\u到\u双插槽(0),
.ce\u len\u max=MS\u到\u双插槽(0),
};
但是测试结果还是失败了,设备可以在很短的时间内播放可屏蔽的广告信息,然后睡眠,我的智能手机无法再扫描设备。
what else structure should I modify to make it sleep/wakeup as normal wearable device?
Thanks & Best regards
你好,smdzj007,
我建议不要修改任何东西(为了验证580没有发布广告的原因不是fw),只需从5.0.4原样中选取一个ble示例,并将其运行到睡眠模式(const static sleep\u state\u t app\u default\u sleep\u mode=ARCH\u EXT\u sleep\u ON;)在user\u config.h文件中也运行相同的示例,const static sleep\u state\u t app\u default\u sleep\u mode=ARCH\u sleep\u OFF;如果你这样做是设备广告,如果是,你将不得不设置睡眠模式总是关闭(拱门\睡眠\关闭)。做上面的事,让我知道。另外,请让我知道,如果您使用的是自定义板或开发工具包,如果您使用的是外部XTAL或您正在与RCX操作。
Thanks MT_dialog
谢谢,MTèu Dialog团队!
我上传我的.hex文件给其他对话框支持工程师,他看到的结果和我一样。
https://support.dialog-semiconductor.com/smartsnippets-spi-flash-program...
他正在使用580开发工具包专业版。我的设计也是使用对话框参考设计与外部XTAL时钟。如果关掉睡眠就可以了。
无论如何,我会再次尝试下载5.0.4SDK的例子,看看有没有区别。
同时,你能确认我之前关于广告和连接间隔调整的问题吗?这两种结构正确吗?我的间隔设置有效吗?
Thanks & Best regards
Hi MT_Dialog team,
在和以前的同事核实后,他告诉我我们的设计是基于dialog微信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
Two questions here:
- did wechat SDK reference design tested for extended sleep mode?
- 如何将WeChat SDK参考设计使用Dialog SDK替换为5.0.4标准SDK?
Thanks & Best regards,
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.
- 我没有得到这个问题,你是什么意思如何更换FW?您可以通过JTAG直接运行其中一个SDK示例,或者您可以通过UART下载示例的.hex文件,或者如果您有闪存,可以刻录闪光灯,电涌580将从闪存下载代码。
Thanks MT_dialog
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?
Thanks & Best regards,
嗨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
Dear MT_dialog,
今天我让我的同事测量时钟输出信号。你可以找到附件3 jpg。
如果禁用睡眠,我们可以测量32khz和16mhz时钟:32k_withoutsleep.jpg和16m_withoutsleep.jpg
如果启用睡眠,只能看到32KHzsignal:32K_withsleep.jpg
我正在使用sdk5.0.4,从SDK示例文件夹中使用BLE_APP_SLEEPMODE。根据示例代码,唤醒持续时间为0.5s,因此应该非常快。但我的测试结果看起来看起来14580无法摆动,我无法从智能手机扫描14580设备
Can you help to give hints for more trouble shooting?
BTW, should I config CLK_16M_REG as XTAL16_BIAS_SH_ENABLE register before/after sleep?
Thanks & Best regards
嗨smdzji007,
BLE_APP_SLEEPMODE在特定时间段内(几秒钟)后(几秒钟)和XTAL16启用时禁用XTAL16后,您可以尝试使用不断睡眠的另一个项目,但在预定义的时间内唤醒以进行广告再次检查。您不必配置CLK_16M_REG默认,SDK将在PERIPH_INIT()函数中处理该功能。
Also the specific project implements a button press that when pressed the device wakes up and continiues to advertise, have to tryied to press that button in order to wake up the device.
另外请勿在无关主题中发布问题,如果有任何后续问题,您可以随时创建一个新的线程。
Thanks MT_dialog
嗨mt_dialog,
Thanks to confirm ble_app_sleepmode behavior is correct in my board, so what should I do to enable automatic wake up after 14580 enter extended or deep sleep? To add one XTL32 timer call back function or what else? Which sample project should I use for reference?
我在这里发布问题的原因是因为我发现我的问题与当前的线程主题相关,我找不到创建新线程的按钮。如果我的发布给您带来任何方便,我需要向您说道歉。
Thanks & Best regards,
Hi smdzjl007,
你可以试试这个功能app_easy_timer如果您指定的睡眠时间不是太长(如5分钟)
BR,
感谢Dialog团队的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\u resume\u from\u sleep=我的\u app\u禁用\u XTAL32\u时钟,
};
Hi MT_Dialog,
I re-study the ble_app_sleepmode example and found below definition within da1458x_config_advance.h
/****************************************************************************************************************/
/ *从外部处理器运行主机应用程序的唤醒。* /
/****************************************************************************************************************/
#undef CFG_EXTERNAL_WAKEUP
/****************************************************************************************************************/
/* Wakeup external processor when a message is sent to GTL */
/****************************************************************************************************************/
#undef CFG_WAKEUP_EXT_PROCESSOR
不确定是否与您之前的答案一致,即ble\ U app\睡眠模式进入永久睡眠状态,直到按下外部按钮触发唤醒。那么,这个示例代码如何定义外部唤醒但使用外部唤醒?
对我令人困惑
Best regards,
smdzjl
Hi smdzjl007,
The definitions that you see there, has nothing to do with the ble_app_sleepmode project but with the external wake up when the 580 runs in fully embedded mode (defined by the SDK). If you are interested to check the code that dictates that particullar project you can check the following:
Thanks MT_dialog
Hi MT_Dialog,
现在我使用da14580 pro套件,我将app_default_sleep_mode设置为arch_sleep_off。当我将十六进制文件刻录到SPI FALSH时,它可以很好地工作,按RESET按钮并将子板拉离母板。(它由外部电池供电。)可以从我的手机扫描。但是,当我将App_default_sleep_mode设置为Arch_ext_sleep_on时,无法从手机扫描。我是否必须设置任何其他代码?哪个辅导器在进入睡眠模式时使用芯片使用?谢谢。
Hi Liang Yun Hao,
请不要在不相关的主题发布问题,你可以随时创建一个新的线程。
关于你的问题,尝试运行项目directly from keil with extended sleep on and check if you are able to see your device advertising, also try to do the same with an SDK example and check as well. When the device is in sleep mode the LP clock is used that means that the device operates either with the external XTAL32 or with the RCX, this option can be configured from the CFG_LP_CLK definition in the da1458x_config_advanced.h file.
Thanks MT_dialog
that's working!!!
my problem : when i set extended sleep mode,my phone can't connect to my ble device,but if i set sleep_mode=ARCH_SLEEP_OFF, it's normal. then i change the value of CFG_LP_CLK(da458x_config_advanced.h) from LP_CLK_XTAL32 to LP_CLK_RCX20,that‘s is ok.
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.
if anyone can tell me why?
SDK:5.0.3 5.0.4
设备:不是非官方设备
嗨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