cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 Config JTAG PB4 As Gpio Output?

Natali
Associate III

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

5 REPLIES 5

" a problem occurs in the program."

Could you perhaps be a little more specific?

When using the debugger? Or times when you are not?

https://www.st.com/content/ccc/resource/training/technical/product_training/group0/8a/bf/62/da/24/f0/49/7b/STM32H7-System-Debug_DBG/files/STM32H7-System-Debug_DBG.pdf/_jcr_content/translations/en.STM32H7-System-Debug_DBG.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Natali
Associate III

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

Natali
Associate III

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);

> 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

Natali
Associate III

"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