cancel
Showing results for 
Search instead for 
Did you mean: 

CRC Causes Hard-Fault

mattreed9
Associate II
Posted on August 03, 2016 at 18:29

Calls to the HAL_CRC_Calculate are causing hard faults.

When I step through I found out why:

  switch (hcrc->InputDataFormat)

  {

    case CRC_INPUTDATA_FORMAT_WORDS:  

      /* Enter 32-bit input data to the CRC calculator */

      for(index = 0U; index < BufferLength; index++)

      {

        hcrc->Instance->DR = pBuffer[index];   <--- this instruction

      }

      temp = hcrc->Instance->DR;

      break;

      

At the marked instruction, the hcrc handle becomes corrupt. The Instance pointer (instead of DR) gets assigned the value of pBuffer[index].

Eventually the entire hcrc handle is completely corrupt, and this causes the hard fault.

The code looks sound, why is this happening?

Anyone have any ideas?

-Matt

#crc #hal
1 REPLY 1
Posted on August 03, 2016 at 18:49

The code looks sound, why is this happening?

You are looking at the wrong code...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..