sleep mode example code change

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
GAK
Offline
Last seen:1 year 7 months ago
加入:2018-10-01 11:18
sleep mode example code change

Hi Team,

I want to modified the example "ble_app_sleepmod" code like as below,

1)By default Sleep should be off,(BLE Device should be in advertising mode)
2)enable the sleep mode by using GPIOIRQ (P1_3)
3)wake up the BLE core by using wake-up timer through P0_1(after wake up BLE Device should be in advertising mode)

For this I was changed the example code ,but the changed code is not working(its not in advertising mode by default)
Kindly find the attached files for your reference.

Please give me your support for this.

Thanks

Attachment:
Device:
PM_Dialog
Offline
Last seen:3 days 6 hours ago
工作人员
加入:2018-02-08 11:03
H GAK,

H GAK,

Thanks for uploading your code. Let me check and debug your code implementation and configurations and I will get back to you with my conclusions as soon as possible. I will try to replicate your issue using the Pro-DK, so SW2 (Pin1_1) will act sleep functionality (step2) and SW3(Pin0_6) will act wake-up functionality. However, I need some clarifications to start the demo. Can you please let me know if the gpio and wake-up interrupt should be active high or active low? You mentioned that your code doesn’t work and it is not advertising. Did you try to run your code in debug mode? Does the firmware get stuck or the only problem is that it is not advertising? Having a quick view in user_sleepmode.c, I noticed that in user_app_adv_start() function, you are using the app_easy_timer. This means that the advertising will stop every APP_ADV_DATA_UPDATE_TO seconds. Please check the adv_data_update_timer_cb(). This callback will be triggered upon the timer expiration, and the then the app_easy_gap_advertise_stop() will be triggered. Although, let me debug a bit deeper your application and I will get back to you.

Thanks, PM_DIalog

GAK
Offline
Last seen:1 year 7 months ago
加入:2018-10-01 11:18
Hi Team,

Hi Team,

请找到澄清的内联答案。
Can you please let me know if the gpio and wake-up interrupt should be active high or active low? "Active low"

你提到你的代码不起作用,它不是广告。您是否尝试在调试模式下运行代码?“是的,我可以在调试模式和它不是广告中运行代码。我正在使用一个ble扫描仪app(android)来符合这个”

Does the firmware get stuck or the only problem is that it is not advertising?"only problem in advertising "

PS : I just followed "ble_app_sleep_mode" example project in DA14580 EVK Pro kit.

Thanks,

PM_Dialog
Offline
Last seen:3 days 6 hours ago
工作人员
加入:2018-02-08 11:03
Hi GAK,

Hi GAK,

I asked you to run your code in debug mode in order to make sure that your firmware is not get stuck somewhere or a Hardfault has been occurred. Please, try to run again your code in debug mode and hot attach the debugger, and after that let me know if a NMI or a watchdog has been occurred. Could you please let me know if the app_wakeup_cb() when trying to wake your device up? If yes, the “if” condition in this function is it true or false? Also, regarding your first post, you mentioned that when the device boots should advertise. If you are working into the ble_app_sleepmode example, the .default_operation_adv= user_app_adv_start should be triggered. Please, add a break point into the user_app_adv_start() and run your code in debug mode. Does the break point hits? The best practice to debug your code is to have optimization Level-0 (-O0). So, navigate into “C/C++” tab of “Options for Target” from the Keil environment and the optimization into Level-0 (-O0).

Thanks, PM_Dialog

GAK
Offline
Last seen:1 year 7 months ago
加入:2018-10-01 11:18
Hi Team,

Hi Team,

Already i am running the code in debug mode .
Yes I am using ble_app_sleepmode example project and i can able to set the device in advertise and the break point also hit which is added in user_app_adv_start() .

But i want to remove the timer based sleep function in the ble_app_sleepmode example , and sleep / wake up should be based on GPIO pin /GPIO toggling as mentioned above post.
如何删除基于定时器的睡眠in ble_app_sleepmode example?

您可以为此提供支持。

Thanks,

PM_Dialog
Offline
Last seen:3 days 6 hours ago
工作人员
加入:2018-02-08 11:03
Hi GAK,

Hi GAK,

Do you mean the timer into user_app_adv_start() which stops advertising and configures the device into permanent sleep mode? If yes you should remove it all change the callback that occurs the advertising stop.

Thanks, PM_Dialog