AnsweredAssumed Answered

Problem with CRC combined with LTDC

Question asked by Rygel.Troy1818 on Jun 26, 2016
Latest reply on Jun 27, 2016 by Rygel.Troy1818
Hi all,

Here is another funny problem to crack. I use ltdc and I also want to use crc. There is no problem with ltdc until I call the function HAL_CRC_Calculate(). See the video OK.avi and NOK.avi for illustration.

Below is code for NOK case.

uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
{
  uint32_t index = 0; /* CRC input data buffer index */
  uint32_t temp = 0;  /* CRC output (read from hcrc->Instance->DR register) */
     
  /* Process locked */
  __HAL_LOCK(hcrc);
   
  /* Change CRC peripheral state */ 
  hcrc->State = HAL_CRC_STATE_BUSY;
   
  /* Reset CRC Calculation Unit (hcrc->Instance->INIT is
  *  written in hcrc->Instance->DR) */
  __HAL_CRC_DR_RESET(hcrc);
   
  switch (hcrc->InputDataFormat)
  {
    case CRC_INPUTDATA_FORMAT_WORDS: 
      /* Enter 32-bit input data to the CRC calculator */
      for(index = 0; index < BufferLength; index++)
      {
        hcrc->Instance->DR = pBuffer[index];
      }
      temp = hcrc->Instance->DR;
      break;

(gdb) print hcrc->Instance
$38 = (CRC_TypeDef *) 0x40023000
(gdb) print *hcrc->Instance
$39 = {DR = 0xffffffff, IDR = 0x0, RESERVED0 = 0x0, RESERVED1 = 0x0, CR = 0x0, RESERVED2 = 0x0, INIT = 0xffffffff, POL = 0x4c11db7}
(gdb) 

However, if I remove the line from hal library crc file:
hcrc->Instance->DR = pBuffer[index];

Then the problem disappears. I am using STM32F756IGK6.

Regards,
/Rygelxvi

Attachments

Outcomes