Skip to main content
mattreed9
Associate III
August 3, 2016
Question

CRC Causes Hard-Fault

  • August 3, 2016
  • 1 reply
  • 964 views
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
This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
August 3, 2016
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 VenmoUp vote any posts that you find helpful, it shows what's working..