2022-07-03 02:35 PM
hi
when i use normal configuration for define this pin(PB4 in STM32H743) as GPIO output a problem occurs in the program.
This pin is connected to the JTAG port and i use only SWD mode and pull up this pin by 10k to VCC.
plz help me to config this pin as GPIO
2022-07-03 03:27 PM
" a problem occurs in the program."
Could you perhaps be a little more specific?
When using the debugger? Or times when you are not?
2022-07-03 03:46 PM
in my PCB i connect Buzzer to pin 4 in port I (PI4). when i config PB4 as output for control a led the buzzer dont work. if i use PB3 instead PB4 everything work fine
2022-07-03 03:52 PM
i use this code for config PB4 as output is this true?
GPIO_InitTypeDef GPIO_InitStruct = {0};
__HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin : PB4 */
GPIO_InitStruct.Pin = GPIO_PIN_4;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
2022-07-03 11:11 PM
> i connect Buzzer to pin 4 in port I (PI4). when i config PB4 as output for control a led the buzzer dont work
Isn't there a hardware problem, e.g. isn't there a short between PI4 and PB4?
How is PI4 configured? Read out and check/compare GPIOI registers content in the two cases (working/non-working).
JW
2022-07-04 01:45 AM
"Isn't there a hardware problem" yes something like this:smirking_face:
This was a small mistake on my part .
buzzer VCC provide by PB4 and buzzer ON/Off control by PI4.
when i Reset PB4 this cuse VCC disconnect and buzzer dont work.
however above code can config PB4 as GPIO output without any problem. thank you