STM32Lxx and community CRC driver

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

Moderators: RoccoMarco, barthess

dflogeras
Posts: 212
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 7 times
Been thanked: 19 times

STM32Lxx and community CRC driver

Postby dflogeras » Thu Nov 01, 2018 12:32 am

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32Lxx and community CRC driver

Postby Giovanni » Thu Nov 01, 2018 5:27 am

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: 212
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 7 times
Been thanked: 19 times

Re: STM32Lxx and community CRC driver

Postby dflogeras » Thu Nov 01, 2018 11:13 am

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32Lxx and community CRC driver

Postby Giovanni » Thu Nov 01, 2018 11:16 am

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

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 52 guests