AnsweredAssumed Answered

CRC Causes Hard-Fault

Question asked by reed.matthew.003 on Aug 3, 2016
Latest reply on Aug 3, 2016 by Clive One
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

Outcomes