Contrib: RCC controls for CRC Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
User avatar
kimmoli
Posts: 26
Joined: Sat Oct 01, 2016 8:02 pm
Has thanked: 11 times
Been thanked: 8 times

Contrib: RCC controls for CRC

Post by kimmoli »

Using Hardware CRC from Chibios-Contrib needs rcc control functions for CRC peripheral. These are missing from stm32_rcc.

< barthess> kimmoli: there is no place for RCC stuff in contrib. Create topic on forum with patch attached.


Propsed patch will add them:
https://github.com/kimmoli/ChibiOS/comm ... 7d6fcc0951

Code: Select all

diff --git a/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h b/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
index 6f3e269..4de320c 100644
--- a/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
+++ b/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h
@@ -1551,6 +1551,36 @@
 /** @} */

 /**
+ * @name    CRC peripheral specific RCC operations
+ * @{
+ */
+/**
+ * @brief   Enables the CRC peripheral clock.
+ *
+ * @param[in] lp        low power enable flag
+ *
+ * @api
+ */
+#define rccEnableCRC(lp) rccEnableAHB1(RCC_AHB1ENR_CRCEN, lp)
+
+/**
+ * @brief   Disables the CRC peripheral clock.
+ *
+ * @param[in] lp        low power enable flag
+ *
+ * @api
+ */
+#define rccDisableCRC(lp) rccDisableAHB1(RCC_AHB1ENR_CRCEN, lp)
+
+/**
+ * @brief   Resets the CRC peripheral.
+ *
+ * @api
+ */
+#define rccResetCRC() rccResetAHB1(RCC_AHB1RSTR_CRCRST)
+/** @} */
+
+/**
  * @name    FSMC peripherals specific RCC operations
  * @{
  */
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: Contrib: RCC controls for CRC

Post by RoccoMarco »

Thanks, I will take a look.
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: Contrib: RCC controls for CRC

Post by RoccoMarco »

Bumped
User avatar
kimmoli
Posts: 26
Joined: Sat Oct 01, 2016 8:02 pm
Has thanked: 11 times
Been thanked: 8 times

Re: Contrib: RCC controls for CRC

Post by kimmoli »

bump
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Contrib: RCC controls for CRC

Post by Giovanni »

Don't worry, posts in this forum are always considered unless marked "done" :)

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Contrib: RCC controls for CRC

Post by Giovanni »

Is this change F4-specific?

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Contrib: RCC controls for CRC

Post by Giovanni »

Added to the F4 only for the time being.

Giovanni
Post Reply