2025-08-25 1:23 PM
Hi all, I need to use TIM1 CH1 (PK1) as an input-capture pin for a speed sensor in my TouchGFX project. So, I generated the project from TouchGFX and opened the .ioc in CubeIDE, enabled TIM1 for CM7 and set channel1 (PK1). The display does not start correctly (black or freezes) after I debugged it. When I halt the CPU, the call stack shows it is stuck in MT48LC4M32B2_Delay, MX_FMC_Init() and entered bspsdram error handler. I indicated that the generated project uses tim6 for sys_m7 timebase source but I can't use TIM1 right now and don't know what to do.
2025-11-05 6:11 AM
I’m on a different STM32H7 device, but I hit the same symptom (black/frozen display).
In my case, after enabling TIM1 CH1 on PK1 in the .ioc, CubeMX silently reset the HAL timebase (TIM2) NVIC priority to 15. That changed
#define TICK_INT_PRIORITY (4UL)
to
#define TICK_INT_PRIORITY (15UL)
in stm32h7xx_hal_conf.h, and the HAL delays stopped advancing during SDRAM init.
Fix (via .ioc):
CubeMX → System Core → SYS: confirm Timebase Source = TIM2.
CubeMX → System Core → NVIC: set “TIM2 global interrupt ” = 4
Generate code (you should see #define TICK_INT_PRIORITY (4UL) again).
After restoring TIM2 IRQ priority = 4, the display starts normally and I can still use TIM1 CH1 (PK1).