<?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>Is CRC32_ENABLED in hardware or software for nrf52832?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85548/is-crc32_enabled-in-hardware-or-software-for-nrf52832</link><description>Hej! 
 I see that the CRC block is used in the Radio under section 23.6 of nRF52832_PS_v1.4.pdf . Also, I noticed that the CRC32_ENABLED is only enabled in the bootloader&amp;#39;s sdk_config.h for DFU boot validation using crc32_compute() . 
 // &amp;lt;q&amp;gt; CRC32_ENABLED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Mar 2022 11:23:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85548/is-crc32_enabled-in-hardware-or-software-for-nrf52832" /><item><title>RE: Is CRC32_ENABLED in hardware or software for nrf52832?</title><link>https://devzone.nordicsemi.com/thread/356850?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 11:23:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5954ce61-73b9-4c06-b3fa-2a4c9c59207e</guid><dc:creator>TilakL</dc:creator><description>&lt;p&gt;Thank you for the clarification. That solves my query. I am not sure how to mark your reply as the answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is CRC32_ENABLED in hardware or software for nrf52832?</title><link>https://devzone.nordicsemi.com/thread/356818?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:06:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31f8c6db-3df1-42c7-a926-057ae1004d6f</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for calculating CRC-32 in blocks.
 *
 * Feed each consecutive data block into this function, along with the current value of p_crc as
 * returned by the previous call of this function. The first call of this function should pass NULL
 * as the initial value of the crc in p_crc.
 *
 * @param[in] p_data The input data block for computation.
 * @param[in] size   The size of the input data block in bytes.
 * @param[in] p_crc  The previous calculated CRC-32 value or NULL if first call.
 *
 * @return The updated CRC-32 value, based on the input supplied.
 */
uint32_t crc32_compute(uint8_t const * p_data, uint32_t size, uint32_t const * p_crc);


uint32_t crc32_compute(uint8_t const * p_data, uint32_t size, uint32_t const * p_crc)
{
    uint32_t crc;

    crc = (p_crc == NULL) ? 0xFFFFFFFF : ~(*p_crc);
    for (uint32_t i = 0; i &amp;lt; size; i++)
    {
        crc = crc ^ p_data[i];
        for (uint32_t j = 8; j &amp;gt; 0; j--)
        {
            crc = (crc &amp;gt;&amp;gt; 1) ^ (0xEDB88320U &amp;amp; ((crc &amp;amp; 1) ? 0xFFFFFFFF : 0));
        }
    }
    return ~crc;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve copied the declaration with docs, and the definition of&amp;nbsp;&lt;span&gt;crc32_compute(), as you can see it&amp;#39;s a SW implementation. &lt;br /&gt;The radio has a HW CRC block, but it&amp;#39;s not available&amp;nbsp;for the CPU to use.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>