Skip to main content
moez0102
Associate
July 15, 2019
Question

How we should do to configure the PG10-NRST pin as NRST? (we just choise GPIO_Input?)

  • July 15, 2019
  • 2 replies
  • 3461 views

I am using the STM32G473

LQFP48

This topic has been closed for replies.

2 replies

Yoichi Shinoda
Senior
July 26, 2019

As described in RM440:

8.3.16 Using PG10 as GPIO

  • PG10 may be used as reset pin (NRST) or as a GPIO. Depending on the NRST_MODE bits in the user option byte, it switches to those mode:
  • Reset input/output: default at power-on reset or after option bytes loading NRST_MODE = 3
  • Reset input only: after option bytes loading NRST_MODE = 1
  • GPIO PG10 mode: after option bytes loading NRST_MODE = 2

See description on the NRST pin in Section 6.1.2: System reset

Visitor II
February 23, 2024

Where could I refer this NRST pin section 6.1.2 u r mentioning? Could u please help.

Peter BENSCH
Technical Moderator
February 23, 2024

@NVDS Unfortunately, @Yoichi Shinoda has taken the text from an old revision of RM0440, the section Using PG10 as GPIO can now be found as point 9.3.16 in the current revision 7. The reference in the last sentence has therefore also slipped back one section from 6.1.2 to 7.1.2.

Hope that helps?

Good luck!
/Peter

Associate III
April 25, 2024

@Peter BENSCHHi Peter, I've read the parts of the RM0440 Reference Manual which deal with NRST_MODE bits and the nBOOT0 bit.  On the firmware creation side, where should I set the NRST_MODE and bBOOT0 ? 

Is it something that's done through CubeMX?  If so, which rubric is it under?

Is this something I should call from my code?  Is there an code example?

What's the best practice?

I want to use the NRST as a reset input only.  nBOOT0 has a 10k pull-down.  Neither will be used as GPIO.

[I poked around CubeMX.  Tried to look it up on the web.  Searched the generated code for NRST_MODE.  But alas haven't found anything yet.]

Peter BENSCH
Technical Moderator
April 25, 2024

@Nick Alexeev This can be set in the option bytes, either via the STM32CubeProgrammer (function OB on the left) or from your code via the HAL function FLASH_OB_UserConfig or HAL_FLASHEx_OBProgram, for example. In most applications, however, the option bytes are programmed in production using the respective programmer.

Hope that helps?

Regards
/Peter