Page 1 of 2

STM32G030J6M6 pinout.

Posted: Wed Feb 09, 2022 2:55 pm
by josephchrzempiec
Hello, A friend od mine gave me 3 of the STM32G030J6M6 processors. From What I'm reading they are great little procressors and I would love to use them. But I have some problems and questions.

My first problem is from what I'm reading I would need a SWD programmer and I do not have one. Can I use a normal uart programmer like a ftdi or a ch340 to programm this processor?

The second question is the pinout for arduino. What Pins are which? for an example. i2c, uart, spi the normal arduino pinout things. I have been looking in the datasheet and I'mnot good at datasheet But I would love to try this processor.

Can someone please help me to figure this out.


Joseph

Re: STM32G030J6M6 pinout.

Posted: Wed Feb 09, 2022 4:51 pm
by fpiSTM
Hello
josephchrzempiec wrote: Wed Feb 09, 2022 2:55 pm My first problem is from what I'm reading I would need a SWD programmer and I do not have one. Can I use a normal uart programmer like a ftdi or a ch340 to programm this processor?
Yes, you can use flash using uart using the stm32 boot rom. You can refers to https://www.st.com/content/ccc/resource ... 167594.pdf
josephchrzempiec wrote: Wed Feb 09, 2022 2:55 pm The second question is the pinout for arduino. What Pins are which? for an example. i2c, uart, spi the normal arduino pinout things. I have been looking in the datasheet and I'mnot good at datasheet But I would love to try this processor.
All info are available in the variant:
https://github.com/stm32duino/Arduino_C ... xx/G030J6M

In this files you will have all peripherals available per pins:
https://github.com/stm32duino/Arduino_C ... eralPins.c

Re: STM32G030J6M6 pinout.

Posted: Wed Feb 09, 2022 5:29 pm
by josephchrzempiec
Hello, Thank you for the information and help. In the arduino IDE I have this Selected. I attached an image below. Can you please let me know if this is correct? I just want to make sure this is all correct. I have never used a stm micro processor before and I don't want to mess it up.

stm32-8pinprocessor.png
stm32-8pinprocessor.png (49.29 KiB) Viewed 2795 times

Joseph

Re: STM32G030J6M6 pinout.

Posted: Wed Feb 09, 2022 5:36 pm
by fpiSTM
Set USB to none. As this one has no USB support.

Re: STM32G030J6M6 pinout.

Posted: Wed Feb 09, 2022 5:43 pm
by josephchrzempiec
So change the usb support to none? From what I'm seeing it looks like from the variant.h the uart pins are PA2 for TX and PA15 for RX is that correct? these are the pins I can use to upload code?


Joseph

Re: STM32G030J6M6 pinout.

Posted: Wed Feb 09, 2022 10:35 pm
by GonzoG
josephchrzempiec wrote: Wed Feb 09, 2022 5:43 pm So change the usb support to none? From what I'm seeing it looks like from the variant.h the uart pins are PA2 for TX and PA15 for RX is that correct? these are the pins I can use to upload code?


Joseph
MCU datasheet is your friend:
https://www.st.com/resource/en/datashee ... g030j6.pdf
page 14

Re: STM32G030J6M6 pinout.

Posted: Wed Feb 09, 2022 10:55 pm
by josephchrzempiec
I honetly did not see the pinout in that area. I might of passed it without seeing it. Thank you very much.


Joseph

Re: STM32G030J6M6 pinout.

Posted: Thu Feb 10, 2022 8:55 am
by fpiSTM
josephchrzempiec wrote: Wed Feb 09, 2022 5:43 pm So change the usb support to none? From what I'm seeing it looks like from the variant.h the uart pins are PA2 for TX and PA15 for RX is that correct? these are the pins I can use to upload code?
You can read this: https://github.com/stm32duino/wiki/wiki ... ods#serial

Referring to the AN2606:
G030JM_BL_Serial.png
G030JM_BL_Serial.png (49.23 KiB) Viewed 2702 times
So with this G030J6M, you can only use PA9/PA10 (in the peripheral pins it is PA_9_R and PA_10_R because they are remap respectively to PA11and PA12) as shown here:
G030JM_remap.png
G030JM_remap.png (9.22 KiB) Viewed 2702 times
Finally to enter in bootloader you have to follow one of this pattern. I don't know how the Option bytes are configured by default but I guess/hope it is the one using the Boot0 (PA14) pin value:
G030JM_BL_Serial_pattern.png
G030JM_BL_Serial_pattern.png (9.31 KiB) Viewed 2702 times

Re: STM32G030J6M6 pinout.

Posted: Fri May 06, 2022 7:02 am
by josephchrzempiec
Hello, Sorry for the late respond back. I been so busy with famil and taking care of my father and my friends family I had to put my projects on hold. I'm once again at it. From my understanding I can use a FTDI programmer to program this processor is this correct? Also Thank you all for helping me with the pinout. Your community is awesome. From what I can see Because The RX and TX pins Is there any other pin I would need for programming? I saw a Boot0 (PA14) pin in there is that needed and Where does that go in for programming mode?

Joseph

Re: STM32G030J6M6 pinout.

Posted: Fri May 06, 2022 8:17 am
by fpiSTM
I would try this:

- Connect your FTDI to PA9/PA10
- Boot your board with pin PA14 (Boot0) high
- Launch the STM32CubeProgrammer and select 'UART' instead of "ST-Link"
- Select the correct port COM and try to connect

If it is OK you should be able to flash.
Don't forget to set PA14 to low before hard reset to be able to start your flashed application else it will reboot in bootloader mode again.

So if you succeed simply do the same when using Arduino (select STM32CubePrrogrammer (Serial)) and the correct Port COM in the IDE then start your board in BL mode.