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

SPIS not working with nrf_pwr_mgmt_run

Hey all

In my current project I could set up an SPI communication, where the SPI-slave is on the nordic side. This works fine when I have __WFE() in my main loop, however when I replace __WFE() by nrf_pwr_mgmt_run() no SPI data is received anymore.

    while (true) // endless main loop
    {
        if(NRF_LOG_PROCESS() == false)
        {
//            __WFE();
            nrf_pwr_mgmt_run();
        }
    }

Can anyone give me a hint, why this does not work? And whats the

Parents
  • As you can see in most our example projects, nrf_pwr_mgmt_run() is called as part of idle_state_handle() in order to make sure there are no pending log operations, before it goes to sleep until the next event occurs. Please try that on your end as well. If not, please try debugging and go step by step when you go to sleep to see what happens, are you sure you trig a new event to wake the device up?

    /**@brief Function for handling the idle state (main loop).
     *
     * @details If there is no pending log operation, then sleep until next the next event occurs.
     */
    static void idle_state_handle(void)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            nrf_pwr_mgmt_run();
        }
    }

    Best regards,

    Simon

Reply
  • As you can see in most our example projects, nrf_pwr_mgmt_run() is called as part of idle_state_handle() in order to make sure there are no pending log operations, before it goes to sleep until the next event occurs. Please try that on your end as well. If not, please try debugging and go step by step when you go to sleep to see what happens, are you sure you trig a new event to wake the device up?

    /**@brief Function for handling the idle state (main loop).
     *
     * @details If there is no pending log operation, then sleep until next the next event occurs.
     */
    static void idle_state_handle(void)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            nrf_pwr_mgmt_run();
        }
    }

    Best regards,

    Simon

Children
Related