New projects based STM32F103ZET6 - register version

1, create a new blank project

  Create a new folder, used to store the new project file. Creating MDK-PRO and OUTPUT two subfolders in this new folder. MDK-PRO folder used to store the project file; the OUTPUT for storing the project file output by the compiler.

  MDK software open, click on the "Project -> New uVision Project" to create a new project.

 

  Enter the name of the project and select the directory to store the new project.

  One is chosen.

 

  Click OK after creating an empty project. Figure

 

  Right-click MDK project with the Group bar, select 'Manage Project Items'. Group then added as shown in FIG.

  Then compile the output file first project is set to OUTPUT folder. In MDK software, select "Options for Target", in the pop up screen, select Output tab, click "Select Folder for Listings ...", in the pop up screen, select OUTPUT folder.

  Then select the Listing tab, click "Select Folder for Listings ...", also pop up screen, select OUTPUT folder.

 

2, add the startup file

  General STM32 project will need to load the boot code, the boot code is a piece of hardware and the associated assembly code.

  The main role of the startup code is as follows:

  Initialize the stack (SP) of.

  Initialize the program counter (PC).

  Setting the vector table entry address abnormal events.

  Calling the main function.

  ST has written a startup file, just find the corresponding chip startup file and then call it.

  ST offers a three startup file, these three documents are:

  startup_stm32f10x_ld.s startup file is small-capacity IC.

  startup_stm32f10x_md.s startup file is the capacity of the IC.

  startup_stm32f10x_hd.s startup file is large-capacity IC. 

  It refers to small capacity FLASH≤32KByte IC.

  It refers to the capacity of 64KByte≤FLASH≤128KByte IC.

  大容量是指256KByte≤FLASH≤512KByte的IC。

  STM32F103ZET6的FLASH容量为512KB,是大容量的IC,所以使用的启动文件是:startup_stm32f10x_hd.s。

  startup_stm32f10x_hd.s文件可以在官方提供的固件库里找到。

  将startup_stm32f10x_hd.s复制到MDK-PRO文件夹下。

   

  将startup_stm32f10x_hd.s文件添加到MDK软件中。

  选中startup_stm32f10x_hd.s文件后点击add。

 

  

 

Guess you like

Origin www.cnblogs.com/h1019384803/p/10961898.html