Are there any known issues with timer configuration in CubeMX for the STM32F407VG?
@Middleware & OS I'm developing a low-level PID controller for motor speed control on an STM32F407VG microcontroller. I'm using the STM32CubeMX tool to generate the initial project setup. However, I'm encountering issues during timer initialization for the motor speed measurement.
When I try to configure Timer 2 in CubeMX for capture mode, I get an error message stating
I've reviewed the STM32F4 reference manual and ensured the OPM bit is set to 0 (disabled) in the TIMx_CR1 register. However, the error persists. I'm using STM32CubeMX version 6.1.0.
Can anyone advise on how to resolve this specific error and configure Timer 2 for capture mode for motor speed measurement on the STM32F407VG?
Are there any known issues with timer configuration in CubeMX for this specific microcontroller?
Here's a relevant snippet of my CubeMX timer configuration:
Clock Source:
Prescaler:
Auto-reload:
One Pulse Mode (OPM):
Update Event Source (URS):
When I try to configure Timer 2 in CubeMX for capture mode, I get an error message stating
I've reviewed the STM32F4 reference manual and ensured the OPM bit is set to 0 (disabled) in the TIMx_CR1 register. However, the error persists. I'm using STM32CubeMX version 6.1.0.
Can anyone advise on how to resolve this specific error and configure Timer 2 for capture mode for motor speed measurement on the STM32F407VG?
Are there any known issues with timer configuration in CubeMX for this specific microcontroller?
Here's a relevant snippet of my CubeMX timer configuration:
Clock Source:
Internal Clock (APB1 clock)Prescaler:
0Auto-reload:
65535 (maximum count)One Pulse Mode (OPM):
Disabled (cleared in TIMx_CR1)Update Event Source (URS):
Update generation on counter overflow/underflow (selected in CubeMX)Solution
@UC GEE the issue with using the HAL is that its super easy to get started, however, when one does eventually get stuck its quite hard to get unstuck, since you need to debug the HAL and your code.