Page 1 of 1

STM32Lxx and community CRC driver

Posted: Thu Nov 01, 2018 12:32 am
by dflogeras
I realize CRC is not officially supported, but hoping to gain some insight here if any authors watch the forums.

I am looking to use CRC in an STM32L4 project. I see that the L4xx/stm32_rcc.h in mainline ChibiOS is missing the Enable/Disable/ResetCRC family of functions that the F0/3/4/7 files contain.

I am wondering how this is supposed to fit together. The F0/3/4/7 Enable/Disable macros take the 'lp' argument. However, the community hal_lld_crc.c calls it without any argument. This works for the community/testhal/crc demo for the F0xx series, since lp is ignored anyway. I'm not sure what needs to be added and where to port to L4.

Any insight would be appreciated.

Re: STM32Lxx and community CRC driver

Posted: Thu Nov 01, 2018 5:27 am
by Giovanni
Hi,

Community drivers are not necessarily updated or maintained for each ChibiOS version. The trunk RCC macros do not have that parameter, probably the driver is following the trunk code. You may simply add "false" if you are using an older ChibiOS version.

Giovanni

Re: STM32Lxx and community CRC driver

Posted: Thu Nov 01, 2018 11:13 am
by dflogeras
I still see the 'lp' parameter in the trunk r12399

https://sourceforge.net/p/chibios/svn2/ ... rcc.h#l906

https://sourceforge.net/p/chibios/svn2/ ... cc.h#l1574

Etc..

I'm not sure how the crc demo for the F0 compiles, since it passes no argument to 'rccEnableCrc()', and the underlying macro would be called as

rccEnableAHB(RCC_AHBENR_CRCEN, );

Maybe the trailing comma is ok when the 'lp' parm isn't used? This wouldn't be the case in the F4 since it does actually switch on the 'lp' parameter.

Re: STM32Lxx and community CRC driver

Posted: Thu Nov 01, 2018 11:16 am
by Giovanni
The lp parameter has been removed from the "disable" macros only.

Giovanni