嗨,对话小组,
I am working on a custom board with the 'ble_app_nonconn' example in the misc folder in SDk folder. My project requirement is as follows.
- 每当没有BLE或其他活动时都会进入睡眠模式(ARCH_EXT_SLEEP_ON)。
- When external sensor gives data, dialog chip will wakeup on pin change interrupt and start decoding the data from the sensor using timer 0.
- 解码数据并在播发字符串上更新它。
- 开始广告使用“user_app_adv_start()的一个d start an easy timer that will expire in 6 seconds. Till then the advertisement data is advertised. When app_easy timer expires, stop the advertisement using 'app_easy_gap_advertise_stop()' and this will put the chip to sleep.
- 在停止广告之前,将启用唤醒引脚以在下一个数据准备就绪时从睡眠中唤醒芯片。
我已设法在调试模式下完成上述步骤。当我在RAM上运行程序并断开调试器的连接时,电流消耗减少到2.4µA.当外部中断发生时,电流上升到50左右µA和在2.4之间振荡µA至50µA.(我想这是因为广告间隙的睡眠)。所以我认为上面的概念很好用。
但我有两个问题。
1)在睡眠模式(调试器断开条件)时,当我的芯片广告时,我认为它仅广告一次。因为我在BLE扫描仪应用上检查它,我注意到RSSI值只会更新一次。它只会传播一次?如果它正在发送一次,那么为什么当前振荡在2.4μA到50μA之间的6秒持续时间?
2) 上述条件工作了一段时间,突然,电流增加到350µA然后就没有广告了。我的程序停止了吗?
请注意,只有在断开调试器的连接时才会出现上述两种情况。
什么可能导致这两个问题在睡眠期间?
Regards,
标记
设备:

