STM32 CRC-32 Calculator Unit
AN4187 - Using the CRC peripheral in the STM32 family
At start up, the algorithm sets CRC to the Initial_Crc XOR with the Input_Data.
Once CRC MSB is equal to one, the algorithm shifts CRC one bit to the left and XORs it with the POLY.
Otherwise, it only shifts CRC one bit to the left.
Figure 3 shows the step-by-step algorithm execution for the following conditions:
– Input_Data = 0xC1
– POLY = 0xCB
– Initial_Crc = 0xFF
All STM32 devices implement a CRC peripheral as described in Section 1.1.
The CRC calculation unit has a single 32-bit read/write data register (CRC_DR).
It is used to input new data (write access) and hold the result of the previous CRC calculation (read access).
Each write operation to the data register creates a combination of the previous CRC value (stored in CRC_DR) and the new one.
Figure 4. CRC calculation unit block diagram
To compute a CRC of any supported data, you must follow these steps:
1. Enable the CRC peripheral clock via the RCC peripheral.
2. Set the CRC Data Register to the initial CRC value by configuring the Initial CRC value register (CRC_INIT).(a)
3. Set the I/O reverse bit order through the REV_IN[1:0] and REV_OUT bits respectively in CRC Control register (CRC_CR).(a)
4. Set the polynomial size and coefficients through the POLYSIZE[1:0] bits in CRC Control register (CRC_CR)
and CRC Polynomial register (CRC_POL) respectively.(b)
5. Reset the CRC peripheral through the Reset bit in CRC Control register (CRC_CR).
6. Set the data to the CRC Data register.
7. Read the content of the CRC Data register.
8. Disable the CRC peripheral clock.
In firmware package, the CRC_usage example runs the CRC checksum code computing an array data (DataBuffer) of 256 supported data type.
For a full description, please refer to the file Readme.txt in the CRC_usage folder.
a. Applicable only for STM32F0xx and STM32F3xx devices
b. Applicable only for STM32F3xx devices
STM32 CRC-32 Calculator Unit的更多相关文章
- CRC32 of Ether FCS with STM32
Everyone knows that STM32F1xx, STM32F2xx, STM32F4xx have a hardware unit with a polynomial CRC32 0x0 ...
- STM32的CRC32 软件实现代码
对于STM32的32位CRC,如果假定它的一个主要目的是为了校验往内部FLASH存储数据的可靠性,那么(余数)初值是全1当然是比较合理的.由于STM32的32位CRC是纯32位,即每次必须输入32位的 ...
- 如何在IAR中配置CRC参数(转)
源:如何在IAR中配置CRC参数 前言 STM32全系列产品都具有CRC外设,对CRC的计算提供硬件支持,为应用程序节省了代码空间.CRC校验值可以用于数据传输中的数据正确性的验证,也可用于数据存储时 ...
- CRC循环冗余校验码总结(转)
转自 http://blog.csdn.net/u012993936/article/details/45337069 一.CRC简介 先在此说明下什么是CRC:循环冗余码校验 英文名称为Cyclic ...
- CRC编码
一.循环冗余码校验英文名称为Cyclical Redundancy Check,简称CRC. 它是利用除法及余数的原理来作错误侦测(Error Detecting)的.实际应用时,发送装置计算出CRC ...
- STM32 使用 printf 发送数据配置方法 -- 串口 UART, JTAG SWO, JLINK RTT
STM32串口通信中使用printf发送数据配置方法(开发环境 Keil RVMDK) http://home.eeworld.com.cn/my/space-uid-338727-blogid-47 ...
- STM32 IAP 在线升级详解(转)
源:http://blog.csdn.net/yx_l128125/article/details/12992773 (扩展-IAP主要用于产品出厂后应用程序的更新作用,考虑到出厂时要先烧写IAP ...
- STM32的CRC32 测试代码
// STM32 CRC32 Test App - sourcer32@gmail.com #include <windows.h> #include <stdio.h> DW ...
- 关于STM32位带操作随笔
以前在学习STM32时候关注过STM32的位带操作,那时候只是知道位带是啥,用来干嘛用,说句心里话,并没有深入去学习,知其然而不知其所以然.但一直在心中存在疑惑,故今日便仔细看了一下,写下心得供日后参 ...
随机推荐
- 关于 xcode5 的no matching provisioning profiles found
CHENYILONG Blog 关于 xcode5 的no matching provisioning prof- about the question in xcode5 "no matc ...
- mitmproxy实践
首先附上github地址:https://github.com/mitmproxy/mitmprox,上面的内容永远是最新的 作为一名测试穿戴设备相关app的工程师,与数据打交道是常事,那么,如果想要 ...
- Mysql读写分离-Amoeba Proxy
参考:http://www.linuxidc.com/Linux/2015-10/124115.htm 一个完整的MySQL读写分离环境包括以下几个部分: 应用程序client database pr ...
- Java ListIterator(迭代器)
LIstIterator是一个更加强大的Iterator的子类型,它只能用于各种List类的访问,尽管Iterator只能向前移动,但是ListIterator可以双向移动,它还可以产生相对于迭代器在 ...
- 浅谈SpringMVC
M--模型(实体vo[视图对象]与页面对面) V--视图(JSP,,velocity,FreeMarker,html,thymeleaf) C--控制器(servlet,if语句控制M数据跳转到V进行 ...
- Grafana 短信报警
一.分析 需求 Grafana支持短信渠道报警 要求 使用开发提供的短信API接口 请求url: http://192.168.1.1:8088/alerting/sendSms?mobile=手机号 ...
- svn导入项目和部署方面的相关问题
前一阵子忙于部署项目的事情,在这个过程之中遇到了一些问题,查阅了相关资料解决了问题于是就决定分享给大家,可能会对大家有一定的帮助.我在下面中可能会提到dubbo的一些问题,dubbo是用于分布式的系统 ...
- Nginx + PHP(php-fpm)遇到的502 Bad Gateway错误
我一个统计程序估计要跑1分多钟以上 查看了一个php-fpm 配置文件 [13-Oct-2013 12:06:07] WARNING: [pool www] child 7458, script '/ ...
- js下判断 iframe 是否加载完成的完美方法
一般来说,我们判断 iframe 是否加载完成其实与 判断JavaScript 文件是否加载完成. 采用的方法很类似: var iframe = document.createElement( ...
- centos7 firewall 相关
1.centos 6 是iptables, 7 开始就以firewalld代替iptables; 2.systemctl stop firewalld.service 停 systemctl sta ...