Hi All,
I'm currently working on the sample application based on ble_all_in_one example. The changes on top of the ble_all_in_one example are as follow
1. Changes in characteristics & services
2. Write custom application data to SPI flash.
3. Button event changes (We have registered a wakeup ISR for the same to detect short press and long press)
4, Added function to be called .app_going_to_sleep, that pulls down a GPIO interface which completely powers off the board on a custom hardware
Problem Statement
似乎电路板没有进入扩展的睡眠模式,而且.App_Goop_to_sleep函数未被调用。我们测量电路板消耗的电压,它与操作模式所消耗的电压相同。绘制测试点以这样的方式绘制,如果电源从电路板切断,则TP应低至0.06V。
2.检测不活动后,电路板应进入电源截止模式。
What I tried
1. I tried following the Sleep mode tutorial provided by Dialog but still, I'm out of luck.
2. I tried to remove all the arch_force_active_mode() and arch_force_restore_sleep() calls from my code.
3.我试图使用WKUPCT_DISABLE_IRQ()函数对GPIO按钮取消注册唤醒回调。
4.明确称为ARCH_SET_EXTEDDED_SLEEP()函数以将电路板放在低功率模式下。
If you need anymore details, feel free to contact me. Please guide me through your valuable insights for solving this problem.
Thanking you in advance
问候
dhruv shah.
嗨dhruv11593,
I am working on your issue and I will get back to you as soon as possible.
Thanks, PM_Dialog
Hi PM_Dialog,
Looking forward to your response. If you need any technical help regarding the same, please do let me know
嗨dhruv11593,
Could you please let me know how you understand that your device isn’t going to extended sleep mode? I tried to replicate you problem, but in my side the .app_going_to_sleep callback function is always triggered before entering the extended sleep mode. Did you try to add a break point into your function that will executed since the .app_going_to_sleep is triggered and run your code with hot attaching the debugger?
Thanks, PM_Dialog
Hi PM_Dialog,
Thank you so much for putting efforts for recreating my test scenario on your end.
On our custom board to achieve longer battery life, we have a system trigger GPIO which keeps the system active until it is kept High and cuts off the voltage to the system when turned low. As soon as the board boot-up, we are configuring this GPIO to high in the pherip_init() function. In the .app_going_to_sleep callback function, we are pulling this GPIO low which cuts off the power supply to the SoC.
When the SoC is powered off, the ideal voltage on the test pads is somewhere around 0.01 to 0.03 V and when the system is active the voltage is the same as that of the battery's current capacity. If the .app_going_to_sleep callback is getting triggered, we should see a voltage drop from ~3 V to 0.01 V, which is never the case. We have measured the Voltage on the system after 1. 3. and 5 mins of ideal time but the board was still consuming power from the battery.
As far as my understanding goes, when doing step debug the board will always be in active mode. Please clarify if otherwise.
问候,
dhruv shah.
嗨dhruv11593,
As I am able to understand from what you mentioned in your post, you have made some modifications into the ble_app_peripheral example of the SDK in order to implement your application. If you try to test the .app_going_to_sleep callback function using the default example of the SDK, as it is, could you please let me know that the callback getting triggered before going to sleep? Please, try to use some break points and run you code with hot attaching the debugger. Are you able to see that the code stops into the registered callback?
The .app_going_to_sleep callback function is called from the app_sleep_entry_proc(sleep_mode); which is placed into the arch_goto_sleep (sleep_mode_t current_sleep_mode) function. The arch_goto_sleep() function is called into the while(1) endless loop of the main_func() in the arch_main.c file. Please, run you code with hot attached the debugger and check the value of the sleep_mode variable. If you check the sleep_mode_t enumeration in the arch.h header file, you will see the possible values of the sleep_mode variable. So, if you are using extended sleep mode the sleep_mode should have the value 0x02. Also, please check that the arch_goto_sleep() function is getting triggered. I tested from my side, and the .app_going_to_sleep is getting triggered.
Furthermore, that the DA14583 goes into extended sleep mode between advertising and connection intervals. Could you please let me know about the power consumption of you board? If you are using the extended sleep mode, the app_default_sleep_mode value in the user_config.h header should be configured like that:
const static sleep_state_t app_default_sleep_mode = arch_ext_sleep_on;
Thanks, PM_Dialog