<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pca10059 device won&amp;#39;t pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81584/pca10059-device-won-t-pair-with-twim-enabled-except-in-debug-mode</link><description>I&amp;#39;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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Nov 2021 20:16:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81584/pca10059-device-won-t-pair-with-twim-enabled-except-in-debug-mode" /><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/339099?ContentTypeID=1</link><pubDate>Mon, 15 Nov 2021 20:16:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d361eea-5a0e-471b-8cc1-1eab7f022b6c</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;The primary problem was an issue with the I2C hardware, deceptive because this interface is so &amp;quot;simple&amp;quot;. Turns out the sensor manufacturer&amp;nbsp;used a strong pullup for the I2C lines and probably because the sensor was also being powered from the NRF supply from the dongle, the sensor could not pull the open-collector lines down quite low enough to satisfy Vil of the nRF52840. This was wreaking havoc on all sorts of things, including pairing. The connection to the J-Link was somehow ameliorating this, perhaps by providing another ground path to sink the current. I altered the supply source for the pullups from Vdd_nrf to an arbitrary GPIO pin configured as a high-drive output high, and disabling the UICR dongle fix by completely erasing the flash (clearing the UICR) and setting the board type to PCA10056. Now with the pullups going only to a 1.8V rail instead of a 3V rail the sensor could now satisfy the Vil and things started making sense in the world again. There were a number of other complicating factors, such as my driver for the sensor itself wasn&amp;#39;t quite right, uninitialized pointers and a couple of other things that made it difficult to see the trees from the forest. In any case it&amp;#39;s working now, and I&amp;#39;m on to the next task.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338876?ContentTypeID=1</link><pubDate>Sat, 13 Nov 2021 22:05:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a75c8e1b-2148-4402-8ef1-f7ddac0c0d94</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;Problem still persists but I&amp;#39;ve got more information. Some of the issues I&amp;#39;ve been having had to do with programming the UICR for 3V GPIO - the particular sensor I&amp;#39;m using doesn&amp;#39;t seem to like that (even though it&amp;#39;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&amp;#39;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&amp;#39;t pair 4) In SES, click Target-&amp;gt;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 &amp;quot;Build and Run&amp;quot; vs &amp;quot;Build and Debug&amp;quot;) 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 &amp;quot;connect to Jlink&amp;quot; command do exactly? I&amp;#39;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&amp;nbsp;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?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338659?ContentTypeID=1</link><pubDate>Thu, 11 Nov 2021 20:43:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:309872fc-d7ba-43f4-bd63-a8c0cfba4391</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;same result with both the s113 and s140 softdevices&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338650?ContentTypeID=1</link><pubDate>Thu, 11 Nov 2021 18:29:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46ca4138-00dc-4ce8-afdf-552f3a9f828f</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;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:&amp;nbsp;@retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and fault handler cannot be updated. I&amp;#39;m stumped as to why this error would occur when running without the debugger only. Thoughts as to how to fix this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338598?ContentTypeID=1</link><pubDate>Thu, 11 Nov 2021 14:03:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eea44ca-8b4f-47db-ba95-5a6654034183</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;There can be some glitches on the pins when doing a hard reset, however I don&amp;#39;t see how this should affect the the serial transfer later. Are you sure the twi sensor is reset here when pushing the reset button (and not only the nRF)? Maybe the twi sensor is in a configured state while the nRF52 is trying to configure it.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338471?ContentTypeID=1</link><pubDate>Thu, 11 Nov 2021 06:10:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7a688bb-f69b-4bc7-9e4c-5dc1bbc16648</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;I was able to program the open USB bootloader and MBR using the debug port and then subsequently program the application without attaching the JTAG at all, and the application doesn&amp;#39;t even start. The LF clock is set to XTAL (NRFX_CLOCK_CONFIG_LF_SRC). The memory reads back ok, and I adjusted the placement macros to make room for everything. what am I doing wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338457?ContentTypeID=1</link><pubDate>Thu, 11 Nov 2021 00:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c71bb52-75d6-4450-a78d-d4e939ad8760</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;Well, not really. There&amp;#39;s something about connecting the J-link that causes the I2C interface to start behaving. After performing a Build-&amp;gt;Debug &amp;amp; Run, and then pushing the reset button on the dongle, the before picture is what the I2C interface looks like. Then, doing a Target-&amp;gt;Connect J-link, the I2C interface looks like the after picture.&lt;img alt="before" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2804.before.png" /&gt;&lt;img alt="after" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7288.after.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338401?ContentTypeID=1</link><pubDate>Wed, 10 Nov 2021 14:23:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c60dc15-07cf-4d6e-960d-d5457f3c527d</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;the code is indeed running as evidenced by the active I2C interface. the code interrogates an attached sensor every few ms.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338354?ContentTypeID=1</link><pubDate>Wed, 10 Nov 2021 11:17:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:256148bf-47c4-4280-a59a-7da38df5573c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="apdobaj"]I&amp;#39;ve found that the device doesn&amp;#39;t even advertise outside of the debugger.[/quote]
&lt;p&gt;Does the code start to execute at all? E.g. if you have an LED or similiar you can find out. If yes, do you have any indication where the code is &amp;quot;stuck&amp;quot;?&lt;/p&gt;
&lt;p&gt;If the code does not start, then I suggest to check&amp;nbsp;supply voltage and if pin reset is enabled (that it is pulled high).&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338353?ContentTypeID=1</link><pubDate>Wed, 10 Nov 2021 11:17:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:960f5b36-aff7-480e-9b94-5f17aae85851</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="apdobaj"]I&amp;#39;ve found that the device doesn&amp;#39;t even advertise outside of the debugger.[/quote]
&lt;p&gt;Does the code start to execute at all? E.g. if you have an LED or similiar you can find out. If yes, do you have any indication where the code is &amp;quot;stuck&amp;quot;?&lt;/p&gt;
&lt;p&gt;If the code does not start, then I suggest to check&amp;nbsp;supply voltage and if pin reset is enabled (that it is pulled high).&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pca10059 device won't pair with TWIM enabled, except in debug mode</title><link>https://devzone.nordicsemi.com/thread/338288?ContentTypeID=1</link><pubDate>Wed, 10 Nov 2021 06:32:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71a836b0-35ba-4790-8444-09ae9105bd94</guid><dc:creator>apdobaj</dc:creator><description>&lt;p&gt;I&amp;#39;ve found that the device doesn&amp;#39;t even advertise outside of the debugger. I&amp;#39;ve tried all the tricks like erasing the memory completely, cycling power, etc. When I program the device inside of SES, As soon as I do Target-&amp;gt;connect j-link, the advertising starts.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>