Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52832 "ble_peripheral->ble_app_uart" stops working

Hello,

        I am trying to evaluate the "ble_app_uart" in the "nRF5_SDK" and I am using "DVK-BL652-SA-01" development board from LAIRD.

        The example works fine for a while. After some time, the application stops working. I can not even see the BLE device with my phone.

        What could be the problem ? Any idea ?

Best Regards

  • Hello Edvin,

    I'm using nRF5 SDK v15 and S132 as a softdevice with nRF52832 IC. It happens when there is no connection.

    Sleep mode or syetem power off modes are quite nice feature. I is nice to have them.

    How about If I wanted to wake up the MCU from sleep mode, What do I need to do ? 

    For instance, I need to wake up the MCU by any gpio interrupt. What do I need to do ? Which example do I need to use ?

  • RTFM. There are not that may ways to wake an NRF chip from SYSTEM OFF.

    Waking from normal sleep is automatic, if the interrupt was enabled in the NVIC. See GPIOTE example.

  • How about Advertisement timeout. I can not find the below definition. Where can I find and modift it ?

    APP_ADV_TIMEOUT_IN_SECONDS

  • I didn't know what SDK version you used, so I gambled on the APP_ADV_TIMEOUT_IN_SECOND variable name. In SDK 15 this is called APP_ADV_DURATION, and is defined in units of 10ms. I guess it is defined as 18000 (=180s). 

     

    Yes. The sd_power_system_off() is a quite nice function, but it basically turns off the entire chip. A wakeup will be more or less like a reset, or power cycling the device. And also, you can't use e.g. the UART when you are in system off mode.

     

    There are a couple of ways to wake up from System_off mode. Either an interrupt on a GPIOTE pin, or alternatively, the NFC. Most of the ble_peripheral examples are set to wake up from a button press. You can play around with this by setting APP_ADV_DURATION to something short, like 2000 (=20sec), and see that it will turn off after 20 seconds, unless it has entered a connection. Then you can press one of the buttons, and see that it will start up again, and start advertising.

     

    However, you can not continue to send messages over the UART while in system off mode. It is intended as a deep sleep power saving mode for when the device is not in use, but can be turned back on with an interrupt from a GPIO or the NFC.

     

    Best regards,

    Edvin

  • Hello Edvin,

           I took a look at the "buttons_leds_init()" function. it works as you said. However, it is different from the link.

    in the link, the setup is something like below.

        nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true); 
        config.pull = NRF_GPIO_PIN_PULLUP;
        err_code = nrf_drv_gpiote_in_init(3, &config, pin_event_handler);
        nrf_drv_gpiote_in_event_enable(3, true);

    When I add the code above to my main code. it never wakes up the MCU ?

    Is there another think I need to do ? I assigned the pin "3" as the inturrupt pin. 

Related