For starters you need the STM32 discovery board
check it out at mouser
Also you will need the Keil IDE. You can download a free limited to 32kb program space version here
First off you need to create a new project and select the processor in the ST Micro section
It will then ask you if you want to Copy STM32 Start up Code to the Project Folder. Choose yes. I would then recommend you use the Keil STM32_init files. I found them in a example code. It can be found here
Once you have downloaded the files, unzip it. Copy over the following files to the same folder as the project file.
Now add STM32_Init.c to your project. Right click on the Source Group 1 and click add file to group. You can group them however you want, it doesn't change how any thing builds.
Also, to keep things clean we will create a Bin folder. So we make a new directory in the same folder as our project. Next, right click on the Target folder and click options for target.
Then click output and click Select Folder for Objects and go find our bin folder that we created.
Finally, create and add a file (lets call it main.c). In there, add a main function that will call the Init code and include the init file. You might also want to include the STM32 lib file.
int main (void)
Now we need to set up our debugging environment for the STM32 Discovery. First we need to choose our debugger. So right click on the project and click options for target and head to the debug tab. Next, you don't want to be running a simulator so we will click the Use: radio button to the right half. in the drop down we will choose the ST-Link Debugger. Then you need to click setting and choose SWD. finally I like to have run to main() check so that is stops at the main before running.
Next we need to define the flashing tool to upload your program to the STM32. So head over to the Utilities tab and select the "Use Target Driver for Flash programming" radio button. Then you can choose the ST-Link Debugger from the drop down.