en.radzio.dxp.pl |
||||
Main menu Tutorials Code library for LCD
ATMEL AVR microcontrollers STMicro ST7 microcontrollers Projects Software
|
We are ready to writing application source code. Let us write in main.c file following lines :
Save the file and select comman "Build target" from "Project" menu. In the "Build output" window will be written following messages : Build target 'Target 1' We must defined, which type of STM32 microcontroller are used. So, go to the procject tree and click right mouse button on "Target1" folder icon, and select "Options for Target..." command from context menu : Next, go to "C/C++" tab and write in "Define" edit box "STM32F10X_MD_VL" string : After this try build application again. Still errors occur in Bould output window : Build target 'Target 1' In this case this is a linker error, that can't find symbol SystemInit. As we see, call for this symbol came from startup file and this is call for SystemInit function. We can go for a few ways : remove call for this function, write this function (may it be an empty function), and use function supplied by STMicro in thier device support for CMSIS library. We took last way, and use stm32f10x_system.c file. We need to download STM32 Std Periph library for STM32F10x devices. In archive with this library are folder "CMSIS", which we need to extract from the archive. We need olny the CMSIS folder. The STM32F10x_StdPeriph_Driver folder can be deleted ;-). Go to CMSIS\CM3\DeviceSupport\ST\STM32F10x subfolder, copy *.c and *.h files to folder with Your uVision project and add *.c files to the project tree. Now, try to build project. In "Build output window should be written following text : Build target 'Target 1' SUCCES! We have first compiled application for STM32!
|
|||
(c) Radosław Kwiecień |