完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,
我正在使用与BlueNRG-MS模块接口的STM32 MCU在Mentor Graphics的Nucleus RTOS上运行BLE外设配置文件应用程序。该应用程序运行成功,我可以使用ST的Android应用程序连接到心率监视器配置文件,名为“STM32 BLE配置文件”。我们的一个要求是BLE模块应该在我们断开连接之后继续做广告并且我们关闭MCU(应用处理器)然后我们应该能够在MCU关闭后连接它并且它应该唤醒MCU并开始通信通常。我们使用BlueNRG-MS的SPI_IRQ线将唤醒信号发送给MCU。由于在MCU进入关闭状态之前已经在BlueNRG-MS上初始化了配置文件,因此我们不会在BlueNRG-MS上重新初始化配置文件,并且只有在MCU唤醒后才会再次初始化应用程序使用的本地对象。 Android应用程序成功连接到BLE,BueNRG-MS通过SPI_IRQ引脚唤醒MCU。我们在应用程序中将设备状态设置为APPL_CONNECTED,然后我们执行ST中源代码中给出的主应用程序进程,如下所示: / *启动主要流程* / 而(1){ HCI_Process(); profileApplContext.profileStateMachineFunc(); if(Profile_Process_Q()== 0x00) { if(low_power_enabled) { if(profileApplContext.profileApplicationProcessFunc()!= 0){ LPM_Mode_Request(eLPM_MAIN_LOOP_PROCESSES,eLPM_Mode_RUN); } else { LPM_Mode_Request(eLPM_MAIN_LOOP_PROCESSES,eLPM_Mode_LP_Stop); } } 其他 { profileApplContext.profileApplicationProcessFunc(); } } LPM_Enter_Mode(); } / * end while(1)* /当我们执行这个循环时,函数Profile_Process_Q()在第一次迭代中返回0x00但在所有其他迭代中它返回0x01并在控制台上打印下面的消息: '初始化主要配置文件时出错。' 由于这个原因,它不能调用'指向的配置文件应用程序进程函数' profileApplContext.profileApplicationProcessFunc() ”。我们不详细知道这个Profile_Process_Q()函数正在做什么,因为它是以二进制形式提供的,并且在文档中给出的信息非常少。 在使用控制语句和强制调用配置文件应用程序进程函数的第一次迭代后,我们也试图跳过它的调用但是当我们尝试使用HR_Application_Process()中的'HRProfile_Send_HRM_Value(tHeartRateMeasure heartRateVal)函数来编写心率值时,它返回0x41,我们在Android应用上看不到任何数据。 如果有人可以提供有关Profile_Process_Q()函数究竟在做什么的信息以及在这方面可能有帮助的任何其他见解,将会很有帮助。 #bluenrg-MS 以上来自于谷歌翻译 以下为原文 Hi All, I am running BLE peripheral profile application on Mentor Graphics' Nucleus RTOS using STM32 MCU interfaced with BlueNRG-MS module. The application runs successfully and I can connect to the heart rate monitor profile using Android app by ST named 'STM32 BLE Profiles'. One of our requirements is that the BLE module should keep on advertising after we disconnect from it and we shutdown the MCU (Application Processor) and then we should be able to connect to it after MCU shutdown and it should wake up the MCU and start communicating with it normally. We are using SPI_IRQ line of BlueNRG-MS to send the wake up signal to MCU. As the profile has already been initialized on BlueNRG-MS before MCU went to shutdown state, we do not re-initialize the profile on BlueNRG-MS and only local objects used by the application are initialized again after MCU wake-up. The Android app connects to the BLE successfully and BueNRG-MS wakes up the MCU via SPI_IRQ pin. We set the device state in our application as APPL_CONNECTED and then we execute the main application process given in the source code by ST shown below: /* Start the main processes */ while(1){ HCI_Process(); profileApplContext.profileStateMachineFunc(); if (Profile_Process_Q() == 0x00) { if (low_power_enabled) { if (profileApplContext.profileApplicationProcessFunc() != 0) { LPM_Mode_Request(eLPM_MAIN_LOOP_PROCESSES, eLPM_Mode_RUN); } else{ LPM_Mode_Request(eLPM_MAIN_LOOP_PROCESSES, eLPM_Mode_LP_Stop); } } else { profileApplContext.profileApplicationProcessFunc(); } } LPM_Enter_Mode(); } /* end while(1) */When we execute this loop, the function Profile_Process_Q() returns 0x00 in the first iteration but in all other iterations it returns 0x01 and prints below message on the console: 'Error While Initializing main profile.' Due to this it cannot call the profile application process function pointed to by ' profileApplContext.profileApplicationProcessFunc() '. We do not know in detail what this Profile_Process_Q() function is doing as it has been provided in binary form and very little information is given about it in the documentation. We have also tried to skip its call after the first iteration of while loop using control statement and calling profile application process function forcefully but when we try to write the heart rate value using 'HRProfile_Send_HRM_Value(tHeartRateMeasure heartRateVal)' function in HR_Application_Process(), it returns 0x41 and we don't see any data on Android app. It would be helpful if someone can provide information on what exactly the Profile_Process_Q() function is doing and any other insight that might help in this regard. #bluenrg-ms |
|
相关推荐
1个回答
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2634 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3609 浏览 6 评论
5987 浏览 21 评论
939浏览 4评论
1315浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
582浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1302浏览 3评论
1357浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 10:09 , Processed in 1.107289 second(s), Total 79, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号