cancel
Showing results for 
Search instead for 
Did you mean: 

Error[Li005]: no definition for ''HAL_CRC_Init''

Treacy Yao
Associate II
Posted on January 23, 2018 at 02:24

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 */

  Error_Handler();

 }

}

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on January 23, 2018 at 02:59

Make sure you have added the following files to the project tree

 stm32f0xx_hal_crc.c

 stm32f0xx_hal_crc_ex.c

Linker error suggests you don't provide the function bodies.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4
Posted on January 23, 2018 at 02:33

You need to make sure the stm32f0xx_hal_conf.h file in your project has the following line uncommented

#define HAL_CRC_MODULE_ENABLED

You should just need to #include 

'stm32f0xx_hal.h'

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Treacy Yao
Associate II
Posted on January 23, 2018 at 02:53

I have add 

#define HAL_CRC_MODULE_ENABLED

in 

stm32f0xx_hal_conf.h

(this was commentted before, now I modified it), but still the same problem(no definition for 'HAL_CRC_Init' )
Treacy Yao
Associate II
Posted on January 23, 2018 at 03:08

Yes, no stm32f0xx_hal_crc.c,stm32f0xx_hal_crc_ex.c in the project tree. Now it has been fixed. Thanks a lot!

Posted on January 23, 2018 at 02:59

Make sure you have added the following files to the project tree

 stm32f0xx_hal_crc.c

 stm32f0xx_hal_crc_ex.c

Linker error suggests you don't provide the function bodies.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..