Skip to main content
SCook.1
Associate III
December 3, 2020
Question

I want to program an STM32F103C8T6 in-circuit using the SWD interface and an ST-Link. If I don't have a reset button, do I still need to connect a capacitor and pullup resistor to the NRST pin?

  • December 3, 2020
  • 7 replies
  • 3248 views

..

This topic has been closed for replies.

7 replies

KnarfB
Super User
December 3, 2020

The stm32f103c8.pdf data sheet "NRST pin characteristics" says "The reset network protects the device against parasitic resets." which means the 0.1µF C. A pull-up R is strictly not required but does not hurt and gives you an extra test point if not populated.

TDK
December 3, 2020

There have been reports on this forum of getting spurious resets when not including the 0.1uF capacitor, so it is not something I would skip here. It will be application dependent on if you actually need it or not.

"If you feel a post has answered your question, please click ""Accept as Solution""."
SCook.1
SCook.1Author
Associate III
December 5, 2020

Thank you for your answers. So the C and R are nothing to do with any reset button per se, they are there to force a reset on power-up, and to prevent spurious resets when running. Would that be a fair interpretation of your answers?

TDK
December 5, 2020

> they are there to force a reset on power-up, and to prevent spurious resets when running. Would that be a fair interpretation of your answers?

They don't force a reset on power-up. The POR does that by keeping NRST low until voltage is stable. The C prevents spurious resets. I would skip the R if it were my board, especially if space is a concern, but as KnarfB says, it will do no harm.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Piranha
Principal III
December 5, 2020

The C is there to introduce additional delay when POR and all other reset sources have given "good to go". The MCU already has an integrated pull-up for charging that C. By adding additional R, one decreases the effect (delay) for which the C is put there in the first place. Actually reduced delay time can cause problems in some situations and there are topics with those problems in this forum as well. Read the AN2586 section 1.3 and look at figure 5.

Why do so many people put that wrong R there? Because of copy-paste designing from the deficient BluePill?

https://freeelectron.ro/wp-content/uploads/2019/12/blue-pill-schematic.png

Peter BENSCH
ST Technical Moderator
January 12, 2022

Very many users still use the external pull-up because the MCUs of the last century had no internal current source, so indeed some kind of copy'n'paste.

This is just like how some universities still use the letters i or j as a counter for loops, even though this once came from a language called FORTRAN, where I...N were implicit integers.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
SCook.1
SCook.1Author
Associate III
December 6, 2020

Okay, so from AN2586 it seems that I'm recommended to use an external capacitor, but I don't need an external resistor, as there's an internal pullup. Just to be sure, will this arrangement still allow me to program my STM32 in-circuit using the SWD interface?

TDK
December 6, 2020

Yes, provided your SWD is wired correctly.

"If you feel a post has answered your question, please click ""Accept as Solution""."
SCook.1
SCook.1Author
Associate III
December 7, 2020

So my SWD wiring consists of a 4-pin header connected to SWCLK (Pin 37) and SWDIO (Pin 34), together with ground and +vcc. Is that correct?

TDK
December 7, 2020
I would add NRST but it's not strictly necessary. It's correct provided your pin numbers are correct.
"If you feel a post has answered your question, please click ""Accept as Solution""."