<?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>NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93094/nrf_timer_task_capture4-of-timer4-is-permanent-at-the-same-value</link><description>I am facing a problem. Two sensors are triggering with data_ready pins and a timer value is captured upon the event. But the value can be stored only in RAM if a context switch happens. But this depends on the processor usage. Therefore, it can happen</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Nov 2022 13:59:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93094/nrf_timer_task_capture4-of-timer4-is-permanent-at-the-same-value" /><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394726?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 13:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb1ef775-4907-4759-89a2-1690a38deb87</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I was just about to ask about that. I see channel 0 and 1 are used here: &lt;a href="https://github.com/wiesener/nRF5-ble-timesync-demo/blob/master/nRF5_SDK_14.2.0_17b948a/examples/common/time_sync.c#L616"&gt;https://github.com/wiesener/nRF5-ble-timesync-demo/blob/master/nRF5_SDK_14.2.0_17b948a/examples/common/time_sync.c#L616&lt;/a&gt;. Thanks for the update. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394719?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 13:45:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:415db46e-9674-4c72-bdbe-b89acbdd7c20</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;It is channel 1!&lt;/p&gt;
&lt;p&gt;No they are chaning and I guess I found the issue. The timesync example used fixed PPI channels 1 and 3 for rx and tx. Hence I need to allocate a channel different than these channels.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394713?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 13:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7084c774-1bc2-483e-a6b1-36d789e9b87b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Interesting. So, it would probably be more interesting to look at the PPI registers before and after enabling the timeslot. &lt;/p&gt;
&lt;p&gt;Can you check which ppi channel the driver allocates to you? The following channels are reserved to the Softdevice:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Mask of PPI channels reserved by the SoftDevice when the SoftDevice is enabled. */
#define NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK  ((uint32_t)( \
      (1U &amp;lt;&amp;lt; 17) \
    | (1U &amp;lt;&amp;lt; 18) \
    | (1U &amp;lt;&amp;lt; 19) \
    | (1U &amp;lt;&amp;lt; 20) \
    | (1U &amp;lt;&amp;lt; 21) \
    | (1U &amp;lt;&amp;lt; 22) \
    | (1U &amp;lt;&amp;lt; 23) \
    | (1U &amp;lt;&amp;lt; 24) \
    | (1U &amp;lt;&amp;lt; 25) \
    | (1U &amp;lt;&amp;lt; 26) \
    | (1U &amp;lt;&amp;lt; 27) \
    | (1U &amp;lt;&amp;lt; 28) \
    | (1U &amp;lt;&amp;lt; 29) \
    | (1U &amp;lt;&amp;lt; 30) \
    | (1U &amp;lt;&amp;lt; 31) \
  ))&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394705?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 13:24:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ec2245b-6bb0-4203-ad1a-72e5a4e4c4ae</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;When I reenable the ppi connection after the code lines.&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;		APP_ERROR_CHECK(sd_radio_session_open(radio_callback));

		APP_ERROR_CHECK(request_next_event_earliest());&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrfx_ppi_channel_alloc(&amp;amp;m_ppi_channel2);
nrfx_ppi_channel_assign(m_ppi_channel2,
						 nrfx_gpiote_in_event_addr_get(MAGMTR_DRDY),
						 nrfx_timer_task_address_get(&amp;amp;m_timer4, NRF_TIMER_TASK_CAPTURE5));
nrfx_ppi_channel_enable(m_ppi_channel2);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It starts to capture correctly. So this means that somehow the call of sd_radio_session_open deletes the channel assignment.&lt;/p&gt;
&lt;p&gt;Kind regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394703?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 13:21:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73c08e94-4191-46f5-8ce1-ba1257395c67</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Yes it can be triggered and the CC5 is updated.&lt;/p&gt;
&lt;p&gt;@Edit: No only TIMER0 is used for the Radio according to the example and TIMER4 is used for the overall clock. The rest is not used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394697?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 13:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7757239-c4fa-47e4-84fc-0d76e04f4d0d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks. Looks like you are using Eclipse, are you able to trigger the capture 4 task from the peripheral viewer when the CPU is halted and then refresh CC[4] to see if the register gets updated?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1667912975745v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Are you using the same TIMER instances as shown here for the sync mechanism: &lt;a href="https://github.com/wiesener/nRF5-ble-timesync-demo/blob/master/nRF5_SDK_14.2.0_17b948a/examples/ble_peripheral/ble_app_uart/main.c#L710"&gt;https://github.com/wiesener/nRF5-ble-timesync-demo/blob/master/nRF5_SDK_14.2.0_17b948a/examples/ble_peripheral/ble_app_uart/main.c#L710&lt;/a&gt; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394675?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 12:27:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c7b124f-db75-4842-9ecc-b3033dcc21fb</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Okay I set a breakpoint before the call and afterwards. But cannot see any big difference except that the CC is incremented for CC1 CC3 and CC5. But afterwards only CC3 and CC1 get incremented. And CC5 stays constant.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve double checked that the interrupt is still coming but it does not trigger a capture for CC5 anymore.&lt;/p&gt;
&lt;p&gt;Before:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/screenshot_5F00_before_5F00_radio_5F00_callback.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/screenshot_5F00_after_5F00_radio_5F00_callback.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Constantin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394597?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 08:32:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67447f9e-d13d-4564-bf1e-9357aa5c5da4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;OK, why don&amp;#39;t you take a screenshot of the TIMER4 registers before and after you have started the timesync routine?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394592?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 08:23:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f1140a2-1fc1-4abc-8118-85be4e453400</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;No I&amp;#39;ve double checked it the radio callback is only acting on the TIMER0 instance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394591?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 08:22:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66a33bb1-e047-474d-9fb6-9db8543c245e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, I guess the timesync code and you application may be trying to use the same timer instance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/394587?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 07:54:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28bcb351-d503-4916-905e-c7741c1b29ad</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Okay I did a bit more investigation and found out that it only happens when I start&amp;nbsp; our timesync routine which calls:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;		APP_ERROR_CHECK(sd_radio_session_open(radio_callback));

		APP_ERROR_CHECK(request_next_event_earliest());&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The code is from here:&lt;br /&gt;&lt;a id="" href="https://github.com/wiesener/nRF5-ble-timesync-demo"&gt;https://github.com/wiesener/nRF5-ble-timesync-demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If I comment these lines out and start a measurement everything works fine. But when I call these lines the capturing is stopped. Any guesses why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/392319?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 08:50:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98b816a5-8897-4b56-b733-0a5e659558d2</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Can you take a screenshot of the TIMER4 peripheral registers when you see this random value?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/392282?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 06:32:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1754036-dc93-4da3-8b3e-bea4d34749f2</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;I always see the same value. It seems to be a random value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value</title><link>https://devzone.nordicsemi.com/thread/391852?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 11:14:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3886c00-f2ef-4dbf-8faf-1f809445bfab</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Capture register 4 and 5 should be available if you use TIMER4 as you can see from the table here:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1666350828440v1.png" alt=" " /&gt;&lt;/p&gt;
[quote user=""]I&amp;#39;ve tried to use another capture channel of the same timer but somehow the NRF_TIMER_TASK_CAPTURE4 of timer4 is permanent at the same value[/quote]
&lt;p&gt;What value do you see? &lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>