Skip to main content
Visitor II
December 8, 2023
Question

USB CDC BAREMETAL

  • December 8, 2023
  • 1 reply
  • 1157 views

Hello everyone,

 

Here i'm trying to implement USB CDC FS on STM32F107VCT6 using Standard Library(without HAL Library), but when i am trying to initialize clock for USB (RCC_APB1ENR_USBEN) its showing error that this register is not available for Connectivity line devices.

 

can anyone guide me how can i implement it.

 

Thanks in Advance,

    This topic has been closed for replies.

    1 reply

    Super User
    December 8, 2023

    Interesting, it does seem to be missing in the CMSIS header, along with I2C2.

    https://github.com/STMicroelectronics/cmsis_device_f1/blob/de5b35db7fd13143ddb362d4626b7fca847fafee/Include/stm32f107xc.h

    You can define it yourself:

    #define RCC_APB1ENR_USBEN_Pos (23U) 
    #define RCC_APB1ENR_USBEN_Msk (0x1UL << RCC_APB1ENR_USBEN_Pos) /*!< 0x00200000 */
    #define RCC_APB1ENR_USBEN RCC_APB1ENR_USBEN_Msk /*!< USB clock enable */

     

    Graduate II
    December 10, 2023

    Looking at the order chaos of the bit fields in that file, it is pretty clear why it is missing values...