了解更多常见问题教程

5 posts / 0 new
最后一篇文章
尼克·朗
离线
最后一次见到:2天2小时前
已加入:2020-05-20 04:00
GPIO中断广播

你好对话框的东西,我计划开发一个计数器的基础上DA14531。
最后的效果是,当DA14531的P0\u1引脚检测到上升沿时,一个变量say COUNTER将加1,然后COUNTER的值将被公布三次。之后,DA14531进入睡眠状态,监听PIN P0\u 1上的下一个中断。我将在智能手机扫描仪应用程序的制造商特定数据中看到计数器的值。
我认为结合Timer1\u软件\u例子和ble\u app\u barebone例子可以实现我的目标。然而,我尝试了,却失败了。

你能给我一个实现这个目标的详细程序吗。非常感谢。

设备:
尼克·朗
离线
最后一次见到:2天2小时前
已加入:2020-05-20 04:00
你好,

你好,

我找到了另一个例子来达到我的目的。这就是Ble_Button_Wakeup的例子。但是,我在user_wakeup.c中添加了一个全局变量COUNTER,并在user_app_wakeup_press_cb()函数中添加了代码“COUNTER++”。如何将COUNTER的值更新为“mnf”_data.u专有数据[1] “在用户\u barebone.c中并公布此值?你能帮个忙吗?谢谢。

PM\U对话框
离线
最后一次见到:13小时24分钟前
工作人员
已加入:2018-02-08 11:03
你好,尼克·朗,

你好,尼克·朗,

谢谢你的在线提问。我认为最好的开始项目是SDK6的ble\u app\u睡眠模式示例。

您可以在6.0.14.1114\projects\target\u apps\ble\u examples\ble\u app\u sleepmode SDK path中找到它。

本例使用唤醒控制器来唤醒设备。请检查应用程序\按钮\启用()。为了检测高电平信号,应将极性从WKUPCT\ U引脚\ U极性\ U低更改为WKUPCT\ U引脚\ U极性\ U高。

本示例还演示了如何更新特定于制造商的数据。请参阅mnf_data_update()函数。

谢谢,下午好

尼克·朗
离线
最后一次见到:2天2小时前
已加入:2020-05-20 04:00
Hi PM_Dialog. Thanks for your

嗨,下午好。谢谢你的回复。你是对的。我可以修改ble\u app\u sleepmode示例来实现我的目的。我找到一个帖子https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...to give the procedure. Following are the steps your Dialog stuff gave:

1) 注释掉在user\u app\u adv\u start()函数中调用的app\u easy\u timer()。此计时器执行adv\u data\u update\u timer\u cb()函数,该函数通过APP\u easy\u gap\u advised\u stop()函数将每个APP\u adv\u data\u update\u停止播发到秒。
2) 关于广告字符串的更新,您应该停止广告,然后动态更新数据,然后重新开始广告。在app\u wakeup\u cb()函数中,添加app\u easy\u gap\u advertive\u stop()以停止广告。
3) 将app\u按钮\u enable添加到用户\u app\u adv\u start()中,以便通过按按钮更新广告数据
4) Then in the user_app_adv_undirect_complete() comment out the arch_ble_ext_wakeup_on() and the app_button_enable() and add user_app_adv_start(). The user_app_adv_start() will start the advertising after the update of the advertising data.

函数的作用是:将按钮设置为唤醒触发事件,并设置唤醒控制器。wkupct\u register\u callback()注册将在唤醒控制器中调用的app\u button\u press\u cb()函数。另外,wkupct\u enable\u irq()选择连接按钮的GPIO,并在发生唤醒中断时触发。

But there is still something he did not illustrate clearly. Below are my realization steps based on my understanding. could you please check whether they are correct?

1) 注释掉user\u app\u adv\u data\u update\u timer\u used=app\u easy\u timer(app\u adv\u data\u update\u TO,adv\u data\u update\u timer\u cb);在user\u app\u adv\u start()函数的第一行中添加app\u button\u enable()函数。我不确定app\u button\u enable()函数的位置是否正确。

2) 在app\u button\u press\u cb()函数的最后两行中添加app\u easy\u gap\u advertive\u stop()和mnf\u data\u update()函数。

3) 在app\u BUTTON\u enable()函数的定义中,根据需要更改GPIO\u BUTTON\u PORT、GPIO\u BUTTON\u PIN、WKUPCT\u PIN\u POLARITY\u LOW。

4) 注释掉user\u app\u adv\u undirect\u complete()函数中的arch\u ble\u ext\u wakeup\u on()和app\u button\u enable()函数,然后添加user\u app\u adv\u start()函数。

5)change mnf_data_update() like this for counting.
static void mnf_data_update()
{
多国部队_data.u专有数据[1]++;
}

在通过这五个步骤修改代码之后,当我将设置为按钮压脚的P0\u 1连接到GND时,我的扫描仪应用程序中显示的制造商数据将添加一个。然而,这并不十分稳定。有时DA14531会停止播发,我无法通过连接P0\ U 1到GND唤醒它。我只能按重置键重新计数。你能帮我解决这个问题吗?谢谢!

Regards,
尼克

PM\U对话框
离线
最后一次见到:13小时24分钟前
工作人员
已加入:2018-02-08 11:03
你好,尼克·朗,

你好,尼克·朗,

谢谢你的回应。我建议你圣art debugging the project.So, please run it in debug mode and check if the firmware is rerunning correctly. Is the fw running, or it freezes into an assertion, NME etc. ? Add also some breakpoints, so you can verify that all is working as expected.

Question : Does the device boot from SPI Flash or System-RAM? In case of System-RAM, what is the behavior?

您可以通过按下keilide中的“启动/停止调试会话”按钮和“运行”按钮在调试模式下运行它?

谢谢,下午好