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

Parents
  • Hello,

    So you are in a connection while this happens, is that right?

     

    Can you please try to define "DEBUG" in your preprocessor defines, and set a breakpoint in the error handler in app_error.c. Exactly what line that is on depends on the SDK version. 

     

    Does the DVK from Laird come with an external LFXTAL, or does it use the RC Oscillator? If it uses the RC Oscillator, what settings have you used for it?

     

    Best regards,
    Edvin

Reply
  • Hello,

    So you are in a connection while this happens, is that right?

     

    Can you please try to define "DEBUG" in your preprocessor defines, and set a breakpoint in the error handler in app_error.c. Exactly what line that is on depends on the SDK version. 

     

    Does the DVK from Laird come with an external LFXTAL, or does it use the RC Oscillator? If it uses the RC Oscillator, what settings have you used for it?

     

    Best regards,
    Edvin

Children
  • Hello Edvin,

          I am using the internal RC oscillator with the settings below.

    nrf_clock_lf_cfg_t const clock_lf_cfg =

        {

            .source       = 0,

            .rc_ctiv      = 16,

            .rc_temp_ctiv = 2,

            .accuracy     = 1

        };

    I will try to debug it.

  • Hello Edvin,

            I debug the code. When the code hits the "app_error_fault_handler" function, I get the register content below.

    <error> app: ERROR 8198 [Unknown error code] at E:\nRF5_SDK\examples\ble_peripheral\ble_app_uart\main.c:339
    PC at: 0x00033103
    <error> app: End of error report

    the "app_error_fault_handler" is called from the function above I think

  • Hello,

    (dec) 8198 = 0x2006 = NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN.

     

    This happens because the function sd_power_system_off should not return. When you are in debug mode, it will actually be in a simulated system off state, and this function call may return, and it will return NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN.

     

    Please see the response in this case for some more detailed information.

     

    This leads back to my questions, what SDK and SoftDevice versions do you use? And are you in a connection when this happens, or are you advertising? I suspect this happens when you are advertising, and the advertising timer times out, calling the sd_power_system_off() function, turning off the chip to save power. Try to either extend your advertising timeout, APP_ADV_TIMEOUT_IN_SECONDS, or comment out the sd_power_system_off() call, or the sleep_mode_enter() call, which is the one calling sd_power_system_off(), and see if the issue disappears.

     

    Best regards,

    Edvin

  • 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.

Related