2026-02-21 2:06 AM - last edited on 2026-02-21 5:00 AM by mƎALLEm
SYS CONFIG
===========================================
IO Supplys = 3,3V, VCORE = 2,5V regulator used, FSystem = 200 MHz
Timer1 is configured for Output Compare CH1, sig 0.1MHz 50% duty expected (all necessary clk enabled)
Compare SIG is routed to PK1 via alternate conf
__HAL_RCC_GPIOK_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_1;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
HAL_GPIO_Init(GPIOK, &GPIO_InitStruct);Same signal routed to another port/same load with same routine is working properly
Same problem and behavior with TIM8 witch can use the same PK1 pin
Note1 : if internal pull-up or pulldown added to pin conf, the pin is no longer floating, Hi(3,3V) for pull-up, Low(0,1V) for pulldown but still no signal output (input mode supposed)
Note2 : The fact pull mode is reflected to pin when changed implies no addressing error. Output should be Hi or Low for compare output
Note3 : This same pin used as Output (no alternate function) works properly
Note4 : Same PK1 behavior when writing directly into GPIOK.AFRL register with emulator (floating when TIM1 (0x10) or TIM8 (0x30)). Normal output when 0...
===========================================
It seems the alternate functions may not be routed to port K but IDE software and doc say they can...
Please HELP as this problem implies a very hight modification cost (10 layer board, BGA...)
Solved! Go to Solution.
2026-02-21 4:59 AM
Hello @serge_stm32dev and welcome to the ST community,
1- In next time please use </> button to share the code. Your post will be edited to follow this community rule.
2- Check if the IO is not broken by simply toggling it using HAL_GPIO_TogglePin()
3- I also invite you to use CubeMx to configure and generate your code at least for tests.
2026-02-21 4:59 AM
Hello @serge_stm32dev and welcome to the ST community,
1- In next time please use </> button to share the code. Your post will be edited to follow this community rule.
2- Check if the IO is not broken by simply toggling it using HAL_GPIO_TogglePin()
3- I also invite you to use CubeMx to configure and generate your code at least for tests.