ble_app_uart fails after 3 minutes.

hello nordic team
I ran the ble_app_uart example in sdk 15.3.0 on nrf52832. When i add  printf("\r\n%d\r\n",15); to the code as follows, the program prints 15 to the serial screen for 3 minutes. But then it stops. The same result occurs when I add a 1 second delay. When I debug it stops at break condition. I want to receive data from a sensor and send it via serial. So how can i solve my problem.


Best regards
for (;;)
{
printf("\r\n%d\r\n",15);
idle_state_handle();
}

  • Hello,

    I ran the ble_app_uart example in sdk 15.3.0 on nrf52832. When i add  printf("\r\n%d\r\n",15); to the code as follows, the program prints 15 to the serial screen for 3 minutes. But then it stops.

    Do you connect to anything during this time?
    The default ble_app_uart behavior is to go to SYSTEM_OFF sleep if the advertising times out, typically defined to 180 seconds.
    If you are in a debugging session when this happens it will stop at a breakpoint, since the debugger will not let the device got to SYSTEM_OFF when it is in control of the CPU.

    When I debug it stops at break condition.

    Please note that you may not use breakpoints as usual in combination with the SoftDevice - a breakpoint will cause the debugger to halt to CPU, which will make the SoftDevice miss it's timing critical deadlines. In turn, this will cause the SoftDevice to assert immediately upon resuming the program.

    Please also make sure that you have DEBUG defined in your preprocessor defines, like shown in the included image:

    This will make your logger output a detailed error message whenever a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK.

    Best regards,
    Karl

Related