stm32 learning experience - build environment to build 103 407 3/2

2.2  F4
 
uploading.4e448015.gifDump failed to re-upload canceled
 
uploading.4e448015.gifDump failed to re-upload canceled
 
 
 

3) USER add files 
 
2.1 F1 Department of class
 
copy:  mian.c / stm32f10x_conf.h / stm32f10x_it.c / stm32f10x_if.h / system_stm32f10x.c
 
uploading.4e448015.gifDump failed to re-upload canceled
 
 
 
copy :  stm32f10x.h /   system_stm32f10x.h  
Since the last replication so do not already have a copy system_stm32f10x.c
 
uploading.4e448015.gifDump failed to re-upload canceled
 
 
result
 
uploading.4e448015.gifDump failed to re-upload canceled
 
 
 
 

3.2  F4
 
copy: main.c / stm32f4xx_conf.h / stm32f4xx_it.c / stm32f4xx_it.h / system_stm32f4xx.c
 
uploading.4e448015.gifDump failed to re-upload canceled
 
copy:stm32f4xx.h / system_stm32f4xx.h
 
uploading.4e448015.gifDump failed to re-upload canceled
 
The results are as follows
 
uploading.4e448015.gifDump failed to re-upload canceled
 
 
Add files to this stage is over, enter the keil create specific projects 
 
 

 
3. Create Project
 
3.1 F103
 
uploading.4e448015.gifDump failed to re-upload canceled
uploading.4e448015.gifDump failed to re-upload canceled
uploading.4e448015.gifDump failed to re-upload canceled
 

 
 
Explain here if you find that you do not have the source file 103 or 407, first, you do not have to install MDK please Baidu own resources, and second, you do not have to install this library can be installed here
uploading.4e448015.gifDump failed to re-upload canceled
 
 

 
 
uploading.4e448015.gifDump failed to re-upload canceled
 
 
This can be used to configure peripheral, header files and the like are useful, I still fumbling, then write a small article in conjunction with the things I learned from a teacher there, explain roughly this system we built and adapted for different types of chip operation, now please click cancel
 
uploading.4e448015.gifDump failed to re-upload canceled
 
 

 
These are under before we add the corresponding file folder, you open on the line
 
uploading.4e448015.gifDump failed to re-upload canceled
 
You may not see .s files, to change the file type to
 
uploading.4e448015.gifDump failed to re-upload canceled
 
ctrl + a select all
 
uploading.4e448015.gifDump failed to re-upload canceled
 
 

Click on 
uploading.4e448015.gifDump failed to re-upload canceled
 
The output tab, select the create hex file hex file, click select folder for objects point to the directory folder OBJ
 
uploading.4e448015.gifDump failed to re-upload canceled
 
This added to the startup file, STM32F10X_HD, USE_STDPERIPH_DRIVER
Future use different chips, as long as a change in the front, behind a change is not required
 
uploading.4e448015.gifDump failed to re-upload canceled
 
Click to add the header file include paths
 
This refers to .h file, the file must be located
uploading.4e448015.gifDump failed to re-upload canceled
 
 

 
Finally, we put this file into the main.c file
 
 
#include "stm32f10x.h"
 void Delay(u32 count)
 {
  u32 i=0;
  for(;i<count;i++);
 
 }
 int main(void)
 {   
  GPIO_InitTypeDef  GPIO_InitStructure;
 
  RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOD, ENABLE); // Enable PA, PD Port Clock
 
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8; //LED0-->PA.8 port configuration
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // push-pull output
  GPIO_InitStructure.GPIO_Speed ​​= GPIO_Speed_50MHz; // IO port speed of 50MHz
  GPIO_Init (GPIOA, & GPIO_InitStructure); // set according to the initialization parameter GPIOA.8
  GPIO_SetBits (GPIOA, GPIO_Pin_8); //PA.8 high output
 
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; //LED1-->PD.2 port configuration, push-pull output
  GPIO_Init (GPIOD, & GPIO_InitStructure); // push-pull output, IO port speed of 50MHz
  GPIO_SetBits (GPIOD, GPIO_Pin_2); //PD.2 high output       
  while(1)
    {
        GPIO_ResetBits(GPIOA,GPIO_Pin_8);
        GPIO_SetBits(GPIOD,GPIO_Pin_2);
        Delay(3000000);
        GPIO_SetBits (GPIOA, GPIO_Pin_8);
        GPIO_ResetBits(GPIOD,GPIO_Pin_2);
        Delay(3000000);
    }
 }
 
 

Click Compile
 
uploading.4e448015.gifDump failed to re-upload canceled
 
You can increase or decrease based on the actual needs in peripheral FWLIB file to improve the compilation speed, thus a suitable file 103 to the now finished
Published 126 original articles · won praise 27 · views 60000 +

Guess you like

Origin blog.csdn.net/qq_24890953/article/details/51584275