cancel
Showing results for 
Search instead for 
Did you mean: 

Starting at the beginning. What is needed?

RJunc
Associate

I have done several projects with STM32 devices on various development boards. I now want to do a project that is at the chip level. The first of these projects will use a STM32G030F6 8-pin device. This needs to be a tiny board.

Up til now I have been using Visual Studio to do the programming and download directly to Arduino, Teensy, etc. from there. Although I would like to stay with the VS IDE, I am not whetted to it. (I also have a STM-Link v2.)

So my question is, what do I need to get from an IDE (VS or other) down to programming the chip. Basic questions I know but I have no been able to find a clear definitive process. Go easy on the acronyms for now. Some of it is just alphabet soup to me.

Thanks in advance.

7 REPLIES 7
KnarfB
Principal III

With the STM32CubeProgrammer you can download (flash) your code to the chip via STM-Link v2. This tool comes also handy to check or change the user option bytes. You probably want to do this because 8-pins is not much and you have to make decisions if you need BOOT0 pin, NRST pin etc..

You need two pins for power+gnd and if you can assign two more pins permanently to the STM-Link v2 debug connection (SWDCLK + SWDIO) then you can easily debug (e.g. step-by-step) your code, leaving you 4 pins for your application.

Pin planning can be done graphically using STM32CubeIDE or stand-alone STM32CubeMX tools.

The chip of your choice is not the easisest to manage because several pads are internally connect to one pin. Check the forum for common pitfalls. As an alternative you might look at TSSOP-14 or -20 MCUs.

Study the "Getting started with STM32... Series hardware development" app notes for your board design.

KnarfB

RJunc
Associate

Knarf, I very much appreciate your straight forward and easy to understand response. Very good points. The application is quite simple. I need to get more than the standard +/-90° of rotation out of a specialized servo. (Ideally something on the order of +/- 160°.) I started by designing a custom PCB using purpose designed servo controller ICs but I can't find any sources for them. They must all be obsolete now. I suspect that all the servo manufacturers have gone to MCUs now so that is where I find myself.

I am comfortable writing the code for the application but using available boards are just too big because they have far more features than this application will ever use.

As for pins, two for power, one for the desired position pulse in, one for the PWM out, one for the direction out, and one analog pin for the feedback pot. That is a total of 6. That leaves two for SWCLK and SWDIO.

A TSSOP-14 device would be ideal but as far and I can tell, they are all ultra-low power which this not necessary for this application. The main stream TSSOP-20 devices (STM32F031F6) will certainly work. The cost goes from $1 to $2 each but that is not the end of the world.

Thanks again for the assistance and I will look into the Cube tools.

Bob

KnarfB
Principal III

Hi Bob,

btw. STM32G030F6 is not 8-pin, that would be STM32G030J6.

For prototyping, a STM32G0316-DISCO board https://www.st.com/en/evaluation-tools/stm32g0316-disco.html might come handy, having its own STLINK.

KnarfB

Pavel A.
Evangelist III

If you are comfortable with VS, just use Visual GDB. It's good. Of course it works with ST-LINK.

Free Keil for Cortex M0 should work for STM32G0.

-- pa

Piranha
Chief II

For serious development EmBitz is also a nice fully free option. Make an empty project, add linker script, startup file, CMSIS files and off you go. The compiler is GCC and it works with ST-LINK and J-Link out of the box.

0693W000001sgu3QAA.pngEmbitz, really? The website doesn't look trustworthy to me. The latest release is from 2016.

Yes, really. Well, you see that the server is actually not down and a major release is coming... ;) Anyway all of that doesn't change the fact that the tool is great and does what it's intended for much better than Eclipsoids. It feels like a hybrid of uVision and Visual Studio. And, as it uses GCC, there is nothing to worry about the future, because your code is already written for GCC and you can migrate to anything GCC based at any moment.