Hi Mark,
在睡眠模式下执行任何类型的测量时,不应在调试模式下运行固件。否则,设备将无法进入睡眠模式,功耗将大幅增加。为此,我的建议是取消调试器的连接,因为这样可以防止系统休眠。此外,一个非常重要的提示是,如果您在自定义板中使用SPI Flash,应该关闭它的电源。
Can you please try to debug it furthermore? Please run it in debug mode - power consumption is not important in this step. You mentioned that is advertising once… After the first advertising what does the fw do? The WDOG is enabled or disabled? I would suggest you to have it enabled, otherwise you will not be notified if the fw stucks somewhere. If you are completely sure that the fw is running as expected (no WDOG occurred or NMI), please use the Power Profiler of SmartSnippets Toolbox to check that it is not advertising once.
谢谢,下午好
HI PM_Dialog,
在调试模式下运行时,代码正确播发,固件不会在任何地方卡住。我在调试模式下运行了一个多小时的代码,效果很好。当我断开调试器并运行它时,问题(如第一篇文章中所述)就出现了。
I do have another doubt. Does your example code 'ble_app_nonconn' in the 'misc' folder support extended sleep mode?. Because it works properly when connected in debugging mode. But when i disconnect the debugger the problem starts.
I am advertising for 6 seconds and stopping it. But it advertises only once and but there is an oscillation in current consumption during the whole 6 seconds. That means that it is waking up between advertising intervals but why no packets are being transmitted. ?
Regards,
标记
Hi Mark,
SDK6.0.12的BLE_APP_NONCONN项目默认情况下不支持睡眠模式。但是,您可以更改睡眠模式配置。由于它是自定义代码和自定义板,因此可以共享您在睡眠模式下配置的更改吗?启动调查哪个是路由原因的另一个选项可能是开始切换GPIO或打印一些调试消息,因为仅在非调试模式下卡住的固件gests。在调试模式下,我假设您已启用WDog ..
谢谢,下午好
嗨,PM\U对话,
My firmware doesnt get stuck. It transmits only a single advertisement for the entire 6 second duration. But in debug mode it transmits 4 to 5 times for the 6 second duration. Why does it transmit only once in non-debug mode?. Is the sleep mode affecting the ble advertisement?.
For sleep mode i have made the following changes.
I stopped the advertisement after 6 seconds and my chip goes into extended sleep.
Regards,
标记
Hi Mark,
不知道会发生什么,因为这是一个自定义板/代码。你能在user\u app\u adv\u start()和user\u app\u adv\u noncon\u complete()中使用arch\u printf()吗?另外,你能给我发一张Power Profiler的截图吗?当调试器被附加和解除附加时。
谢谢,下午好
你好 ,
I dont have an option to print messages in my custom board. I am using a multimeter to measure the current consumption.
我认为问题在于在我准备好宣传的时候调用user_app_adv_start()函数。
我已经附上下面的代码进行推荐。
嗨,PM\U对话,
正如你所建议的,我在外围初始化()在睡觉前把它拉高进入睡眠(睡眠模式)在Arch_Main.cn。我附上了示波器输出的屏幕截图。我面临的问题是,当我调用user_app_adv_start()时,芯片仅发送一次数据。我通过查看Android中的BLE Scanner应用程序上的RSSI值来确认这一点。我也附上了示例代码。
As I have an urgent demonstration of my product, I have changed the advertising interval to 200ms and somehow managing to advertise the data by calling 'user_app_adv_start()' and after 1 second I am stopping it and in the advertise complete function I am calling 'user_app_adv_start()' again. I am repeating these steps for 6 seconds and I am getting multpile advertising hits in my app. Each time when I call 'user_app_adv_start()' I get only 1 hit in my app until I stop the advertisement and call it again.
为什么“user\u app\u adv\u start()”只公布一次数据?
你能给我分享一个信标数据的示例代码,它在外部中断时唤醒,修改广告字符串,传输它,然后进入睡眠状态。
Regards,
标记
Hi Mark,
让我检查一下,我会回复你。
谢谢,下午好
Hi Mark,
ARCH_MAIN.c是SDK文件,强烈建议不要修改任何SDK文件。所有修改都应在应用程序层中完成,以user_开头的文件中。作为SDK的所有其他文件相关,如果其中任何一个都被修改,我们无法保证应用程序将正常工作。SDK应使用,因为它由对话框提供,而无需任何其他修改。
关于你的源代码,我无法编译它,因为我几乎没有错误。请参阅下面的差异文件,了解如何停止不可连接的广告,将设备放在睡眠模式下并唤醒。我的建议是从包含广告数据更新的SDK的BLE_APP_SLEEPMODE示例开始。您如何建立应用程序以及如何更新信标数据取决于您。请按照SDK的BLE_APP_SLEEPMODE示例中的步骤操作。
谢谢,下午好
嗨,PM\U对话,
1) What kind of errors are u getting when u compile my code?.
2) 我修改了你的arch\u main.c文件,因为当我的传感器发送一个中断时,我必须等待大约20毫秒来获取数据,但是如果我不等待,我的代码将返回睡眠状态,我将丢失数据。这就是为什么我修改了arch\u main.c文件,让它等到我把数据拿出来,然后让芯片进入休眠状态。如何延长芯片的唤醒时间?。你能给我个建议吗?。
3) When I start my advertising, most of the code content that I added to arch_main.c will not execute because I am checking for conditions in the main loop and I will not execute it while I am advertising. Why is that affecting your sdk and advertising sequences?.
4) When I get an interrupt until I process the data from my sensor I will not start advertising. After I get the data I will start the advertising and I am sure none of my code will run during advertising. So why does that give any problem to the sdk?.
Thanks,
标记
嗨,PM\U对话,
请在以上几点上支持我。正如你所建议的,我已经开始在bleèu示例中研究睡眠模式项目。我最大的疑问是,当我的外部传感器发出中断信号,并且只在20毫秒后才给出数据时,我该如何防止芯片在我从睡眠中醒来后的20毫秒内进入睡眠状态。
Regards,
标记
Hi Mark,
Please find attached a log file with the errors from the Keil IDE. It would be very helpful to indicate the SDK version that you are using. Not sure about the SDK version but we strongly recommend using the latest version (SDK6.0.12).
谢谢,下午好
嗨,PM\U对话,
The issue got sorted out after we added the external 32Khz crystal oscillator.
似乎没有32Khz晶体,ble\u app\u睡眠模式代码是不稳定的。但是你的数据表上说32Khz是可选的,这是非常误导的。请更正数据表,否则也可能误导他人。我已经花了3-4个月在这个问题上,没有线索这是由于外部晶体。
Any way, thank you for your online support.
Regards,
标记
Hi Mark,
很高兴你找到了工作。这是铁饼sed over our previous conference calls. Thanks for your indication too.
问候,pm_dialog