<?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>Failed to generate DHKey</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118335/failed-to-generate-dhkey</link><description>Hello, 
 I&amp;#39;m getting this error when trying to connect, which seems to happen after the first SMP Timeout. Most of the time connecting/disconnecting works, deleting bonds etc, but it seem to get into the state. After this it doesn&amp;#39;t matter which device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Jan 2025 13:53:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118335/failed-to-generate-dhkey" /><item><title>RE: Failed to generate DHKey</title><link>https://devzone.nordicsemi.com/thread/520895?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2025 13:53:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:169db2bc-e0f1-4cb0-aa1c-93daee3b20ff</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. I am not able to see how this could happen. Are you able to reproduce this on a DK? If so, can you share the code along with instruction on how to reproduce?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to generate DHKey</title><link>https://devzone.nordicsemi.com/thread/520141?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2025 10:45:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16ba520b-2047-45a2-91d8-ade42f2ea0a1</guid><dc:creator>jerome.sc</dc:creator><description>&lt;p&gt;Also the thread analyser stops working&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to generate DHKey</title><link>https://devzone.nordicsemi.com/thread/519984?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2025 13:49:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55f1f3a8-3d6c-4ea2-8947-68b866d0775d</guid><dc:creator>jerome.sc</dc:creator><description>&lt;p&gt;I&amp;#39;m pretty sure it&amp;#39;s because of the interrupt happening. I pressed the button to put it into pairing mode without tripping the imu interrupt, 10 times and every time it deleted the pairing, advertised and allowed devices to pair again. The next time I pressed the button and set the imu off, which will trigger and interrupt, it failed, and got into this state.&lt;br /&gt;&lt;br /&gt; Even if it fails the first time, it never recovers from this state, unless I power down the device.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to generate DHKey</title><link>https://devzone.nordicsemi.com/thread/519975?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2025 13:35:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:582c4a5d-a616-468f-9bb7-ba0b516c6ea5</guid><dc:creator>jerome.sc</dc:creator><description>&lt;p&gt;Yes you were right as it is going into the smp.c and into the&amp;nbsp;&lt;span&gt;bt_dh_key_gen() function. From this it&amp;#39;s getting the error code -120.&lt;br /&gt;&lt;br /&gt;I can repeat what happening, which I think is that an interrupt from a peripheral is being triggered around the same time it goes into pairing mode. Then I&amp;#39;ll get the&amp;nbsp;E: SMP Timeout, and then&amp;nbsp;E: Failed to generate DHKey .&lt;br /&gt;&lt;br /&gt;Maybe unrelated (although I don&amp;#39;t think it is), but some threads also stop responding in this error state. For example I have a timer that will give a semaphore to a thread to run. When the error condition occurs, the thread stops receiving the semaphore, despite the timer going off.&lt;br /&gt;&lt;br /&gt;I&amp;#39;m using v2.7.0 SDK, and yes pairing for has been working. I did change the pairing process, but I have seen the button problem before, as well as not being able to pair unless reflashing the chip.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to generate DHKey</title><link>https://devzone.nordicsemi.com/thread/519967?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2025 12:47:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:495de705-e9f8-4e4a-8cc3-5178ed40cfe9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I do not recall seeing the &amp;quot;Failed to generate DHKey&amp;quot; error before, and have not found any other references to it here on DevZone. It can be pårinted from a few locations, but I assume you see it printed from &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/8fd9326ae1053ef63e94a24bab0b3f6b715924ed/subsys/bluetooth/host/smp.c"&gt;smp.c&lt;/a&gt;? Can you check that with a debugger? And if so, can you step down into&amp;nbsp;bt_dh_key_gen() and see if you can learn more about what caused it to fail?&lt;/p&gt;
&lt;p&gt;Also, which SDK version are you using? Did LESC pairing work on your product before? If so, which changes did you do when it stopped working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>