0
\$\begingroup\$

I created a board with a STM32F030F4Px and am trying to connect to my micro over SWD using STM32CubeProgrammer. Each time I try to connect, I keep getting a message saying "Error ST-LINK error (DEV_TARGET_HELD_UNDER_RESET)".

Looking back at my schematic, I clearly do not have the NRST pin tied according to ST's recommendation. enter image description here

Here is what they said to do enter image description here

Would omitting the capacitor hold this under reset permanently, thus causing my issue with the ST Link? What would the cap serve to do assuming no pull-down button in the configuration as they have shown?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ NRST is an "active low" signal, meaning when low (as you have it, tied to ground) will put the chip in reset and keep it there. The recommended circuit shows a capacitor and a momentary contact switch. The internal Rpu will keep the pin high and out of reset until you press the button. The cap helps debounce the signal. If you don't need to manually reset the part you can omit the capacitor and switch and just leave the pin floating. But you can't ground it - that will keep it in reset forever. \$\endgroup\$
    – td127
    Jan 19, 2023 at 2:24
  • \$\begingroup\$ Let's say you have the recommended circuit above. If you don't push the button there is still a path with a capacitor in series to ground. Will the cap in that path ensure the internal reset is pulled up through the Rpu resistor whereas not having that cap will cause it to be pulled down? \$\endgroup\$
    – Jack Frye
    Jan 19, 2023 at 10:53

2 Answers 2

0
\$\begingroup\$

Moving comments to answer, with more detail.

NRST is an "active low" signal, meaning when low (as you have it, tied to ground) will put the chip in reset and keep it there. The processor can’t run when in reset and this completely explains the DEV_TARGET_HELD_UNDER_RESET error.

The chip has an internal pullup (Rpu, nominally about 40k) that will pull NRST high and out of reset.

The recommended circuit shows a capacitor and a momentary contact switch.

The small capacitor to ground is a good idea for two reasons:

  1. Upon power up the capacitor will charge via the Rpu resistor. The charge time is approximately .1u * 40k = 4ms. This ensures a valid reset pulse at power on. Without it there is essentially no reset pulse being supplied so the processor may not boot properly (although there may be some other internal reset mechanism to handle the power on case).
  2. As Figure 22 note 1 says, this capacitor also protects against “parasitic resets”. If pin is floating (no cap) then NRST is a fairly high impedance (40k) node that could be susceptible to high frequency edges on nearby traces capacitively coupling to NRST and causing bogus resets.

The pushbutton is optional, providing a manual way to temporarily discharge the capacitor and reset the device. When you let go the capacitor will charge again to VDD via Rpu.

\$\endgroup\$
2
\$\begingroup\$

Your schematic shows NRST connected directly to Ground. This will hold the processor in Reset - it can't run with that pin grounded.

Since the chip has an internal pull-up resistor on NRST, you can leave that pin unconnected to allow the processor to run.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.