2016-07-01 01:45 AM
Good day.
In my program i use CAN interface. I send and receive messages (consist of few CAN packs) with crc.depends on
free CAN bus. When i can send another CAN pack i want to calculate next crc and send CAN bytes.Time to send 8 full CAN packs with 250kbit/s is about 10ms. In this time i can not use CRC because it has no way to set the DR register, like CRC->DR=0x12345678; bool temp = (CRC->DR == 0x12345678); temp = true
So the question is - is there a way to do this? Or i need to use software calculation? I mean function like this: uint CRCcalc(uint previousCRC, uint data); Thanks2016-07-01 03:05 AM
In most STM32 families you must serialize access to the CRC resource. Others you can select the initialization value.
It is possible to compute a value to write to the DR that will change it from what it is, to what you want it to be, but you'd need to do that in software. So probably not a net win there for doing 8-byte frames at a time.[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Background%20CRC32%20in%20segments%20on%20STM32F4&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20130305%252013%253a40%253a44%26p_ID%3D28690%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=49]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Background%20CRC32%20in%20segments%20on%20STM32F4&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20130305%252013%253a40%253a44%26p_ID%3D28690%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=49[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F4%20CRC%20-%20Preload%20CRC-DR&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=2306]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FSTM32F4%20CRC%20-%20Preload%20CRC-DR&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=23062016-07-01 04:16 AM
That what i am looking for!
Thank you. Yeah,opportunity
to set the reset valuelooks very good
.It would be great if it would be in each controller