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

return error when press BUTTON_0 on ble_app_uart project

Dear Experts:

Hardware Version :Nordic PCA 10040 1.2.4 

SDK Version: nRF5_SDK_15.3.0

Project: ble_app_uart

None code will be modified in the ble_app_uart project. First build program,then press the 'start/stop debug session' button to start project under debug mode. After the project running,  press BUTTON_0 which labeled  'Button_1' in board. The project will stop and popup error. 

I analyse this issue simply: when press BUTTON_0, BSP_EVENT_SLEEP event will be captured and processed. In the process function sleep_mode_enter(), the error would be return in calling sd_power_system_off and the error code is 0x00002006.  In this project, there is no error when pressing other button.

But in project ble_app_bps, there is no this issue when pressing BUTTON_0.  

Please help me to check this problem: why the error is returned  when pressing BUTTON_0 in ble_app_uart project. 

  • The project will stop and popup error

    So what error, exactly, does it pop up?

    Presumably, this is an error from your IDE ?

    If you're on Windows, you can capture a screenshot of the current window - eg, the error message - by pressing Alt+PrintScreen.

    when press BUTTON_0, BSP_EVENT_SLEEP event will be captured and processed

    So that puts the CPU to sleep.

    Putting the CPU to sleep will make the debugger lose its connection to the target;  so what you describe sounds like expected behaviour - not an error at all?

  • My description may not be very exactly . Please check the blow snapshot :

    In my opinion, it may not  be the right behavior :

    1. In ble_app_bps project, the same error can't occur when pressing BUTTON_0.

    2. in ble_app_uart project, the same error can't occur when pressing other buttons.

  • Hi

    This post explains what happens in system off mode in debug mode. The reason ble_app_uart crashes when you set it to sleep in debug mode is that the emulated system off goes into a loop within the UART files in the SDK which I assume conflicts with the UART application and causes the error you're experiencing. The sleep function works just fine in normal mode.

    Best regards,

    Simon

Related