STM32F303CB is missing peripherals definitions in the HAL and LL drivers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-03 03:57 AM
I am using an STM32F303CB with HAL/LL version 1.10.0
It seems that TIM2 is not available in the drivers for this part as RCC_CFGR3_TIM2SW is not defined.
Is this a fault with the driver library or a configuration from Cube?
Thanks
Solved! Go to Solution.
- Labels:
-
STM32Cube MCU Packages
-
STM32F3 Series
-
TIM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-03 05:22 AM
Check the configuration of TIM2 in STM32CubeMX.
Choose the TIM2 from the list. See if "Clock Source" is set in the "Mode" part of the GUI. Most likely you want it to be set as "Internal Clock".
Go to "NVIC Settings" tab in the "Configuration" part of the GUI to enable the TIM2 "global" interrupt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-03 04:33 AM
From the RM0316 reference manual:
9.4.13 Clock configuration register 3 (RCC_CFGR3)
...
Bit 24 TIM2SW:
...
Note: STM32F303xDxE and STM32F398xE only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-03 04:58 AM
Thanks, I missed that note in the datasheet. So the STM32F303CB definitely does have a TIM2 peripheral. Enabling Timer 1 and 2 from Cube creates the following inconsistencies:
TIM1 is setup correctly. The clock source for TIM2 is not enabled by default, I had to use the macro __HAL_RCC_TIM2_CLK_ENABLE instead. The NVIC interrupt was also not enabled, where TIM1 was.
Is this intended due to the different clock source configurations of TIM2?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-03 05:22 AM
Check the configuration of TIM2 in STM32CubeMX.
Choose the TIM2 from the list. See if "Clock Source" is set in the "Mode" part of the GUI. Most likely you want it to be set as "Internal Clock".
Go to "NVIC Settings" tab in the "Configuration" part of the GUI to enable the TIM2 "global" interrupt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-03 06:29 AM
I see now, apologies for the confusion. Thanks