cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743xx.h Strange defines (TIM_CCMRx_OCxM, LPTIM_CR_SNGSTRT)

flyer31
Senior

Hi,

these defines are defined very strange/misleading in STM32H743xx.h (from current version 1.7: STM32Cube_FW_H7_V1.7):

#define LPTIM_CR_SNGSTRT_Msk        (0x40001UL << LPTIM_CR_SNGSTRT_Pos)        /*!< 0x00080002 */

According to RefMan Desc of SNGSTRT, this should be only 1 Bit (Only Bit 1, so number 0x00000002 ... but here they defeine 2 bits, 0x00080002... is this some "undocumented feature" or some error in the header file?)

... I also checked STM32L053 header file for comparison, there this bit is defined correctly as 0x00000002... .

Further the following mask values I think are wrong / very misleading:

#define TIM_CCMR1_OC1M_Msk        (0x1007UL << TIM_CCMR1_OC1M_Pos)             /*!< 0x00010070 */
#define TIM_CCMR1_OC2M_Msk        (0x1007UL << TIM_CCMR1_OC2M_Pos)             /*!< 0x01007000 */
#define TIM_CCMR2_OC3M_Msk        (0x7UL << TIM_CCMR2_OC3M_Pos)                /*!< 0x00000070 */
#define TIM_CCMR2_OC4M_Msk        (0x7UL << TIM_CCMR2_OC4M_Pos)                /*!< 0x00007000 */

The definitions for TIM_CCMR1_OC1M_Msk and TIM_CCMR1_OC2M_Msk are correct, but the definitions for TIM_CCMR2_OC3M_Msk and TIM_CCMR2_OC4M_Msk are NOT correct ... it would be nice if this would be corrected some time (I had givs such a message already about 1 year ago...).

0 REPLIES 0