cancel
Showing results for 
Search instead for 
Did you mean: 

Solved; STM32F437VG: remove AF for a JTAG pin (pin 0x0F) make it be a GPIO.

Rob Meades
Senior

I use `HAL_GPIO_Init()` to configure my GPIO pins, setting my `GPIO_InitTypeDef` structure initially to zero and then configuring the Pin, Mode, Pull and Speed parameters as I require but leaving Alternate at 0 since I do not want an Alternate function, I want a GPIO.

This works fine for all of my pins except for pin 0x0f which is pre-assigned to use Alternate function 0 (for JTAG): calling `HAL_GPIO_Init()` as described above does nothing useful for this pin, it never becomes the output I'm trying to make it (the pin remains firmly at 0 V when measured after having been set to high with `HAL_GPIO_WritePin()`). I guess this is because it is by default using Alternate function zero and somehow needs to be told NOT to use that Alternate function, to just be a GPIO please.

How do I achieve that? The config settings I am passing to `HAL_GPIO_Init()` to try to set this pin to be an open-drain output are as below.

Pin	0x8000	
Mode	0x11
Pull	0x00	
Speed	0x00	
Alt	0x00

I've searched these forums and find mentions of functions/macros that disable JTAG but a search of the HAL (v1.25.0) for "jtag" finds no such functions. What am I missing?

1 ACCEPTED SOLUTION

Accepted Solutions
Rob Meades
Senior

S'OK turns out that it *was* working, just that the HW attached to that pin needed push-pull not open drain output. All solved!

View solution in original post

1 REPLY 1
Rob Meades
Senior

S'OK turns out that it *was* working, just that the HW attached to that pin needed push-pull not open drain output. All solved!