嗨对话小组,
我正在使用SDk文件夹中的misc文件夹中的“ble\u app\u noncon”示例制作自定义板。我的项目要求如下。
- Go to sleep mode (ARCH_EXT_SLEEP_ON) whenever no ble or other activity.
- 当外部传感器提供数据时,对话框芯片将唤醒引脚更改中断并使用计时器0开始从传感器中解码数据。
- 解码数据并在广告字符串上更新它。
- 使用'user_app_adv_start()'启动广告,并启动一个易于计时器,将在6秒内过期。直到那时广告数据被宣传。当App_easy Timer到期时,使用'app_easy_gap_advertise_stop()'停止广告,这将使芯片睡眠。
- Before stopping advertisement, the wakeup pin will be enabled to wake up the chip from sleep when the next data is ready.
我在调试模式下填写上述步骤。当我在RAM上运行我的程序并断开调试器时,电流消耗会降低到2.4μA。当外部中断发生时,电流上升到大约50μA,振荡在2.4μA至50μA之间。(我猜这是由于广告Internvals之间的睡眠)。所以我认为上面的概念可以很好地工作。
但我陷入了两个问题。
1) During sleep mode ( debugger disconnected condition ) when my chip advertises I think it advertises only once. Because I am checking it on a BLE scanner app and I notice that the RSSI value is updated only once. It it only transmitiing once?. If it is transmitting once, then why the current oscillation between 2.4µA to 50µA for the 6 sec duration?
2)上述条件有效期为一段时间和突然间,电流增加到350μA,然后根本没有广告。我的节目停止了吗?
请注意,仅当我断开调试器时,才会出现上述两个条件。
What could cause these two issues during sleep?
问候,
Mark
Device:


