Active mode to hibernate mode

⚠️
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.
10 posts / 0 new
Last post
powersquare
Offline
Last seen:5 months 3 weeks ago
Joined:2018-12-27 04:15
Active mode to hibernate mode

Dear Dialog team,

Thank you for your support.

我们定制的董事会由14683。应用程序is based on ble_peripheral project. While one task reads the data from sensors, other task sends data to the mobile app, once connected.

We have 2 sensors, RTC, flash, 3 LEDs, vibrator connected to the board.

Our application will be in active mode during system init. We would like to bring the board to hibernate mode, when the button is pressed for 5 seconds. We observed that board goes to hibernate mode some times, but not always.

We also observed that button interrupt is called always and the counter is incremened for button press for 5 seconds, but some process is blocking from the board to go to hibernate mode.

Can you help us to resolve the issue?

Best regards

Malli

Device:
PM_Dialog
Offline
Last seen:3 days 9 hours ago
Staff
Joined:2018-02-08 11:03
Hi powersquare,

Hi powersquare,

Thanks for your question. I am working on your issue and I will get back to you shortly.

Can you please let me know if your question is related with this one?

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/button-press-5-sec-wakeup-sleep-mode

Thanks, PM_Dialog

powersquare
Offline
Last seen:5 months 3 weeks ago
Joined:2018-12-27 04:15
Yes.

Yes.

PM_Dialog
Offline
Last seen:3 days 9 hours ago
Staff
Joined:2018-02-08 11:03
Hi powersquare,

Hi powersquare,

Sorry but I am little bit confused between this ticket and the attached one. In the attached ticket, you had mentioned that you cannot get the callback function upon wake-up. According to this ticket, your issue is that you are not able to put the device in hibernation mode. In order to put the device in hibernation mode, you should use the pm_set_sleep_mode(pm_mode_hibernation). Be aware that hibernation mode is a special mode to be used for shipping the final product to market without draining the battery. This is what is used for shipping and storing the final product and I would not recommend you the hibernation for development or debugging scopes. If you have BLE activity or any other pending interrupts, the system will not be able to go into hibernation. So, can you please let me know about the procedure you follow in order to put into hibernation? Do you stop the BLE activity, sensor reading etc.?

Thanks, PM_Dialog

powersquare
Offline
Last seen:5 months 3 weeks ago
Joined:2018-12-27 04:15
Dear Dialog team,

Dear Dialog team,

Thank you for your support.

We are trying to find out, which part of the code, is causing this issue.

We put all our code in comments (#if 0) and started testing the button issue with PCB.

Please find the attached main.c.pdf file for your reference.

In this file, we put our code in comments (line numbers 569 to 584, 605 to 649, line number 588, 595). We have also put line numbers 586, 590, 591 and 593) into comments.

With this bare minimum code, we observed button works fine in the PCB.

Then we started removing comments one by one. Removed the comments in line numbers 586, 590, 591 and 593, which is below code:

-------------------------------------------------------------------------

ad_nvms_init();

//nvms_var = ad_nvms_open(NVMS_GENERIC_PART);

nvms_Binvar = ad_nvms_open(NVMS_BIN_PART);

OS_ASSERT(nvms_Binvar);

printf("flash bin part success\r\n");

----------------------------------------------------------------------------

With this code, button doesn't work properly. In the above lines, we initialized the flash and opened the bin partition. Its printing message "flash bin part success".

We don't have APIs like ad_nvms_close () APIs to close partition, before putting the PCB into hibernation mode.

Please note that PCB is powered with battery.

Can you help us to resolve this issue. If above code works fine for the button, then we will start removing comments in our code to test further.

Please let us know for any clarifications.

Best regards

Malli

PM_Dialog
Offline
Last seen:3 days 9 hours ago
Staff
Joined:2018-02-08 11:03
Hi powersquare,

Hi powersquare,

Can you please attach the main.c file? I could not see it in the attachments.

Thanks, PM_Dialog

powersquare
Offline
Last seen:5 months 3 weeks ago
Joined:2018-12-27 04:15
Dear Dialog team,

Dear Dialog team,

Can you share your email, I will send the source code to you.

Best regards

Malli

PM_Dialog
Offline
Last seen:3 days 9 hours ago
Staff
Joined:2018-02-08 11:03
Hi powersquare,

Hi powersquare,

Could you upload here some code snippets? Can you please make sure if you stop the ble activity and interacting with the sensor when putting the system into hibernation? You need to completely stop BLE activity before going into hibernate. Do you have a custom board, or you are using any of our DKs?

Thanks, PM_Dialog

powersquare
Offline
Last seen:5 months 3 weeks ago
Joined:2018-12-27 04:15
Dear Dialog team,

Dear Dialog team,

we use custom board made from 14683.

Do you have any code snippets or example project to stop BLE activity. Currently we use BLE stop Advertising api to stop advertising. Do we need to stop any thing else in BLE.

We use pm set sleep mode to hibernation api to put the system to hibernation mode.

Can you help us, how to find, which process is blocking the system to go to hibernate mode.

Best regards

Malli

PM_Dialog
Offline
Last seen:3 days 9 hours ago
Staff
Joined:2018-02-08 11:03
Hi Malli,

Hi Malli,

我们将支持你私人channe支持l.

Thanks, PM_Dialog