STM32Lxx and community CRC driver

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

STM32Lxx and community CRC driver

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32Lxx and community CRC driver

Post 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
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: STM32Lxx and community CRC driver

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32Lxx and community CRC driver

Post by Giovanni »

The lp parameter has been removed from the "disable" macros only.

Giovanni
Post Reply