Skip to main content
JGaby.1
Associate II
February 23, 2025
Solved

Pin PB4 is pulled high during reset for a stm32F103

  • February 23, 2025
  • 3 replies
  • 1023 views

I am using an stm32F103 and have configured PB4 as a output pin and this works correctly. However when the chip is reset, this pin is automatically pulled high. It appears that this behavior exists because of the pin's dual use as NJTRST. Is there a way I can reconfigure the chip so that this pin will no longer be pulled high when the NRST pin is pulled low?

Thanks.

Best answer by Tesla DeLorean

https://www.st.com/resource/en/reference_manual/rm0008-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=171

Ok, not seeing that in the RM, are you sure it's not running the System Loader based on BOOTx pins.

Not saying you're wrong, but not used the F1's in projects for over a decade..

Ok, so mentioned as a PU here, looks like you're SOL

https://www.st.com/resource/en/reference_manual/rm0008-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=161

3 replies

Trevor Jones
Senior
February 23, 2025

You might have to move the function to another pin.

You can set the initial state of most of the pins, but not Reset.

This is a hardware function. It needs to be high to accept an incoming Reset signal.

Tesla DeLorean
Guru
February 23, 2025

Is it from a component on your JTAG header, or from the Pod?

I don't recollect it being a pull-high at reset pin, but the RM (RM0008) might be more specific, including the initial states for GPIO bank registers.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
JGaby.1
JGaby.1Author
Associate II
February 23, 2025

I am using Serial Wire for debugging, not JTAG. PB4 definitely goes high when I pull the reset low. It will also go high if I download a new program using STM32CubeMX with an ST Link V2. It will stay high until I run the program which configures PB4 to be an output pin with the low state.

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
February 23, 2025
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
JGaby.1
JGaby.1Author
Associate II
February 23, 2025

Thanks all for your help.