[DONE] USART control registers should be 32 bits

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

Moderator: RoccoMarco

Post Reply
jgobuyan
Posts: 5
Joined: Tue May 14, 2013 2:46 am

[DONE] USART control registers should be 32 bits

Post by jgobuyan »

Hi,

I needed to access the RS485 feature of the STM32 USART and found out that the CR1, CR2 and CR3 initialization fields in the SerialConfig struct are defined as uint16_t. These should be uint32_t.

Jerome

Code: Select all

@@ -221,15 +221,15 @@
   /**
    * @brief Initialization value for the CR1 register.
    */
-  uint16_t                  sc_cr1;
+  uint32_t                  sc_cr1;
   /**
    * @brief Initialization value for the CR2 register.
    */
-  uint16_t                  sc_cr2;
+  uint32_t                  sc_cr2;
   /**
    * @brief Initialization value for the CR3 register.
    */
-  uint16_t                  sc_cr3;
+  uint32_t                  sc_cr3;
 } SerialConfig;
 
 /**
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: USART control registers should be 32 bits

Post by Giovanni »

Thanks for findings, this is probably a leftover of the old UART. Will be updated over the weekend.

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

Re: [TODO] USART control registers should be 32 bits

Post by Giovanni »

Hi,

Fixed on the repository, thanks for finding: https://sourceforge.net/p/chibios/bugs/416/

Giovanni
Post Reply