cancel
Showing results for 
Search instead for 
Did you mean: 

Disable NRST STM32G030J6

AARTA.1
Associate

I have a design with a STM32G030J6 (SOIC8) controller. I don't need an external reset. I want to use the pin 4 as a GPIO (PA1). I connect a button to this input. I select the appropriate option in CubeMX, but when the button is clicked, the controller resets. How can I disable NRST from this pin?

0693W000001saHKQAY.png

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Connect with STM32CubeProgrammer and change the nBOOT_SEL=1 and nBOOT0=1 option bytes to boot to flash regardless of the state of that pin.

Edit: My eyes saw BOOT0 and my mind read NRST.

The STM32G0x1 has an NRST_MODE option byte. But I don't see that for the STM32G0x0 series. Seems like you can't use that pin.

There is this note in the datasheet which suggests it's not possible to have these in another other than input mode:

For the device in SO8N package, the PA0, PA1, and PA2 GPIOs are bonded with NRST on the pin 4. In order not to interfere with device functions, they must not be set in alternate function or in output but remain at all times in input configuration.

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

View solution in original post

8 REPLIES 8
TDK
Guru

Connect with STM32CubeProgrammer and change the nBOOT_SEL=1 and nBOOT0=1 option bytes to boot to flash regardless of the state of that pin.

Edit: My eyes saw BOOT0 and my mind read NRST.

The STM32G0x1 has an NRST_MODE option byte. But I don't see that for the STM32G0x0 series. Seems like you can't use that pin.

There is this note in the datasheet which suggests it's not possible to have these in another other than input mode:

For the device in SO8N package, the PA0, PA1, and PA2 GPIOs are bonded with NRST on the pin 4. In order not to interfere with device functions, they must not be set in alternate function or in output but remain at all times in input configuration.

If you feel a post has answered your question, please click "Accept as Solution".
S.Ma
Principal

I was told that G0 family goes to small pincount packages and for example, BOOT pin is shared with SWDCLK, and Reset can turn as GPIO (like SWDCLK/IO if not debugging). Double or triple bonding is just short circuit multiple pads of the die to reduce package pincount In essence, we should focus only on RESET pin functionality. To my understanding, disabling RST to use it as GPIO requires to modify the option byte, which won't be set up by the source code, nor the bin file. You probably need to do something with cube programmer to access the option byte before you flash your code.

Also, in this case, make sure the STLink reset HW control is disconnected and configure it NOT to generate reset pulse when start debug session (make sense to think consequences of changes)

AARTA.1
Associate

Thank you! This is true!

0693W000001sax1QAA.png

JDavisDD
Associate II

On the STM32CubeProgrammer you do it by selecting the option byte NRST_MODE and chose # 2 which is GPIO: standard GPIO functionality, only internal RESET possible0693W00000D1aJ3QAJ.png wji

Looks like you're using STM32F030 whereas the OP is using STM32G030. They do not share the same option bytes.

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

You're mistaken.

If you look at the screenshot that I posted in detail you will notice that the device is an STM32G03x series. What you see as a F030R4 "BOARD"is the identification of a nucleo STLINK section of that nucleo board. That line identifies the programmer not the target device. You can separate a nucleo STLINK programmer and make a standalone STLINK programmer with any nucleo that has one.

0693W00000D1asSQAR.png0693W00000D1ayuQAB.jpg

0693W00000D1azTQAR.jpg

You can see how to do it here.

I must not have looked past the board type.
However, G03x is ambiguous. G030 doesn't have NRST_MODE per the reference manual while G031 does. They do not share the same RM.
If you feel a post has answered your question, please click "Accept as Solution".

I tried doing this and fried my microcontroller i think. When i pressed apply, after changing the settings shown in your instructions, i get a bunch of errors and the board disconnects. When trying to connect again it says No STM32 target found.

I used a new board and it works fine so im pretty sure i broke something.