然后修改main函数:
int main(void)
{
/* USER CODE BEGIN 1 */
uint8_t dat[2] = {0xBE, 0xEF};
uint8_t crc = 0;
/* USER CODE END 1 */
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_CRC_Init();
MX_USART1_UART_Init();
/* USER CODE BEGIN 2 */
printf("Test CRC check:\n");
crc = HAL_CRC_Accumulate(&hcrc, (uint32_t*)dat, 2);
printf("crc = %#x\n", crc);
/* USER CODE END 2 */
while (1)
{
}
}
|