2020-07-09 02:39 PM
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?
Solved! Go to Solution.
2020-07-09 04:06 PM
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.
2020-07-09 04:06 PM
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.
2020-07-09 08:44 PM
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)
2020-07-09 11:20 PM
Thank you! This is true!
2021-08-04 07:35 PM
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 possible wji
2021-08-04 07:53 PM
Looks like you're using STM32F030 whereas the OP is using STM32G030. They do not share the same option bytes.
2021-08-04 11:59 PM
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.
You can see how to do it here.
2021-08-05 07:05 AM
2023-08-14 01:59 PM
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.