<?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>about Sequence Number</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124816/about-sequence-number</link><description>I&amp;#39;m developing with the NRF52840 using IAR Embedded Workbench , and implementing wireless communication based on the IEEE802.15.4 Zigbee protocol . 
 In the MAC frame layer of IEEE802.15.4, there is a field called Sequence Number , which is used to identify</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Oct 2025 08:11:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124816/about-sequence-number" /><item><title>RE: about Sequence Number</title><link>https://devzone.nordicsemi.com/thread/551783?ContentTypeID=1</link><pubDate>Fri, 17 Oct 2025 08:11:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e51a5d30-0045-4691-a6c9-be3c40195d88</guid><dc:creator>Hiroaki_Iwata2</dc:creator><description>&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-ved="2ahUKEwjS3orH46qQAxUCqFYBHXT6LH8Q3ewLegQICxAV"&gt;&lt;span class="Y2IQFc" lang="en"&gt;Hello. I understand that if the system is always in &amp;quot;system on mode&amp;quot;, the sequence number is maintained and does not need to be prepared by the user. The problem is how to memorize the sequence number when returning from &amp;quot;system off mode&amp;quot;. For devices driven by kinetic harvesters, non-volatile memory such as EEPROM or FERAM must be prepared to memorize the sequence number. Thank you.&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about Sequence Number</title><link>https://devzone.nordicsemi.com/thread/551744?ContentTypeID=1</link><pubDate>Thu, 16 Oct 2025 15:20:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80034096-78af-4a3a-9160-3cc85d7234a4</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Looking at that wireless UART sample, it looks like that sequence number is mainly for keeping track of the data sent? (I.e. bookkeeping for segmenting and reassembling the stream of UART data.) That would be separate from how sequence numbers are handled inside of the 802.15.4 library, which is where the sequence numbers mandated by the 802.15.4 specification would be. It doesn&amp;#39;t look like that stack requires any external components. I need to check this more in-depth before we have a clear answer.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about Sequence Number</title><link>https://devzone.nordicsemi.com/thread/551515?ContentTypeID=1</link><pubDate>Wed, 15 Oct 2025 06:09:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:139628d3-2504-46fc-a125-e96feb653a95</guid><dc:creator>Hiroaki_Iwata2</dc:creator><description>&lt;p&gt;&lt;span&gt;Similar modules using kinetic generators from other manufacturers write the SEQ No. to the EEPROM. Thank you.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about Sequence Number</title><link>https://devzone.nordicsemi.com/thread/551093?ContentTypeID=1</link><pubDate>Fri, 10 Oct 2025 09:00:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45a9f1f0-3054-4e69-89e4-8625016fcb18</guid><dc:creator>Hiroaki_Iwata2</dc:creator><description>&lt;p&gt;Hello, thank you for your response.&lt;br /&gt; I am not using the nRF Connect SDK. I have reviewed the sample code and referred to the following example:&lt;br /&gt; &lt;code&gt;nRF5_SDK_17.1.0_ddde560\examples\802_15_4\wireless_uart&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In this example, the SEQUENCE NO (&lt;code&gt;static sequence_number_t tx_sequence_number = 0;&lt;/code&gt; declared in &lt;code&gt;fsm.c&lt;/code&gt;) is defined as a static variable, so it resets to &amp;quot;0&amp;quot; after a CPU reset.&lt;br /&gt; This contradicts the requirement to retain the value even after a reset.&lt;/p&gt;
