cancel
Showing results for 
Search instead for 
Did you mean: 

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

moez0102
Associate II

I am using the STM32G473

LQFP48

5 REPLIES 5

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

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

Peter BENSCH
ST Employee

@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

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.

@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.]

@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

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.