1946 views|0 replies

2865

Posts

4

Resources
The OP
 

NUCLEO_G431RB Review - CRC Calculation [Copy link]

Thanks to EEWORLD and ST for providing development boards, board information address

Since I used the development tool of Keil 5.18a, I encountered a problem: the ST-LINK V3 version on the board could not download the program, so I had to use the ST-LINK tool to download the Hex file to the board for experiment. But at least I can do the experiment. So I clicked the LED and did the serial port experiment at the same time, and everything went smoothly. The serial port uses LPUART1, and the pins are PA2/PA3.
There are built-in CRC calculation and RNG generator on the chip, so I first did the CRC calculation experiment. I found that the calculation speed is really fast!

If you want to use the CRC calculation accelerator, you need to initialize and set parameters. This operation is very convenient in STM32CUBE.

STM32CUBE defaults to 32-bit CRC, and 16-bit is commonly used. The following describes the setting items:

Default Polynomial State Whether to use a customized algorithm and checksum
CRC Length CRC checksum length, default 32-bit
CRC Generating Polynomial Specify the 'checksum'
Default Init Value State Specify the first byte, default is 'FF'
Input Data Inversion Mode Calculation direction of input data
Output Data Inversion Mode Calculation direction of output data
Input Data Format Bit width of input data, default is 'byte'
After setting the initialization parameters, you can use the HAL_CRC_Calculate(&hcrc, (uint32_t *)txData, sizeof(txData)); function. The return value of the function is the calculation result of CRC.

Display CRC result through serial port debugging assistant
This content is originally created by bigbat , a netizen of EEWORLD forum. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source

This post is from stm32/stm8
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list