Controller sleep mode and wake up

Dear Sirs!

I use SDK 12.2. I need without RTOS to put controller in sleep mode (but not OFF mode) and be able to wake it up by pressing button, connected to GPIO.

GPIO with interrupt. I am confused how to do it? Please explain how to set it in deep sleep?.

Will controller perform next instruction after wake up and interrupt processing?

Additional question.

In all examples I see code 

// Activate deep sleep mode
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;

But I cannot find in datasheet SCB register and its bits. Where is system control register in datasheet? Different name?

Best regards

Parents
  • Hello,

    Regarding the SCB register, please see my reply in this post:  RE: nrf_pwr_mgmt_run impact of SCB_SCR_SLEEPDEEP_Msk . SCB is an ARM Cortex-specific register. Therefore, it is covered by the ARM documentation and not by our product specification.

    GPIO with interrupt. I am confused how to do it? Please explain how to set it in deep sleep?.

    You can call power_manage() from your main loop as we do in our examples. This will make the chip enter System ON mode when there is no work to do.

    Will controller perform next instruction after wake up and interrupt processing?

    The program will return to the code following your sleep function after processing the interrupt(s).

    In all examples I see code 

    Isn't it only in the FreeRTOS example? Setting this bit is redundant anyway.

    Best regards,

    Vidar

Reply
  • Hello,

    Regarding the SCB register, please see my reply in this post:  RE: nrf_pwr_mgmt_run impact of SCB_SCR_SLEEPDEEP_Msk . SCB is an ARM Cortex-specific register. Therefore, it is covered by the ARM documentation and not by our product specification.

    GPIO with interrupt. I am confused how to do it? Please explain how to set it in deep sleep?.

    You can call power_manage() from your main loop as we do in our examples. This will make the chip enter System ON mode when there is no work to do.

    Will controller perform next instruction after wake up and interrupt processing?

    The program will return to the code following your sleep function after processing the interrupt(s).

    In all examples I see code 

    Isn't it only in the FreeRTOS example? Setting this bit is redundant anyway.

    Best regards,

    Vidar

Children
Related