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>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>Phone will cann't scan the DA except just at power 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,我发现芯片将再次重置,所以手机将永远
scan DA but connect failed.
我如何正确使用Arch_ext_sleep_on ??
关键词:
设备:
嗨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
嗨,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>烧伤后,我总是通过重力重新启动董事会;
4>如果我将app_default_sleep_mode更改为arch_ext_sleep_off,它将非常好;
5>当我使用SDK3.0.8时,没有问题,无论是定义/ 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
嗨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 ?
Thanks MT_dialog
谢谢mt_dialog以获取您的信息。
但我没有解决这个问题:
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在da1458x_config_basic.h(有关更多测试:))
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 );
while(1)
{
uint32_t i;
........................
if(((!ble_app_present)&&(check_gtl_state()))||
(BLE_APP_PRESENT))
{
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>现在,我可以看到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)
当我删除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:(
另一个信息:当我联系WDOG时,LED将闪烁5次,然后用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.8files one by one, finally I found the culprit.
just chang SetWord16(RF_ENABLE_CONFIG13_REG, PREF_RF_ENABLE_CONFIG13_REG);
到setword16(rf_enable_config13_reg,0);
在Func rf_nfm_disable,
一切都回来了。
亲爱的对话团队,
Can you explain how does it effects? What is correct?
你确定这是你问题的原因吗?
我遇到了你的确切问题。
我搜索了,rf_nfm_disable叫做,所以我认为这不是原因。
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
Hi,
谢谢你的细节。
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.
-gotta
嗨ggotta,
我遇到和你同样的问题,使EXT_SLE之后EP_ON, my phone can't scan the DA now except power on DA time.
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);
在Func rf_nfm_disable.
或其他时间设置也是必要的?
Hi 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.
Thanks MT_dialog
亲爱的mt_dialog团队,
谢谢你的帮助。是的,我确实发现rf_nfm_disable函数中的修改根本不起作用。我正在使用SDK 5.0.3。如何定位问题与低功率时钟或其他原因有关?我应该升级到SDK 5.0.4吗?
另一个问题,da14580输入到睡眠模式后,控制醒来的定时器设置从睡眠中?控制持续时间的计时器是什么?
谢谢,最好的问候,
嗨smdzji007,
RF_NFM_Disable()函数不必用睡眠做任何事情,如果转移到新的SDK 5.0.4,则在睡眠期间,调试器未禁用,因此即使调试器停留也应继续通告。如果通过进入新的SDK没有帮助,并且您有一个自定义板检查LP时钟的设置应为XTAL或RCX,如果您在降压模式下运行,请切换到RCX,然后您就可以看到广告,那么您的问题是您在自定义板上的外部XTAL32。
SDK照顾设备将留在睡眠模式和何时醒来的时间,您所要做的就是设置广告和连接间隔,SDK将照顾其余的并配置系统按时唤醒和睡觉也是如此。
Thanks MT_dialog
谢谢,MT_Dialog团队,非常及时反馈!
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 _configuration user_adv_conf = {
.addr_src = GAPM_PUBLIC_ADDR,
.renew_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),
};
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.
我应该修改其他内容,以使其睡眠/唤醒作为正常可穿戴设备?
谢谢和最好的问候
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.
Thanks MT_dialog
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?
谢谢和最好的问候
Hi MT_Dialog team,
After checking with previous colleague, he told me that our design is based on dialog wechat sdk reference design:
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?
- 如何将WeChat SDK参考设计使用Dialog SDK替换为5.0.4标准SDK?
谢谢,最好的问候,
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?
谢谢,最好的问候,
嗨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,
Today I ask my colleague to measure clock output signals. You can find attached 3 jpg.
如果禁用睡眠,我们可以测量32khz和16mhz时钟:32k_withoutsleep.jpg和16m_withoutsleep.jpg
If enable sleep, only can see 32KHz signal:32K_withsleep.jpg
我正在使用sdk5.0.4,从SDK示例文件夹中使用BLE_APP_SLEEPMODE。根据示例代码,唤醒持续时间为0.5s,因此应该非常快。但我的测试结果看起来看起来14580无法摆动,我无法从智能手机扫描14580设备
你能帮助暗示更麻烦的射击吗?
BTW,应该在睡眠前/之后配置clk_16m_reg作为xtal16_bias_sh_enable寄存器吗?
谢谢和最好的问候
嗨smdzji007,
BLE_APP_SLEEPMODE在特定时间段内(几秒钟)后(几秒钟)和XTAL16启用时禁用XTAL16后,您可以尝试使用不断睡眠的另一个项目,但在预定义的时间内唤醒以进行广告再次检查。您不必配置CLK_16M_REG默认,SDK将在PERIPH_INIT()函数中处理该功能。
此外,特定项目也实现了按钮按下,当按下设备唤醒并继续宣传,必须尝试按下该按钮以唤醒设备。
另外请勿在无关主题中发布问题,如果有任何后续问题,您可以随时创建一个新的线程。
Thanks MT_dialog
嗨mt_dialog,
如果确认BLE_APP_SLEEPMODE行为在我的电路板上是正确的,那么我应该在14580进入延伸或深睡眠后启用自动唤醒添加一个XTL32定时器回拨功能或还有什么?我应该使用哪个示例项目参考?
我在这里发布问题的原因是因为我发现我的问题与当前的线程主题相关,我找不到创建新线程的按钮。如果我的发布给您带来任何方便,我需要向您说道歉。
谢谢,最好的问候,
Hi smdzjl007,
You could try functionapp_easy_timer如果您指定的睡眠时间不是太长(如5分钟)
布罗尔,
谢谢你的反馈,Qinjinyfrom Dialog team,
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,
};
嗨mt_dialog,
I re-study the ble_app_sleepmode example and found below definition within da1458x_config_advance.h
/****************************************************************************************************************/
/ *从外部处理器运行主机应用程序的唤醒。* /
/****************************************************************************************************************/
#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?
对我令人困惑
Best regards,
smdzjl
Hi smdzjl007,
您在那里看到的定义与BLE_APP_SLEEPMODE项目无关,但在580以完全嵌入模式(由SDK定义)时,使用外部唤醒。如果您有兴趣查看指示Pargulullar项目的代码,您可以检查以下内容:
Thanks MT_dialog
嗨mt_dialog,
现在我使用da14580 pro套件,我将app_default_sleep_mode设置为arch_sleep_off。当我将十六进制文件刻录到SPI FALSH时,它可以很好地工作,按RESET按钮并将子板拉离母板。(它由外部电池供电。)可以从我的手机扫描。但是,当我将App_default_sleep_mode设置为Arch_ext_sleep_on时,无法从手机扫描。我是否必须设置任何其他代码?哪个辅导器在进入睡眠模式时使用芯片使用?谢谢。
嗨梁云浩,
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定义配置此选项。
Thanks MT_dialog
那是工作!
我的问题:当我设置扩展睡眠模式时,我的手机无法连接到我的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
设备:不是非官方设备
嗨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