Skip to main content
dungeonlords789
Associate III
January 3, 2021
Solved

gpio let down 5 V pull-up

  • January 3, 2021
  • 2 replies
  • 1241 views

I use stm32f401's PB4 (NJTRST) pin. I attached 5 V pull-up resistor (5.1k) to PB4. While MCU is in reset mode the voltage on PB4 is 4.26 V. Only after starting the system, the voltage increases to 5 V. In my program I configure PB4 as input without pull-up or pull-down, just input. I couldn't find an explanation in AN4899.

Why voltage is 4.26 while reset? Is it because of schmitt trigger?

This topic has been closed for replies.
Best answer by Michal Dudka

It has nothing to do with SWD. Reference manual:

https://www.st.com/resource/en/reference_manual/dm00096844-stm32f401xb-c-and-stm32f401xd-e-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf

at page 148 in section 8.3.1 specify that

"During and just after reset ... PB4: NJTRST in pull-up"

Your pullup and internal JTAG pullup probably creating voltage divider... After startup, your code set pin from AF (JTAG function) to Input and deactivates that pullup.

2 replies

Michal Dudka
Lead
January 3, 2021

I gues that pin has during reset some JTAG function (NJRST), after startup is pin reconfigured from to desired mode...

dungeonlords789
Associate III
January 3, 2021

I use SWD only.

Michal Dudka
Michal DudkaBest answer
Lead
January 3, 2021

It has nothing to do with SWD. Reference manual:

https://www.st.com/resource/en/reference_manual/dm00096844-stm32f401xb-c-and-stm32f401xd-e-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf

at page 148 in section 8.3.1 specify that

"During and just after reset ... PB4: NJTRST in pull-up"

Your pullup and internal JTAG pullup probably creating voltage divider... After startup, your code set pin from AF (JTAG function) to Input and deactivates that pullup.

TDK
Super User
January 3, 2021

Just to clarify, "reset mode" means VDD/VDDA is still powered, but NRST is held low?

"If you feel a post has answered your question, please click ""Accept as Solution""."