cancel
Showing results for 
Search instead for 
Did you mean: 

Can the STM32G030 nRST pin disabled, or be used as GPIO?

TLaut.1
Associate

Hi guys!

We are running a project using STM32G0 MCU-s. We used STM32G031 in the previous iteration, but, due to budget reasons, we now ended up with STM32G030-s, beleiving these are basically interchangeable for our purposes.

Due to some board error, we now need to disable the NRST pin (or, rather set it up to be a GPIO in this case). On the older G031 boards, we can perform this from code through the option bytes, but to our surprise, the G030 manual misses these bytes altogether.

Using the older STM ST-Link utility, we were able to program the bytes on a test device somehow, and set up proper functionality, but I have a bad feeling about this. We have quite a few production devices where the programming pins are not accessible anymore, and we can only disable NRST with a software update. If we brick them, there's no way of bringing them back.

So... is there any way to safely set up NRST as GPIO on G030s from software? Is it a supported feature at all?

Thanks for your help!

10 REPLIES 10
TDK
Guru

The NRST pin can't be disabled or repurposed on this chip.

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

The device seems pretty useless without the functionallity to disable the reset. The SPI peripheral is not usable because the SCK AF is on the reset pin. Can we hear about this from STM directly? Is there really no way to use SPI on the STM32G030J6?

Antoine Odonne
ST Employee

Hello,

Indeed NRST configuration cannot be disabled on this value line part. This option is only part of the G031 access line products.

Regarding SPI, I think you can map SPI2_SCK on pin 1 - PB8, and MISO on pin 8 - PB6 and MOSI on pin 5 - PA11[PA9] after remapping it digitally to PA9.

I hope it might help,

Best regards,

Antoine

S.Ma
Principal

ST Link utility is replaced by CubeProgrammer tool.

Hello Antoine

Thanks a lot for your reply but it does indeed work. We managed to reconfigure the RESET pin as SPI-SCLK. We did it by modifying the flash config bit NRST in the STM32CubeProgrammer. The NRST bit is not visible in the option bits tab but in the memory table it is.

Thanks anyway.

Best regards,

André Krummenacher

I am trying to do the same thing. Where exactly did you find the NRST and what did you change it to?

I can see something called "NRST_MODE" in the REG viewer, is that it? What did you change it to?

Yes, that is what you are looking for. Set it to 0x2 if you want to use the pin as gpio.

NRST 28:27

00: Reserved

01: Reset Input only: a low level on the NRST pin generates system reset, internal RESET

not propagated to the NSRT pin

10: GPIO: standard GPIO pad functionality, only internal RESET possible

11: Bidirectional reset: NRST pin configured in reset input/output mode (legacy mode)

Gawron
Associate

Hello!

I have tried to disable NRST pin to enable SPI communication. 
Using STM32 ST-LINK Utility I have changed NRST_MODE, but now i cannot even perform full chip erase.

Did I bricked it?

pdemianczuk
Associate

Hi, #meToo ;p

I have done the same, one day after you @Gawron 

STM32CubeProgrammer dont have this option, so I think this some bug/feature from ST, and it wasnt written or deleted from DS/RF.