cancel
Showing results for 
Search instead for 
Did you mean: 

L4 CRC and U5 CRC diff

shwzh1990
Associate

Hi, I have both stm32u5 and stm32l469. I found that there are some differences in the CRC caculation.

On stm32l469:

if i configure the parameter as following, function hardware_crc32_calculate_with_seed works fine, no matter the code in line 185,186,194 being comment out or not. However, if i change the CRC address to U5 and run the same test. the code in line 185,186,194 must be had.

shwzh1990_0-1705868542338.png

shwzh1990_2-1705868760679.png

On U5 side:

The code should be something like this:

shwzh1990_3-1705868912631.png

When there are some bytes left, on the u5, it must be change the config to reverse byte and then calculate the crc and then change back to the word config. but l4 does not have to.

 

My question is :

is this a bug or some diff between l4 and U5? i need some guidance. Thx

I attach my test code as following.

 

 

 

2 REPLIES 2

Just OR'ing things on to the register with multiple bit positions probably not advisable

Check CR in both cases

>>is this a bug or some diff between l4 and U5?

The RM should be instructive

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

hi @Tesla DeLorean  thx for your relying.  But i feel confused on why l4 can get the correct result if i did not change config from word to byte but u4 should do??