AnsweredAssumed Answered

Error[Li005]: no definition for "HAL_CRC_Init"

Question asked by Treacy Yao on Jan 23, 2018
Latest reply on Jan 23, 2018 by Treacy Yao

I want to add crc function in STM32F030RC, so I add HAL_CRC_Init, and related functions. But there is always "no definition for "HAL_CRC_Init"" error when link. I have include "stm32f0xx_hal.h","stm32f0xx_hal_crc.h","stm32f0xx_hal_crc_ex.h", but it seems useless. I don't know why, and how to fix this problem. Please help!




Below is my related code.


/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f0xx_hal.h"
#include "stm32f0xx_hal_crc.h"
#include "stm32f0xx_hal_crc_ex.h"
#include "cmsis_os.h"
#include "app_header.h"
#include "app_main.h"
#include "gps.h"
#include "at.h"
#include "network.h"
#include "uart.h"
#include "memory.h"
#include "log.h"
ADC_HandleTypeDef hadc;
I2C_HandleTypeDef hi2c1;
RTC_HandleTypeDef hrtc;
UART_HandleTypeDef huart1;
UART_HandleTypeDef huart2;
UART_HandleTypeDef huart3;
UART_HandleTypeDef huart5;
/* CRC handler declaration */
CRC_HandleTypeDef   CrcHandle;
static void MX_CRC_Init(void);
static void MX_CRC_Init(void)
 CrcHandle.Instance = CRC;
 /* The default polynomial is not used. It is required to defined it in CrcHandle.Init.GeneratingPolynomial*/ 
 CrcHandle.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
 /* Set the value of the polynomial */
 CrcHandle.Init.GeneratingPolynomial = DEFAULT_POLYNOMIAL_ENABLE;
 /* The size of the polynomial to configure the IP is 8b*/
 CrcHandle.Init.CRCLength = CRC_POLYLENGTH_32B;
 /* The default init value is used */
 CrcHandle.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_DISABLE;
 /* The input data are not inverted */
 CrcHandle.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
 /* The output data are not inverted */
 CrcHandle.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
 /* The input data are 32 bits lenght */
 CrcHandle.InputDataFormat = CRC_INPUTDATA_FORMAT_WORDS;
 if (HAL_CRC_Init(&CrcHandle) != HAL_OK)
  /* Initialization Error */