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

nrf52833 not waking up on custom board

Hi every body,

My system was able to wake up on gpio on dev kit but after adjusting pin , my custom board is not able to wake up.

I'm in debug mode, it was also working fine.

My second question is that i don't know why i have to call two times idle_state_handle();

After first call i see the wake up debug pin togle fast . After second call, wake up pin stay high so module is properly in sleep mode.

            case LOW_POWER:

                    NRF_LOG_INFO("State Machine : LOW POWER");
            
                    
                    idle_state_handle();
                     idle_state_handle();    //why two times ? but it works...

                    //ZZZZZZZZZZ... Program sleep here, willcontinu after this comment on wake up

Here how i set my pin P0_30/ain6 to be able to wake up the system. I checked by reading that the pin is properly soldered and it is the case, that's why i'm thinking to a configuration somewhere to adjust.

        //pin wake up
    nrf_gpio_cfg_sense_input(ACCEL_WKUP_PIN_NUMBER,NRF_GPIO_PIN_NOPULL,NRF_GPIO_PIN_SENSE_HIGH);

Thanks a for your help !

  • Is there a link with an interrupt vector to enable somewhere may be ?

  • Hi,

    Do you have an external pull resistor on the wakeup pin, or is it connected to something else that is driving it?

    Not sure why you have to trigger idle_state_handle twice, could be that there is some unhandled event/interrupt preventing the device from sleeping (possibly from the UART when the log message is finished transferring, if you are using the UART backend and not using deferred mode?).

    If you can share the full project, it would be easier to help you look for causes of the issues you are seeing.

    Best regards,
    Jørgen 

  • Thanks Jorgen, i found the issue, as dev kit had button management that i removed cause no button on my board, ome gpiote init function was removed, with interrupt management too.  i just had thisto solve the issue:

                    err_code = nrf_drv_gpiote_init();
                    APP_ERROR_CHECK(err_code);
    
                    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);
                    in_config.pull = NRF_GPIO_PIN_NOPULL;
    
                    err_code = nrf_drv_gpiote_in_init(30, &in_config, in_pin_handler);
                    APP_ERROR_CHECK(err_code);
    
                    nrf_drv_gpiote_in_event_enable(30, true);

  • And concerning uart, I have this settings, because i only log with nrf_log_info when i'm connected with Jlink.

    // <i> Log data is buffered and can be processed in idle.

    #ifndef NRF_LOG_DEFERRED
    #define NRF_LOG_DEFERRED 0 // change from 1 to 0 to have message printing in real time

    #ifndef NRF_FPRINTF_ENABLED
    #define NRF_FPRINTF_ENABLED 1
    #endif

    #ifndef NRF_LOG_BACKEND_UART_ENABLED
    #define NRF_LOG_BACKEND_UART_ENABLED 0
    #endif

Related