<?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>When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12413/when-can-the-packetptr-register-be-updated</link><description>I am using the radio in the nRF52832 to support a custom protocol. I would like to send two packets in a row, each with different payloads, on the same frequency. When can I safely update the PACKETPTR register to point to the new packet contents? After</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Mar 2019 03:05:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12413/when-can-the-packetptr-register-be-updated" /><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/176843?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 03:05:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:860d725d-d1f8-4ead-b051-1ba65e198548</guid><dc:creator>jane_song</dc:creator><description>&lt;p&gt;Absolutely!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/176842?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 03:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da90dbb2-2588-4997-bc5f-e157814e733f</guid><dc:creator>jane_song</dc:creator><description>&lt;p&gt;Hi Martjin,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Absolutely!&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;I saw your point recently and I also agreed with your&amp;nbsp;&amp;nbsp;&lt;span&gt;sequence:&amp;nbsp;set PACKETPTR -&amp;gt; trigger START -&amp;gt; wait for for ADDRESS event -&amp;gt; set PACKETPTR -&amp;gt; do START again via SHORT after END event.It is&amp;nbsp;efficient to disable the radio between each transferring and&amp;nbsp; receiving.When using the shortcut of end_start for fast continuous receiving and consider the delay of&amp;nbsp;kernel entering isr handler,it seems safe to reconfigure the PACKETPTR on address event for next packet.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46978?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 13:59:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82985346-6c50-46bb-b663-f64fa5b0f1e3</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;great! thank you for confirming!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46977?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 13:14:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84062e69-89c7-43e9-b704-6fe5f48ab992</guid><dc:creator>abkirchhoff</dc:creator><description>&lt;p&gt;Thanks Aryan for looking into this question.This information is very useful. Thanks Martijn for you participation as well.&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t mention it before, but I am sending packets to a nRF24L01+, which limits me to 32 byte payloads. I am hoping to send two consecutive packets to the nRF24L01+ as it has a 3 packet FIFO, and with this new information, it looks like the nRF52832 will be able to do so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46976?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 12:53:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fa115e8-333c-44f9-a9e3-e58423257460</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;@abkirchhoff : It should be ok to use END for RX as well as TX, as long as we have a CRC &amp;gt; 0 byte. If the CRC is 0 byte I do not think we can guarantee that the last byte received at END is moved to RAM before the END event has reached to the CPU. I assume that the PS has written DISABLED to make it simple and safe keeping BLE in mind and forgot that RADIO does not need to be disabled for every transaction.&lt;/p&gt;
&lt;p&gt;@Martijn: The PACKETPTR is latched (double buffered) on START task, i.e. the EasyDMA stores a copy of the register on START. So you were right, we can update it any number of times before TASK_START and value at the time of START task will be latched to be used by EasyDMA.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46974?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 11:23:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30fd502c-ac66-4efd-a6c2-7315bce143a9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You have a point Martijn, I will now contact the engineer directly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46968?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 09:18:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51eddeac-f715-4029-b834-8861532b49d8</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;You can transfer multiple packages with minimum delay between them, you don&amp;#39;t have to disable the RADIO before starting another transfer. disabling the radio between each transfer, when you have multiple messages to send, is not very efficient.&lt;/p&gt;
&lt;p&gt;I actually did not find anything in the PS that sais have to wait for the DISABLED event before updating the PACKETPTR. It only sais EASYDMA is finished when the DISABLED event occures. It does not say the PACKETPTR can only be set after a DISABLED event. It sais the PACKERPTR needs to be set before triggering the START task.&lt;/p&gt;
&lt;p&gt;It would be very weird to use the END-START short when we can&amp;#39;t even update the PACKETPTR in between. Then we can only send the same package again, or overwrite a previous received message, using that short.&lt;/p&gt;
&lt;p&gt;If we both interpret the PS in different ways then I would like you to ask the engineer who designed it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46975?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 08:46:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6eee6e2-ebb9-405a-8c07-e6dc8055edd2</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Martijn,&lt;/p&gt;
&lt;p&gt;This is what is written in PS
If the PACKETPTR is not pointing to the Data RAM region, an EasyDMA transfer may result in a HardFault
or RAM corruption.&lt;/p&gt;
&lt;p&gt;So it may or may not result in hardfault and the test is not very reliable way to test what you are saying. Also when the engineers have specially written specially that we should wait for DISABLED event, then I am sure they must have some concerns or possible race conditions that could happen if we do not do so.  It is possible that the way you update PACKETPTR works for you in your use case possibly because of the size of smaller payload? or maybe because of other factors. But the question what do you gain by updating the PACKETPTR earlier than what I am recommending? Does it result in better throughput?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46973?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 08:21:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:820c9c4d-45ad-4de3-aa39-b66ec9641b20</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;An easy test would be to set the PACKETPTR to a non RAM address after the START task.
If the PACKTERPTR would have any effect it should cause a hardfault. But you should see no error and the RADIO just works prefectly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46972?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 08:15:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:321779e3-6fe1-4026-bc0e-5722a52ad7d0</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;It even sais this in the nrf52 PS:&amp;quot;As illustrated in Figure 1, the RADIO&amp;#39;s EasyDMA utilizes the same PACKETPTR for receiving and transmitting packets. The CPU should reconfigure this pointer every time before the RADIO is started via the START task.&amp;quot;&lt;/p&gt;
&lt;p&gt;I read this as PACKETPTR is read and taken over when start task is triggered. changing the PACKETPTR after the START task has been triggered has no effect. So: set PACKETPTR -&amp;gt; trigger START -&amp;gt; wait for for ADDRESS event -&amp;gt; set PACKETPTR -&amp;gt; do START again via SHORT after END event. This is a perfectly safe sequence. This is the case for TX and RX.&lt;/p&gt;
&lt;p&gt;This is also exactly the behaviour we see in the nrf51. I don&amp;#39;t see why this would be any different from the nrf52. I would be very surprised if this was changed in the nrf52.&lt;/p&gt;
&lt;p&gt;It is true the DISABLED event indicates EASYDMA is finished, but when the EASYDMA is busy it has no connection to the PACKETPTR anymore (it is read once during START task).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46971?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 07:47:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9a396c0-23a4-4f8b-ac3f-ef4c7f1add4f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;One update though, The CRC is calculated on the fly in the hardware while TX/RX, So for TX even though we are sure that getting PAYLOAD, ADDRESS or END event marks for sure that EasyDMA is finished but that does not mark the it is safe to update the PACKETPTR because can still be CRC pending.&lt;/p&gt;
&lt;p&gt;I think we will stick to what PS says that we need to wait for the DISABLED event and not rely on theories. We would not achieve any significant throughput or power advantages on taking this risk.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46970?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 07:39:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5eb732e-ba94-4327-8757-47488480ce4c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am sorry, my last comment got deleted somehow. I will rewrite it&lt;/p&gt;
&lt;p&gt;I agree with abkirchhoff, getting PAYLOAD, ADDRESS or END event should theoretically be enough in TX mode to know that the EasyDMA has done fetching the packet from RAM.&lt;/p&gt;
&lt;p&gt;@Martijn: I can see that the decision point is little blurry when it comes to TX mode, but for RX you have to wait until you get the DISABLED event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46969?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 07:19:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfc7756c-1295-48a4-81f9-7608a7e0d300</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;In de nrf51 the START task was used as a decision point for the PACKETPTR.
Isn&amp;#39;t this the same in the nrf52?&lt;/p&gt;
&lt;p&gt;If so, the address event should be the first indication it is safe to update the PACKETPTR (the start task is passed). We use this in our nrf51 applications.&lt;/p&gt;
&lt;p&gt;I was looking at it right now and noticed there are no mentions of decision points at all in the nrf52 documentation. I guess this should be updated&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46967?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2016 17:36:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eddff95-95b2-4c9c-82fc-e20910415222</guid><dc:creator>abkirchhoff</dc:creator><description>&lt;p&gt;That makes sense for the receive operation. For a transmit operation, a PAYLOAD event indicates that the payload has been sent over the air. Thus, the packet must have been read from RAM by the time that event occurs. The EasyDMA would be done accessing RAM and the PACKETPTR could be changed. Would you agree with my theory? Am I missing anything?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When can the PACKETPTR register be updated?</title><link>https://devzone.nordicsemi.com/thread/46966?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2016 17:02:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65b9734e-c2d6-4f5e-87e2-68287e10f8fb</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;In &lt;a href="https://devzone.nordicsemi.com/question/53698/does-the-nrf52-radio-easydma-write-a-bit-or-byte-at-a-time-to-packetptr/"&gt;this&lt;/a&gt; I mentioned that it is safest to update PACKETPTR when you get the disabled event. That is when we are sure that EasyDMA is has finished accessing RAM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>