Hello,
having developed applications for Atmel's 8bit microcontrollers for some time now I wanted to try ARM MCUs. The Primer1 seemed like an ideal tool to get started with it but I now realize that programming ARM MCUs is not as easy as I expected it to be. This is why I wanted to show You my first “Hello World” application before flashing it onto the Primer and probably damaging something.
So what I did was downloading the newest version of the ST Standard Peripheral Library (3.1.2) and creating a new Ride project inspired by the GPIO example supplied with the library. I reused their stm32f10x_it.c/h and stm32f10x_conf.h, defined STM32F10X_MD and USE_STDPERIPH_DRIVER and used the startup code supplied with the library.
Since the ST library assumes an external 8 MHz crystal being connected to the MCU but the Primer is equipped with a 12 MHz crystal I changed HSE_Value in “stm32f10x.h” accordingly and replaced “RCC_CFGR_PLLMULL9” with “RCC_CFGR_PLLMULL6” in the following line of the SetSysClockTo72() function in system_stm32f10x.h:
And now at last this is my main.c (which is also mostly a copy of the GPIO example):
Compiling it all works well. Have I done anything wrong or forgot something (and thereby putting the Primer hardware at risk)?
In addition to that question I was wondering whether there is any documentation on the peripherals of the STM32F10x family available. If You take a look at the datasheets of Atmel's AVRs every bit of every register controlling the peripherals is described very detailed. Is there anything similar for the STM32F10x?
Best regards