cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 GPIO Configuration utility????

turkalp_kucur
Associate
Posted on August 04, 2011 at 12:41

Hello there...

My aim is, I need to be able to configure ports of stm32. 

Is there an utility/software in order to configure GPIO of it?

Any help, feedback will be so helpful!..

5 REPLIES 5
Nickname13136_O
Associate II
Posted on August 05, 2011 at 13:19

Hello,

you can download STM32 fw library. In the examples you can see how to configure GPIOs for different configuration. Is it the right answer for your question?

Posted on August 05, 2011 at 14:55

The inference here is a desire for a utility the allows you to select peripherals or combinations of them and have it fit and spit out the GPIO configuration code for the desired STM32 part, if I'm not mistaken.

I recall someone posting a nice excel sheet a while back, but I don't know if it survived the meltdown of the forum.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Fristedt.Jan
Associate II
Posted on August 05, 2011 at 15:01

It's much easier to read the reference manual (RM0008). In section 8.2.1 p157 you can find a good description of how it's done.

Don't forget to enable the clocks (RCC section)  for the ports first!

It's basically one nibble for each port pin:

0x0000    analog in

0x0001    GP out PP 10MHz

0x0010    GP out PP 2MHz

0x0011    GP out PP 50MHz

0x0100    floating in

0x0101    GP out OD 10MHz

0x0110    GP out OD 2MHz

0x0111    GP out OD 50MHz

0x1000    in with PU/PD

0x1001    AF out PP 10MHz

0x1010    AF out PP 2MHz

0x1011    AF out PP 50MHz

0x1100    reserved

0x1101    AF out OD 10MHz

0x1110    AF out OD 2MHz

0x1111    AF out OD 50MHz

GP: general purpose

AF: alternate function

PU: pull-up

PD: pull-down

PP: push-pull

OD: open-drain

tbenson
Associate II
Posted on August 05, 2011 at 16:26

Have you seen this?

http://www.st.com/internet/evalboard/product/251717.jsp

The last time I used it, it only supported the stm32f105/7 and stm32f205/7.  Perhaps it has been updated, or maybe you are using one of those. In either case, that should help. 

Of course you will learn more if you dig through the documentation, though that isn't always enjoyable. I remember using a tool called DAVE when we worked with Infineon parts... It would actually generate drivers, which was nice (when they worked).

donald2
Associate II
Posted on August 06, 2011 at 01:52

The spreadsheet is over in the VLDiscovery forum.  I've updated it a few times.

It only covers the 64 pin package, but I could rework it for other packages if there was interest.  It should be pretty easy since the pinouts are so similar.

We have only designed with the 36, 48 and 64 pin packages.  Picking a pin assignment that allows changing between them with minimal layout changes  is easy with the right chart.  From experience I can say that the most important thing is avoiding the errata.