<?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>Modifications to the &amp;quot;wireless timer synchronization&amp;quot; example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73014/modifications-to-the-wireless-timer-synchronization-example</link><description>Hello, 
 at the moment I am working on a project with a nRF52840DK as central and multiple nRF52DKs as peripherals. The code on the central is based on the &amp;quot;ble_app_uart_c&amp;quot; example and the code on the peripherals is based on the &amp;quot;ble_app_uart&amp;quot; example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Mar 2021 15:21:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73014/modifications-to-the-wireless-timer-synchronization-example" /><item><title>RE: Modifications to the "wireless timer synchronization" example</title><link>https://devzone.nordicsemi.com/thread/301503?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 15:21:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:329250e9-50e4-49c7-9142-8a387e5e71d6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Michael,&lt;/p&gt;
&lt;p&gt;I am glad to hear you found and solved the issue. Thanks for letting me know.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifications to the "wireless timer synchronization" example</title><link>https://devzone.nordicsemi.com/thread/301424?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 12:30:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:547bdbe8-0aae-4c81-a194-671896dc9705</guid><dc:creator>Michael01101</dc:creator><description>&lt;p&gt;Hello Einar Thorsrud,&lt;/p&gt;
&lt;p&gt;thank you very much for your reply.&lt;/p&gt;
&lt;p&gt;First of all, I want to apologize for my unprofessional approach to solve my issue by ignoring error codes. I should know that better. I am sorry for that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you said, the problem was caused by calling timers_capture() from two different places.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your help and your reminder about blindly ignoring error codes.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifications to the "wireless timer synchronization" example</title><link>https://devzone.nordicsemi.com/thread/300939?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 13:10:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6794f42a-0f29-4894-be12-be476fd66ba4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Question 1: What does &amp;quot;not thread-safe&amp;quot; mean in this case?[/quote]
&lt;p&gt;It means that you cannot make calls here from different threads or interrupt priorities as that can cause unexpected behavior, this is using a physical resource after all. So the check that is failing is intended to fail when it is detected that a second thread is using this function at the same time. Think of&amp;nbsp;m_timestamp_capture_flag as a semaphore, and this code checks that the semaphore is not allready taken, and if it is, it is an error.&lt;/p&gt;
[quote user=""]Question 2: Are there any side effects, which I sould be aware of?[/quote]
&lt;p&gt;There is a lot happening in the&amp;nbsp;timers_capture() function, and depending on where the first one is when the second call happens a lot of things can happen. The point is that this *will* cause problems, and is why the check is there. You just need to make sure to avoid this problem. In practice that will be by either calling it form only one place or always calling it from the same interrupt priority.&lt;/p&gt;
[quote user=""]Question 3: Is it okey to comment this out, when I am not using any GPIOs?[/quote]
&lt;p&gt;Blindly ignorring errors is never a good idea. Have you debugged in the implementation of ts_set_trigger() to see exactly why it fails in this case? And is that something you can explain and know is not a problem? If so, you can specifically ignore that error code. But never ignore an error without knowing it is not a problem.&lt;/p&gt;
[quote user=""]Question 4: &lt;span&gt;Are there any side effects, which I sould be aware of?&lt;/span&gt;[/quote]
&lt;p&gt;I have no way to know. I do not know what happens in your application. But again, just ignoring error codes and hoping for the best is a very bad idea and a great way to cause problems for yourself further down the line.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>