STM32 Uart and PWM doesn't work at the same time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-04-10 6:42 AM
Hello, I have urgent work. In the code I have, pwm is written as bare metal and uart is written with hal. I am using the STM32 F401RE model. PWM uses TIM1 CH1 and Ch2, TIM 10, TIM11, and Uart is with the TIM 2 Hal library. When I run the code alone, both of them work separately but when I combine them, they do not work. Since the codes are a bit long, I am sending them as a file. Your ideas are very valuable, please help.
- Labels:
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-04-10 6:55 AM - edited 2025-04-10 6:56 AM
Welcome to the forum.
For best results, please see: How to write your question to maximize your chances to find a solution.
In particular, please give details of your hardware.
@Maprex wrote:when I combine them, they do not work. .
So your first step is to narrow-down what, exactly, is "not working".
- Use the debugger
- Add instrumentation
- Compare & contrast the 'working' and 'not-working' cases.
There's no inherent reason why a UART shouldn't work at the same time as PWM,
@Maprex wrote:the codes are a bit long,
Try simplifying to a minimal system which demonstrates the problem.
A complex system designed from scratch never works and cannot be patched up to make it work.
