Question
CRC Causes Hard-Fault
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