This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

need more control over power management

Hi,

for my application, I want the processor to wake up once every 8 hours, do a 1 second analog measurement, broadcast the results and shut down. When activated by a switch, it should do the same, but then start advertising and be connectable to read and update certain settings.

I think I need a lot more control over the power management then just putting "nrf_pwr_mgmt_run() " in an endless loop, as happens in most examples. Can anyone please point me in the right direction for this, like code snippets or documentation?

thx, Henk

Parents Reply Children
  • Just extending on Richard's explanation.

    What he means to say is that main loop calling nrf_pwr_mgmt_run will ensure that when system is idling then the loop makes sure that it goes into low power. Any other control should either be interrupt driven (or if SEVONPEND bit is set in ARM registers) then any event in the device peripheral will wake the chip. I am not sure what you mean by "controlling BLE functions" . BLE activities are started (like scanning/advertising and connections) and you do not need to monitor them continuosly. Any BLE activity that needs application processing will wake the chip up and give control to the application through BLE events (which in itself is a interrupt handler)

  • Aryan I think he wants help on the APIs for starting and stopping advertising and also sending out updated data to a connected device every 8 hours. 

    I was going to point him to something like ble_app_blinky since it has a lot of that functionality but maybe you can come up with some better references for him. It’s a holiday here and I can’t get back to it until tomorrow.

  • Thanks Richard for correcting me.

    @Henk, you need to look into GAP module API within the softdevice. Please check the documentation here.

    mainly look at

    uint32_t  sd_ble_gap_adv_start (uint8_t adv_handle, uint8_t conn_cfg_tag)
      Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). More...
     
    uint32_t  sd_ble_gap_adv_stop (uint8_t adv_handle)
      Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). More...
    uint32_t  sd_ble_gap_disconnect (uint16_t conn_handle, uint8_t hci_status_code)
      Disconnect (GAP Link Termination). More...

    since you tagged this thread with nRf52810, it cannot initiate a connection as it can only work as peripheral and a broadcaster

Related