Author Topic: STM32G0 SO8N  (Read 340 times)

0 Members and 1 Guest are viewing this topic.

Offline Dubbie

  • Supporter
  • ****
  • Posts: 1089
  • Country: nz
STM32G0 SO8N
« on: March 15, 2021, 11:57:44 pm »
Has anyone here used this part?
I was wondering how it works if you want to use SWD. Does that knock out 2 pins or is it easy to use them dual purpose? Do you need to use the reset pin for programming?

I was hoping to use them as a replacement for ATiny85's. I currently have those in a drawer for when I need a quick one off MCU for some sort of basic task like timing, counting or something.

I wanted to switch to STM32 so I don't have to maintain 2 toolchains and 2 HALs in my head :D
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 7822
  • Country: us
    • Personal site
Re: STM32G0 SO8N
« Reply #1 on: March 16, 2021, 12:31:14 am »
On reset SWD pins are assigned as a programming interface, but the firmware may disable them and then they can be used as standard GPIO pins. Your circuitry attached to the pins must be compatible with SWD. In practice it means that it should not have anything that would pull them strongly high or low.

You don't really need a reset, but if the firmware switches off SWD pins immediately, it may be tricky to reprogram the part without a reset pin.
« Last Edit: March 16, 2021, 12:32:58 am by ataradov »
Alex
 
The following users thanked this post: Dubbie

Offline Dubbie

  • Supporter
  • ****
  • Posts: 1089
  • Country: nz
Re: STM32G0 SO8N
« Reply #2 on: March 16, 2021, 12:36:56 am »
So maybe a 1 second delay or something before configuring the reset as GPIO should do the trick? And then remove power and connect with SWD hardware attached?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 7822
  • Country: us
    • Personal site
Re: STM32G0 SO8N
« Reply #3 on: March 16, 2021, 12:46:31 am »
Yes, at least for prototyping, delay reconfiguration of system pins and going into low power modes.

Having SWD hardware attached will not do anything, since the software must run and be able to intercept execution. ST devices will let debugger connect to the core while reset is asserted. So asserting the reset while power cycling should recover the device from any state, but the programmer/debugger software must support this.

So generally it is better to reuse SWD pins first and leave the reset to be the last pin reassigned as GPIO, since in that case you would not need to power cycle the device to enable SWD pins.
Alex
 

Offline Dubbie

  • Supporter
  • ****
  • Posts: 1089
  • Country: nz
Re: STM32G0 SO8N
« Reply #4 on: March 16, 2021, 04:25:50 am »
Thanks ataradov. Very helpful info.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf