2025-07-11 8:59 AM - edited 2025-07-11 9:01 AM
Hello ST Community,
I'm working on an STM32 project where I use TIM1 Input Capture + DMA to log timestamps of Hall sensor edges (motor feedback) on TIM1_CH1 (PA8). The captured values (CCR1) are stored in a circular DMA buffer.
I have a 1ms PID interrupt, where I:
- Poll the DMA buffer to process new timestamps
- Calculate motor speed
- Generate precise PWM signals
So, I do not want DMA interrupts, because I manually poll the buffer in the PID loop.
---
Problem I'm Facing:
I'm also running CAN communication in this project.
When the Hall sensor edge interrupts were enabled, they sometimes delayed or blocked CAN transmissions, especially when the motor is running at high speeds.
That’s why I switched to DMA-based Input Capture, so the Hall sensor events are logged with zero CPU overhead and no interrupt latency, which also helps ensure smooth and timely CAN transmission.
However, Cube MX automatically enables the DMA interrupt for TIM1_CH1 capture, and I don't want that.
---
My Question:
How can I disable the DMA interrupt for TIM1_CH1 in Cube MX, while still using DMA to store CCR1 values?
I want a clean solution that does not require manually disabling NVIC settings after every Cube MX code generation.
---
My Setup:
- MCU: STM32G0B1CBT6
- Timer: TIM1 (Input Capture Mode)
- DMA: Circular mode for TIM1_CH1
- GPIO: PA8 as TIM1_CH1 (connected to Hall sensor)
- PWM & PID: Done in 1ms interrupt
- CAN: High priority communication running in parallel
- Requirement: Keep DMA active but disable DMA interrupts completely
Any help would be highly appreciated!
Thanks,
Gaurav
2025-07-11 10:48 AM
uncheck Force DMA channel interrupts, then you can disable the DMA interrupts in the table
hth
KnarfB