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
  • Problem still persists but I've got more information. Some of the issues I've been having had to do with programming the UICR for 3V GPIO - the particular sensor I'm using doesn't seem to like that (even though it's powered off the 3V Vdd_nrf supply, and the SDA and SDL lines are of course open collector). Once I set the board type to PCA10056 instead of PCA10059 the I2C interface started working as expected. But the issues with advertising without the debugger persist. It seems the following sequence might be the critical clue but I have no idea what it means:1) Build and debug (I've populated the JTAG connector on the PCA10059 board and am using a JTAG mini). 2) Dongle advertises and connects correctly. 3) Stop the debugger and try to pair the device through the Android settings but the device either never shows up in the advertising list or doesn't pair 4) In SES, click Target->Connect J-link 5) Device connects and pairs as normal. None of the other methods of programming the firmware (using the nRF Connect for desktop full erase and write, or using "Build and Run" vs "Build and Debug") result in the device showing up in the Android advertising list, although it appears and pairs without issue using nRF Connect for Android. what does that "connect to Jlink" command do exactly? I've also found an issue that makes the softdevice not run: When the code calls nrf_sdh_enable_request, sd_softdevice_enable is returning a NRF_ERROR_INVALID_STATE error code. I can bypass this error if I modify nrf_sch.c to not run the enable if the softdevice is already enabled using sd_softdevice_is_enabled. Could this be part of the issue?

Reply
  • Problem still persists but I've got more information. Some of the issues I've been having had to do with programming the UICR for 3V GPIO - the particular sensor I'm using doesn't seem to like that (even though it's powered off the 3V Vdd_nrf supply, and the SDA and SDL lines are of course open collector). Once I set the board type to PCA10056 instead of PCA10059 the I2C interface started working as expected. But the issues with advertising without the debugger persist. It seems the following sequence might be the critical clue but I have no idea what it means:1) Build and debug (I've populated the JTAG connector on the PCA10059 board and am using a JTAG mini). 2) Dongle advertises and connects correctly. 3) Stop the debugger and try to pair the device through the Android settings but the device either never shows up in the advertising list or doesn't pair 4) In SES, click Target->Connect J-link 5) Device connects and pairs as normal. None of the other methods of programming the firmware (using the nRF Connect for desktop full erase and write, or using "Build and Run" vs "Build and Debug") result in the device showing up in the Android advertising list, although it appears and pairs without issue using nRF Connect for Android. what does that "connect to Jlink" command do exactly? I've also found an issue that makes the softdevice not run: When the code calls nrf_sdh_enable_request, sd_softdevice_enable is returning a NRF_ERROR_INVALID_STATE error code. I can bypass this error if I modify nrf_sch.c to not run the enable if the softdevice is already enabled using sd_softdevice_is_enabled. Could this be part of the issue?

Children
No Data
Related