&lt;p&gt;In practice, writing to FLASH seems difficult. If RAM retention is also not possible, then it appears to be unfeasible.&lt;/p&gt;
&lt;p&gt;Fundamentally, do CPUs that operate with a kinetic harvester have a special physical layer (such as a structure that enables non-volatile memory) to retain the SEQUENCE NO?&lt;/p&gt;
&lt;p&gt;For example, I have seen products using Silicon Labs&amp;#39; MGM13S series that operate with a kinetic harvester and retain the SEQUENCE NO.&lt;br /&gt; However, from what I could see in the datasheet, there didn&amp;rsquo;t appear to be any special circuitry for that purpose.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about Sequence Number</title><link>https://devzone.nordicsemi.com/thread/551036?ContentTypeID=1</link><pubDate>Thu, 09 Oct 2025 15:25:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65db8789-778c-4024-a38c-56468a5d1e69</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;RAM retention can be used in system off, if the SoC is still connected to power while in that state, but it looks like RAM contents may be corrupted on pin reset, yes, so then it cannot be used for your use case.&lt;/p&gt;
&lt;p&gt;If you are using either nRF5 SDK or nRF Connect SDK, then there are flash handling libraries in the SDK that you can use. (FDS in nRF5 SDK; NVM in nRF Connect SDK.) Otherwise, Flash handling is documented in the NVMC section of the product specification (datasheet), yes. Please note that for new projects we recommend using nRF Connect SDK (see&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;nRF Connect SDK and nRF5 SDK statement&lt;/a&gt; for details on SDKs.)&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about Sequence Number</title><link>https://devzone.nordicsemi.com/thread/550960?ContentTypeID=1</link><pubDate>Thu, 09 Oct 2025 02:57:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44c789ac-1b8b-4747-8c2f-676d9c28c993</guid><dc:creator>Hiroaki_Iwata2</dc:creator><description>&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Thank you for your reply. I am designing a battery-powered device. It is designed to enable &amp;quot;DEEP SLEEP&amp;quot; and wake with a &amp;quot;HIGH&amp;quot; GPIO signal.&lt;/p&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-ved="2ahUKEwi7q8W8jZaQAxX1klYBHbHHNyMQ3ewLegQICxAV"&gt;&lt;span class="Y2IQFc" lang="en"&gt;Therefore, it will be reset when waking, and the SEQUENSE No. will not be retained. I believe RAM retention will not work because &amp;quot;DEEPSLEEP&amp;quot; is used.
Does this mean that the program itself can write data to the flash memory? Should I refer to section 4.3 NVMC in the datasheet &amp;quot;NRF52840 Product Specification&amp;quot;?&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about Sequence Number</title><link>https://devzone.nordicsemi.com/thread/550926?ContentTypeID=1</link><pubDate>Wed, 08 Oct 2025 14:07:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81cf144f-d045-4486-9f4d-622e3c7dde2d</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]implementing wireless communication based on the &lt;strong&gt;IEEE802.15.4 Zigbee protocol&lt;/strong&gt;.[/quote]
&lt;p&gt;Our main recommendation is to not build the full stack yourself, but to build on top of our &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html"&gt;nRF Connect SDK&lt;/a&gt; with the appropriate Zigbee &lt;a href="https://nrfconnect.github.io/ncs-app-index/"&gt;add-on&lt;/a&gt;. See &lt;a href="https://docs.nordicsemi.com/bundle/comp_matrix_nrf52840/page/COMP/nrf52840/nrf52840_zigbee_cids.html"&gt;Zigbee CIDs&lt;/a&gt; for compatibility between SDK, Zigbee addons and CSA certifications.&lt;/p&gt;
[quote user=""]In the MAC frame layer of IEEE802.15.4, there is a field called &lt;strong&gt;Sequence Number&lt;/strong&gt;, which is used to identify the continuity and uniqueness of transmitted packets. I&amp;#39;m currently struggling with how to implement this.[/quote]
&lt;p&gt;As you indicate, an implementation must consider flash usage carefully, and is not entirely straight-forward. If you really want to implement this yourself, then there are a couple of techniques which could be useful:&lt;/p&gt;
&lt;p&gt;The first is to keep the sequence number in RAM whenever you can do so, including using RAM retention as appropriate.&lt;/p&gt;
&lt;p&gt;The second is to not store the number at a fixed location in flash. Rather, write a new entry in flash, at a later address, each time the number must be updated. You can use an existing storage system for this, such as &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/storage/nvs/nvs.html"&gt;Non-Volatile Storage (NVS)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Combining the two, you will minimize the number of Flash write/erase cycles. The most important Flash constraints on the nRF52840 are a minimum 10 000 write/erase cycles per Flash page, and that each 32-bit word can be written to a maximum of two times before erase. Write and erase times matter as well, if you have limited time for writing at power-off. For details, see the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/nvmc.html#ariaid-title22"&gt;electrical specification&lt;/a&gt;&amp;nbsp;section of the NVMC chapter of the nRF52840 Product Specifications.&lt;/p&gt;
&lt;p&gt;But again, the main recommendation is to build your application on top of our SDK with the Zigbee addon, such that you do not have to implement this yourself.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>