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

Application Code hangs after SUCCESSFULLY sending notification to central

Hi All. 

I am writing an application that has several notifiable characteristics, and up until now they have been sending data just fine, however the other day I was cleaning up some code and i decided to change the function that handles the notification process a little bit, make it more robust. I was previously just passing in the data i wanted to be sent along with its length and then inside the function deducing what characteristic handle was appropriate based on the length of the data, but then I should really just pass the appropriate handle along to the function also so i don't have to do all that deduction and can just point to the value thats' passed through. anyways Now the notification goes through to the central and they receive the data but a second or two later peripheral hangs on a hardfault (disassembly shows it is at address 0xa60) but i haven't the slightest Idea why. 

Some more background: I was initially calling the function from inside a timeout handler that interrupts every 100ms, and I saw in another post that that might be screwing with the softdevice so I moved the function call to inside main (call only happens when the appropriate flag has been raised). I still get the hardfault even when the call is in main and I can see from some debug lines that I have added that the notification call goes through fine, sd_ble_gatt_hvx returns NRF_SUCCESS, then the application runs through main 5-6 more times before the hardfault appears. Weird thing is I can perform other gatt operations just fine, writing and reading go off without a hitch.

Also, I dont think this is the issue but it may be relevant, these characteristics were previously indicatable instead of notifiable, but I believe I have changed the properties appropriately in the service initializer. Could this be the issue? could the softdevice be waiting for a confirmation from the central and then hang?

I am working with the nrff52832, using softdevice s132 V 6.1.1, sdk 15.3.0, and Segger Embedded Studio

Really at a loss on this one and any help that can be offered is appreciated.

 

Thanks,

Patrick

Parents Reply Children
No Data
Related