<?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>NRF52 RADIO CRC calculation method</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58469/nrf52-radio-crc-calculation-method</link><description>address = 0xe7 0xe7 0xe7(3bytes), 
 dataLength=0x01(8bit), 
 S1&amp;gt;&amp;gt;PID=0x01(2bit);NO_ACK=0x00(1bit); 
 How to calculate CRC, I need software calculation, not hardware processing. 
 Thanks！</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Mar 2020 09:11:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58469/nrf52-radio-crc-calculation-method" /><item><title>RE: NRF52 RADIO CRC calculation method</title><link>https://devzone.nordicsemi.com/thread/237342?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 09:11:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:338937cc-5d60-4a42-922a-adbeffc2e0c3</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The p_data parameter is a pointer to the data that you want to calculate the CRC over.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In ESB the full address, S0, length, S1 and payload should be used as a part of the CRC calculation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is also important to use the right CRC polynomial and initial value, to be compatible with the CRC feature of the radio.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 RADIO CRC calculation method</title><link>https://devzone.nordicsemi.com/thread/237032?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 07:55:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56b7282f-3987-4f68-b211-aa7b00a02166</guid><dc:creator>xixili</dc:creator><description>&lt;p&gt;CRC format&lt;/p&gt;
&lt;p&gt;if (m_config_local.crc == RADIO_CRCCNF_LEN_Two)&lt;br /&gt; {&lt;br /&gt; NRF_RADIO-&amp;gt;CRCINIT = 0xFFFFUL; // Initial value&lt;br /&gt; NRF_RADIO-&amp;gt;CRCPOLY = 0x11021UL; // CRC poly: x^16+x^12^x^5+1&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;uint16_t crc16_compute(uint8_t const * p_data, uint32_t size, uint16_t const * p_crc)&lt;br /&gt;{&lt;br /&gt; uint16_t crc = (p_crc == NULL) ? 0xFFFF : *p_crc;&lt;/p&gt;
&lt;p&gt;for (uint32_t i = 0; i &amp;lt; size; i++)&lt;br /&gt; {&lt;br /&gt; crc = (uint8_t)(crc &amp;gt;&amp;gt; 8) | (crc &amp;lt;&amp;lt; 8);&lt;br /&gt; crc ^= p_data[i];&lt;br /&gt; crc ^= (uint8_t)(crc &amp;amp; 0xFF) &amp;gt;&amp;gt; 4;&lt;br /&gt; crc ^= (crc &amp;lt;&amp;lt; 8) &amp;lt;&amp;lt; 4;&lt;br /&gt; crc ^= ((crc &amp;amp; 0xFF) &amp;lt;&amp;lt; 4) &amp;lt;&amp;lt; 1;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;return crc;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What should para &lt;strong&gt;p_data&lt;/strong&gt; enter？&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>