Sleep mode nrf52 DK

Hello, by usingnrf52832 DK and testing some examples i found out that the example peripheral UART was not going like I wanted to do. He is going to sleep mode after 3 minutes I think and I don't know why. I would like to know how to take off because when  I'm using my app I would like to see my example constantly in my nrf correct and to make it appear I have to click on the reset button. I already try to change the APP_DURATION from 18000 to 0 but it doesn't work.  THX in advance

Parents
  • Hello,

    You are correct that the default behavior of the BLE NUS example is to go into SYSTEM_OFF sleep when the advertising duration is expired. You could see this happen in the advertising's event handler for the IDLE event.

    I'm using my app I would like to see my example constantly in my nrf correct and to make it appear I have to click on the reset button.

    If you would like to keep the device advertising for an indefinite time you will need to change the advertising duration to unlimited by setting the APP_ADV_DURATION to 0. You will also need to change which flag your device is advertising with from the default limited discoverability to general discoverability.

    APP_DURATION from 18000 to 0 but it doesn't work.

    Please elaborate on how it does not work. What are you observing and how does it diverge from what you would have expected? Does the application suddenly reset, or does it advertise for a certain time before going to SYSTEM_OFF sleep regardless of your APP_ADV_DURATION being set to 0?

    Best regards,
    Karl

  • Hello Karl, thank you so much for your quick reply. Actually, I don't see the program in the app anymore when I put the duration to 0. When you are talking about the flag where can I change that? Thank you it is maybe wh it isn't working

  • Hello again,

    I saw the app when I'm pressing after sending the program that I wanted in the button reset. 

    When I'm making build and run I can't see the program but when I do build and debug and play execution, I see the device in the app constantly without sleep mode

  • lm said:
    I saw the app when I'm pressing after sending the program that I wanted in the button reset. 

    I am sorry but I do not understand what you mean to tell me here, could you rewrite this explanation?

    lm said:
    When I'm making build and run I can't see the program but when I do build and debug and play execution, I see the device in the app constantly without sleep mode

    Ok, could you show me your logger output of both situations?
    I am especially interested in seeing the logs for the scenario in which you program the device and do not see any advertising happening.

    Best regards,
    Karl

  • Hello, i just tested things. I have to see the app to send at first the blinky program "activate" or to take off the sleep mode I think, then I send the peripheral uart program that I want and I can see my Module in my app and I don't why i have this problem. 

  • It seems that you are encountering a fatal error.
    Please make sure to 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.
    You may then check the returned error code against the API Reference documentation for the function that returned the error, to see what went wrong and how to fix it.

    Best regards,
    Karl

Reply
  • It seems that you are encountering a fatal error.
    Please make sure to 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.
    You may then check the returned error code against the API Reference documentation for the function that returned the error, to see what went wrong and how to fix it.

    Best regards,
    Karl

Children
Related