嗨马克,
在睡眠模式下执行任何类型的测量时,您不应以调试模式运行固件。否则,该设备无法进入睡眠模式,并且功耗将大大增加。为此,我的建议将成为调试器未连接,因为这可以防止系统睡眠。此外,非常重要的提示是,如果您在您的自定义板中使用SPI Flash,则应将其供电。
你能试着调试一下吗?请在调试模式下运行-功耗在此步骤中不重要。你提到的是广告一次…在第一次广告后,fw做什么?WDOG是启用还是禁用?我建议你把它启用,否则你不会得到通知,如果fw在某处受阻。如果您完全确定fw正在按预期运行(未发生WDOG或NMI),请使用SmartSnippets工具箱的Power Profiler检查它是否一次未发布广告。
谢谢,PM_DIALOG.
嗨,PM\U对话,
在调试模式下运行时,代码正常通告,固件不会卡住任何地方。我在调试模式下运行了一小时的代码,它可以正常工作。当我断开调试器并运行它时,问题(如第一个帖子中所述)发生。
我还有一个疑问。“misc”文件夹中的示例代码“ble\u app\u noncon”是否支持扩展睡眠模式?。因为它在调试模式下正常工作。但当我断开调试器时,问题就开始了。
我是广告6秒钟并停止它。但它仅广告一次,但整个6秒内的当前消耗量有振荡。这意味着它在广告间隔之间唤醒,但为什么不发送数据包。?
问候,
Mark
嗨马克,
The ble_app_nonconn project of the SDK6.0.12 does not support sleep mode by default. However, you can change the sleep mode configuration. Since it’s a custom code and custom board, would it be possible to share the changes you have done in order to configure it in sleep mode? Another option to start investigating which is the route cause might be to start toggling a GPIO or printing some debugging messages, as the firmware gests stuck only in non-debug mode. In debug mode, I assume that you have the WDOG enabled..
谢谢,PM_DIALOG.
嗨pm_dialog,
我的固件不会被卡住。它仅在整个6秒持续时间传输单个广告。但是在调试模式下,它会在6秒持续时间传输4到5次。为什么它只在非调试模式中传输一次?是影响BLE广告的睡眠模式吗?
对于睡眠模式,我做了以下更改。
我在6秒钟后停止了广告,我的芯片进入长时间睡眠。
问候,
Mark
嗨马克,
不确定发生了什么,因为它是自定义板/代码。您能否请在user_app_adv_start()和user_app_adv_nonconn_complete()中使用Arch_Printf()在user_app_adv_nonconn_complete()中?另外,请你发给我一个电力分布器的屏幕截图吗?当调试器附加并取消连接时。
谢谢,PM_DIALOG.
Hi ,
我没有在我的自定义板上打印消息的选项。我正在用万用表测量电流消耗。
我认为问题在于调用user_app_adv_start() function when i am ready to advertise again.
我已经附上下面的代码进行推荐。
嗨pm_dialog,
正如你建议的那样,我拉下了一个gpioperiph_init()然后在睡前睡觉之前把它拉高Arch_Goto_Sleep(Sleep_Mode)在Arch_Main.cn。我附上了示波器输出的屏幕截图。我面临的问题是,当我调用user_app_adv_start()时,芯片仅发送一次数据。我通过查看Android中的BLE Scanner应用程序上的RSSI值来确认这一点。我也附上了示例代码。
正如我对我的产品的紧急演示一样,我已经改变了广告间隔到200ms和以某种方式通过调用'user_app_adv_start()'和1秒后我停止它以及在我打电话的广告完整功能之后宣传数据。user_app_adv_start()'再次。我在我的应用中重复了6秒钟,我正在获得多面广告命中。每次我打电话'user_app_adv_start()',我在我的应用程序中只有1个点击,直到我停止广告并再次调用它。
为什么'user_app_adv_start()'只广告数据一次?
请您可以分享我的标志数据的示例代码,用于在外部中断上唤醒并修改广告字符串并传输并睡眠。
问候,
Mark
嗨马克,
让我检查一下,我会回复你。
谢谢,PM_DIALOG.
嗨马克,
The arch_main.c is SDK file and it is highly recommend NOT modifying any SDK file. All the modifications should be done in the application layer, in the filed that start with user_ . All the other files as SDK related and if any of them is modified we cannot guarantee that the application will work correctly. The SDK should be used as it is provided by dialog without any other modification.
Regarding you source code I am not able to compile it as I am getting couple of errors. Please see below a diff file for how to stop non-connectable advertising, put the device in sleep mode and wake it up. My recommendation would be to start with ble_app_sleepmode example of the SDK which contains advertising data update as well. How you would like to build the application and how to update the beacon data is up to you. Please follow the steps in the ble_app_sleepmode example of the SDK.
谢谢,PM_DIALOG.
嗨pm_dialog,
1) 当你编译我的代码时,你会遇到什么样的错误?。
2)我修改了你的Arch_main.c文件,因为当我的传感器发送中断时,我必须等待大约20ms来获取数据,但如果我不等待我的代码将恢复入睡,我会错过数据。这就是为什么我修改了ARCH_MAIN.c文件等待我的数据,然后将芯片放入睡眠状态。如何延长芯片的唤醒时间?你能建议一个想法吗?
3) 当我开始播发时,我添加到arch\u main.c的大部分代码内容都不会执行,因为我正在检查主循环中的条件,并且在播发时不会执行它。为什么这会影响你的sdk和广告序列?。
4)当我收到中断时,直到我从传感器处理数据时,我就不会启动广告。在我收到数据后,我将开始广告,我相信我的代码都不会在广告期间运行。那么为什么这对SDK给出了任何问题?
谢谢,
Mark
嗨pm_dialog,
请支持上面的积分。正如您所建议的那样,我已经开始在BLE_Examples的SleepMode项目上工作。我最大的怀疑是当我的外部传感器给出中断并仅在20ms后提供数据时,我如何在从睡眠中醒来后,我如何防止芯片进入睡眠。
问候,
Mark
嗨马克,
请查看附件中包含keilide错误的日志文件。指出您正在使用的SDK版本将非常有帮助。不确定SDK版本,但强烈建议使用最新版本(SDK6.0.12)。
谢谢,PM_DIALOG.
嗨pm_dialog,
在添加外部32kHz晶体振荡器后,该问题被整理出来。
似乎BLE_APP_SLEEPMODE代码在没有32kHz水晶的情况下不稳定。但是你的数据表说,这32kHz是可选的,这是非常误导的。请纠正数据表,也可以误导别人。我在这个问题上花了3-4个月,没有任何内容,没有任何内容。
无论如何,谢谢你的在线支持。
问候,
Mark
嗨马克,
很高兴你成功了。这就是我们之前电话会议讨论的内容。谢谢你的指示。
问候,pm_dialog