I am developing application for humidity measurement using nrf51822 evaluation board which uses custom services which i have developed. I have already tested example applications given in sdk. Also my humidity application was able to run upto service discovery. After service discovery the connection gets terminated (reason: BTLE_CONNECTION_TIMEOUT ) due to received packet.<HciEvent: eventCode=0x0A>.
I am debugging my application in Keil µVision. Is single stepping is allowed? I am noob towards debugging. Can anybody help how one should debug application step by step?
If you are using the debugger and stop on a break point, the soft device stack will fail and the connection will go down. You can single step your code up until it needs to interact with the soft device and then the debug session will lock up. It is a bit limiting, but I find you get better at dealing with it over time.
Thanks John. My connection terminates in 2 to 3 seconds after service discovery. Can you suggest me what is happening? These are the logs after completion of service discovery:
=>Serial port read: 04-05-04-00-00-00-08
=>HCI event: BTLE_EVENT_DISCONNECTION_COMPLETE ConnectionHandle: 0x0000, Reason: BTLE_CONNECTION_TIMEOUT
=>Received LL Connection Termination Event, reason 08
=>Lost connection to device. Reason: BTLE_CONNECTION_TIMEOUT
=>Received packet <HciEvent: eventCode=0x0A> - <HciEvent: eventCode=0x0A>
=>Received Link Loss
Is there any document for debugging BLE applications?
I hate to answer a question with a question, but what are you min and max connection intervals, slave latency and connection supervisory timeout settings?
In my application:
Min connection interval: 0.5 sec;
Max connection interval: 1 sec;
Slave latency: 0;
connection supervisory timeout: 4 sec
I think those are OK. I suspect your application is tripping a ASSERT and resetting. I'd change the assert handler so that it doesn't reset and use the debugger to see the file name and line number that is triggering the assert.