Skip to main content
MechatronikMonkey
Associate II
January 29, 2019
Question

Bug in HAL_CRC Module

  • January 29, 2019
  • 6 replies
  • 1402 views

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

This topic has been closed for replies.

6 replies

Technical Moderator
January 29, 2019

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"".ThanksImen"
Visitor II
January 29, 2019

Hello @Christopher Müller​ 

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

Best Regards,

Wael

MechatronikMonkey
Associate II
January 29, 2019
Visitor II
January 29, 2019

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
January 29, 2019

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.

Visitor II
January 29, 2019

Yes I made a total description of what you want.