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

ble_app_uart getting stuck when connected

I was doing some works with ble_app_uart in nrf51822. I have added some modification in the main function according to my requirements. What i have to do is, read data over the ble and do some works according to the received data. Now i am facing some problem. The problem is that when i connect my app to the nrf51822 the controller stops the execution of my code and waits for the ble data as long as the device is connected. when the device is disconnected it resumes the normal execution. I have to make this device to execute my code while the device is connected to the app. How can i achieve this thing? Some times the nrf51822 is automatically restarts. Why this is happening? What is this power_manage() function doing?

Parents
  • that means that your code has some other problem that triggers when your device connected. By calling power_manage when you get connected does not solve problem, it will only make the CPU sleep and stop it from executing the logic that is creating the problem. There is no problem in the code you posted(other than calling power_manage when new_data is true). But it very obvious that there is lot more to your application than what you have posted. So debug your code and see why a new connection is causing problems. Set breakpoints and see where exactly the device gets disconnected and why.

Reply
  • that means that your code has some other problem that triggers when your device connected. By calling power_manage when you get connected does not solve problem, it will only make the CPU sleep and stop it from executing the logic that is creating the problem. There is no problem in the code you posted(other than calling power_manage when new_data is true). But it very obvious that there is lot more to your application than what you have posted. So debug your code and see why a new connection is causing problems. Set breakpoints and see where exactly the device gets disconnected and why.

Children
No Data
Related