<?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>Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86717/time-synchronization-with-alternating-masters</link><description>Dear members, with success I implemented the time synchronization example from the nRF5 SDK guide. This example works perfect for a single master, but what if the master changes? When I check my scope it will show that the new master starts sending the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 May 2022 08:42:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86717/time-synchronization-with-alternating-masters" /><item><title>RE: Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/thread/367993?ContentTypeID=1</link><pubDate>Mon, 16 May 2022 08:42:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0abca73d-e0de-4957-838f-2b93e16714ad</guid><dc:creator>EgbertK</dc:creator><description>&lt;p&gt;Hello Audun,&lt;/p&gt;
&lt;p&gt;With the version you referred to in the previous post the switching works great. I will try to implement this in my own source and see if I can switch the master also. Thanks so far for your help and the explanation!&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Egbert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/thread/366844?ContentTypeID=1</link><pubDate>Mon, 09 May 2022 07:41:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbf91e90-9610-4deb-a5f5-99d9dbd49f78</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;No problem!&lt;br /&gt;I think I was looking at a different branch than you.&lt;/p&gt;
&lt;p&gt;In the master branch, the equivalent of &amp;quot;m_master_counter_diff&amp;quot; is &amp;quot;m_master_counter&amp;quot;. These variables keeps track of the transmitter/master counter value. This is normally 0 on the transmitter side, except for when a device used to be a receiver and switches to be a transmitter. &lt;/p&gt;
&lt;p&gt;If this value is not the same on transmitter and receiver, and you set a trigger using &lt;span class="pl-en"&gt;ts_set_trigger&lt;/span&gt;(), the triggering time might be in the past, or far in the future.&lt;/p&gt;
&lt;p&gt;When changing from receiver to transmitter mode, you can either reset the m_master_counter variable (which would cause a potentially large leap in the timing), or take it into account here as a transmitter:&lt;br /&gt;&lt;a href="https://github.com/nordic-auko/nRF5-ble-timesync-demo/blob/master/nRF5_SDK_16.0.0_98a08e2/examples/common/time_sync.c#L544"&gt;https://github.com/nordic-auko/nRF5-ble-timesync-demo/blob/master/nRF5_SDK_16.0.0_98a08e2/examples/common/time_sync.c#L544&lt;/a&gt;&lt;br /&gt;You can try to reset the variable first and see if this works?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Audun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/thread/366759?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 14:31:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b77d5df-56d2-42d3-8953-fd049e799243</guid><dc:creator>EgbertK</dc:creator><description>&lt;p&gt;Hello Audun,&lt;/p&gt;
&lt;p&gt;Thank you for your reply!&lt;/p&gt;
&lt;p&gt;I did the diff on my side it all compiles ok. But I think I did something wrong, since I am not able to switch masters. All the steps as described work fine, except for the last step (step 6) since only the new master starts to toggle, the new slave does not toggle its GPIO.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you tell me the reason why you added &amp;quot;m_master_counter_diff&amp;quot; and where to declare this variable?&lt;/p&gt;
&lt;p&gt;regards Egbert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/thread/366369?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 07:55:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b86f08b8-2cd5-4486-bb73-d4050d462704</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;I thought about it some more and decided the previous diff was a not so good workaround. This one should work better, as it doesn&amp;#39;t reset the &amp;quot;m_master_counter_diff&amp;quot; variable. Resetting this variable would cause a jump in timestamps, which is probably not desirable.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Audun&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5164.stop.diff"&gt;devzone.nordicsemi.com/.../5164.stop.diff&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/thread/366286?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 14:08:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3b61bf8-ab91-4ee8-97cd-af663a93f85a</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Hi Egbert,&lt;/p&gt;
&lt;p&gt;I suspect there is state information still lingering after stopping the transmitter. Could you try the attached diff on your side?&lt;/p&gt;
&lt;p&gt;My test was&amp;nbsp; the following, based on 2 x nRF52-DK.&lt;/p&gt;
&lt;p&gt;1) Press button 1 on DK #1 to assign this role of transmitter&lt;/p&gt;
&lt;p&gt;2) Observe that both DKs toggle GPIO in unison&lt;/p&gt;
&lt;p&gt;3) Press button 1 on DK #1 to stop transmitting&lt;/p&gt;
&lt;p&gt;4) Wait until DK #2 reports desynchronization (GPIO stops togglnig)&lt;/p&gt;
&lt;p&gt;5) Press button 1 on DK #2 to assign this role of transmitter&lt;/p&gt;
&lt;p&gt;6) Observe that both DKs toggle GPIO in unison&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/stop.diff"&gt;devzone.nordicsemi.com/.../stop.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Audun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/thread/365945?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 10:49:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:814dddc1-937c-449b-8e72-00dab1b28725</guid><dc:creator>EgbertK</dc:creator><description>&lt;p&gt;Hello Kenneth,&lt;/p&gt;
&lt;p&gt;I was not able to find a solution to this item. Did you managed to contact the creator of this example?&lt;/p&gt;
&lt;p&gt;Regards, Egbert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/thread/362383?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 13:49:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49a8c6ca-c169-45db-bb17-b6d7448a8437</guid><dc:creator>EgbertK</dc:creator><description>&lt;p&gt;Hello Kenneth,&lt;br /&gt;&lt;br /&gt;that would be great. If I find the solution before Easter I will let you know ;).&lt;br /&gt;&lt;br /&gt;Regards, Egbert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time synchronization with alternating masters</title><link>https://devzone.nordicsemi.com/thread/362368?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 13:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff9ed9bb-0176-4175-b388-8584ed3b9d91</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The example is not an official release, but I can try to ping the person that made the example if he can take a look. He is currently out of office until after Easter though.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>