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

Power management (pwr_mgmt) + systick causes board hangup

We are using a NRF52840 chip (SDK 15.3) in an application  and are having issues with the startup of the board. I managed to create an example application where I integrate the systick with power management.

#include <stdbool.h>
#include <stdint.h>
#include "nrf_drv_systick.h"
#include "boards.h"
#include "nrf_pwr_mgmt.h"

static int cnt = 0;
void SysTick_Handler(void)
{
    if (cnt % 1000 == 0)
      bsp_board_led_invert(0);

    cnt++;
}

int main(void)
{
  SysTick_Config(SystemCoreClock/1000 );
  bsp_board_init(BSP_INIT_LEDS);
  nrf_pwr_mgmt_init();
  
  while (true)
  {
    //nrf_pwr_mgmt_run();
  }
}

The example works fine and blinks an LED of the development kit once a second. 

However, once I uncomment 'nrf_pwr_mgmt_run' the board does not power up anymore after I have toggled the complete power (by removing/attaching the USB connector). Pressing the reset button only does not cause problems, and the board works as expected. 

Am I missing anything here?

Related