pca10059 device won't pair with TWIM enabled, except in debug mode

I've based my code upon the HIDS keyboard example and added code to support an attached polled sensor with I2C interface. The device will pair with the Android phone just fine when using the debugger through a JTAG mini, but I need to disable the TWIM interface if I want the device to pair outside the debugger. Do I need to change priority settings somehow?

Parents
  • OK, using the blue LED I was able to track down where the failure occurs - the call to nrf_sdh_enable_request is erroring out when it tries to enable the softdevice and returns the following error: @retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and fault handler cannot be updated. I'm stumped as to why this error would occur when running without the debugger only. Thoughts as to how to fix this?

Reply
  • OK, using the blue LED I was able to track down where the failure occurs - the call to nrf_sdh_enable_request is erroring out when it tries to enable the softdevice and returns the following error: @retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and fault handler cannot be updated. I'm stumped as to why this error would occur when running without the debugger only. Thoughts as to how to fix this?

Children
No Data
Related