ST micro STM32G030J6M6 Programming it on arduino? - SOLVED

I tried to program it with a ch340 But I'm getting this problem.

Arduino: 1.8.16 (Windows 10), Board: "Generic STM32G0 series, Generic G030C6Tx, STM32CubeProgrammer (SWD), Enabled (generic 'Serial'), None, Smallest (-Os default), None, Newlib Nano (default)"

Sketch uses 10152 bytes (30%) of program storage space. Maximum is 32768 bytes.

Global variables use 840 bytes (10%) of dynamic memory, leaving 7352 bytes for local variables. Maximum is 8192 bytes.

      -------------------------------------------------------------------

                       STM32CubeProgrammer v2.10.0                  

      -------------------------------------------------------------------



Error: No debug probe detected.

Error: No debug probe detected.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Joseph

The software is configured to use ST-Link programming device. You haven't selected serial programming in the IDE.

For serial programming, Cube is not required.

Hello, aarg This is my setup in IDE.

Edit: Looking at the wiring and I'm not sure. This is my wiring.

Pin2: to VDD +
Pin3: to VSS -
Pin5: to TX
Pin6: to RX
Pin8: to High 3.3v for boot unless I'm doing that wrong.

Joseph

Oh, with that core you do need the Cube, sorry. When I was using serial it was with Roger's Maple core. So that is different. Did you verify that the selected serial port (in your case, D65) is really selected and not just a default value? That it really points to your USB UART (I assume that is what you're using for an interface?). Especially as you are getting an error message related to that...

Also, if you have made your circuit as a rough prototype, have you obeyed all the rules for a default minimum system (bypass caps, correct oscillator, etc.)?

I need to figure this out. I'm not sure if I'm doing all this correctly. Let me start from the begining. you said you are or was using Roger's Maple core, Is this it https://github.com/rogerclarkmelbourne/Arduino_STM32 ? The second thing is the wiring pinout for a FTDI is correct. But the Boot pin does it go directly to 3.3v when programming? Also I was wondering If it is for the same processor did you use the STM32G030J6M6?

Joseph

No, Roger's core is derived from the Maple core, which, if I recall correctly, only supports the STM32F103. It's a great core for that chip, but I decided to go with the STM official core
https://github.com/stm32duino/Arduino_Core_STM32
because it supports so many processor variants.

I wonder if it's useful to compare what I'm doing with your setup, because I'm using complete, STM32G030F6P6 production modules not a prototype. I'm using the debug port for programming using an ST-Link, not serial boot loader.

In the data sheet, there is a table showing the processor modes that have to be set for serial programming. I can't help you with that because it's been several years since I did it.

As you know, there are 1,000,000 things that can go wrong with a prototype, and just about as many things that can go wrong with a bootloader upload. So it would be a good idea to follow the usual path of posting schematics, images and details of the upload procedure you are using.

I think it would be much easier to program it using the SWCLK and SWIO pins and an ST-Link programmer, than the serial bootloader. Just less uncertainty to deal with. It's possible that the UART is not accessible for bootloading after reset, on an 8 pin IC.

Also if you haven't already obtained the reference manual for the chip, do so. It's a different more detailed document than the data sheet.

At the moment I can not program this. I don't have a ST-link adapter or can not afford one. I'm trying to learn the arduino way. But it looks like that is impossible. No matter what I try or learn online even in this community I can not even get this processor to program.

Joseph

Just incase you think these are wildly expensive, just check aliexpress or similar:

The ones I saw from amazon or ebay was around 20 to 60 dollars. Now I know what to look for I did find one on amazon.

Edit: Would this https://www.amazon.com/HiLetgo-Emulator-Downloader-Programmer-STM32F103C8T6/dp/B07SQV6VLZ one work for programming this processor using the IDE?

Joseph

Is there a way to do it without a STM link programmer using some type of FTDI, ch340 or any type of arduino board? Does this proxessor had SWD programmer. I'm looking at the datasheet But I can not tell if it has it.

Joseph

All I can say is that that looks exactly like the one I use to program the STM32F103C8T6 "Bluepill" board using the Arduino IDE together with the STM32CubeProgrammer software.
The "bluepill" and the ST-Link are amazing value for money. Having said that, so is the ESP32.

Okay, I have just enough to order one. I was wondering if this 8 pin processor can be programmed by SWD programmer? I do have one I can program like that if it is possible. Looking at the datasheet it looks like I can do it maybe.

Joseph

@6v6gt It looks like it connect and read it with the cube software. So what is the next step to try it with arduino ide?

Joseph

That is some progress.
Wire a led with a series resistor between an unused pin of this chip and ground.
In the Arduino IDE create a custom version of the blink sketch referring to that pin.
Select the appropriate board in the IDE, then verify/upload your sketch.

Do I need to keep connected to the cube software for the IDE to work? Also sense it is 8 pins I'm unsure what is pinout. how do I find it becuase I never did a Pa or PD pin? This is new to me.

IIRC the IDE launches the Cube Programmer automatically in order to upload the code. For pins, it's likely that it will reference them the same way as with the Blue Pill, PAx, PBx and so on...

There are only 8 pins all together. But they say PA and PB pins.

Joseph

Right, and those are the names you would use.

When I tried that in a blink LED I get this.

digitalWrite(PA7, HIGH); // turn the LED on (HIGH is the voltage level)

Blink:28:11: error: 'PA7' was not declared in this scope; did you mean 'A7'?

Joseph

Try PA12 which is physical pin 7 according to this which may be similar: stm32 - STM32G030J6M6 Debug issue - Electrical Engineering Stack Exchange

Edit
Or maybe it is PA10 by default and not PA12. But also try @anon57585045 suggestion.