help needed to debug nrf51822 application?

sushilk gravatar image

asked 2014-06-09 13:12:51 +0200

Hello all,

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?

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
jldewitt gravatar image

answered 2014-06-09 13:59:05 +0200

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.

edit flag offensive delete publish link more


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?

sushil ( 2014-06-09 14:15:20 +0200 )editconvert to answer

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?

John DeWitt ( 2014-06-09 14:32:49 +0200 )editconvert to answer

PeerAddressType: 1; PeerAddress (MSB): ED2893AA0670; Connection Interval: 20.0ms; Connection Latency: 0; Supervision Timeout: 3000ms; Clock Accuracy: (1); ----------------------------------------------- In my application: Min connection interval: 0.5 sec; Max connection interval: 1 sec; Slave latency: 0; connection supervisory timeout: 4 sec

sushil ( 2014-06-09 14:54:07 +0200 )editconvert to answer

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.

John DeWitt ( 2014-06-09 15:01:20 +0200 )editconvert to answer

Thanks John. I will check assert handler and will update about it. Meanwhile i was searching about connection parameters and saw my logs. I also suspect that error occurred when packet was not able to receive on connection parameter update call. And then hci event [BTLE_EVENT_DISCONNECTION_COMPLETE] occurs. Do you have any Idea about what is the issue?

sushil ( 2014-06-09 15:14:51 +0200 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower


Asked: 2014-06-09 13:12:51 +0200

Seen: 566 times

Last updated: Jun 09 '14