cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in HAL_CRC Module

MechatronikMonkey
Associate II

I found a bug the HAL CRC Module...

First of all... when you enable the CRC Module with CubeMX 5.0.1 the MX_CRC_Init() is empty and the peripheral is not initalized!

I wrote all the code manualy or copied it from the old CubeMX 4 generated code...

This worked BUT... when using hcrc.Init.CRCLength = HAL_CRC_LENGTH_8B the CRC->CR->POLYSIZE Register is set wrong. It is set to 0x01 what means 16 Bit CRC and not 0x02 wicht would be 8 Bit.

When you use hcrc.Init.CRCLength = HAL_CRC_LENGTH_16B; the CR->POLYSIZE Register is set to 8 Bit (0x02)... so it seems to be flipped arround...

I did no further investigation on this bug... dont know where the problem realy is...

But i guess, this is STs task.

Best regards

6 REPLIES 6
Imen.D
ST Employee

Hello,

Can you please share your ioc file for check.

Kidn Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
WBOUG
Senior

Hello @Christopher Müller​ 

Can you please share your ioc file or your MCU for check.

Best Regards,

Wael

MechatronikMonkey
Associate II
 
WBOUG
Senior

Hi @Christopher Müller​ 

Your request has been sent to the development team. it will fix in the next version CubeMX

Best Regards,

Wael

MechatronikMonkey
Associate II

Please be aware of that it is NOT ONLY a problem with the cube MX but also the HAL itself!

hcrc.Init.CRCLength = HAL_CRC_LENGTH_8B comes from HAL not from Cube MX... and this sets the register of STM32L082 wrong. It is a bug in HAL.

WBOUG
Senior

Yes I made a total description of what you want.