Project Creation In Μvision Ide
Project Creation In Μvision Ide
Project Creation In Μvision Ide
Summary
This tutorial takes the following the kits as an example of creating a project in Keil IDE for assembly programs.
Discovery kit with STM32L152RCT6 MCU (Cortex-M3)
Discovery kit with STM32L476VG MCU (Cortex-M4 with FPU and DSP)
Note that the project does not use the default startup files provided by Keil. You need to download a
modified version of startup_stm32l1xx_md.s or startup_stm32l476xx.s from the book website:
http://web.eece.maine.edu/~zhu/book/lab.php.
If did not see the targeted processor in the list, click the “Pack Installer” button and install the component
Keil::STM32L1xx_DFP or Keil::STM32L4xx_DFP.
1
Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C ISBN 0982692633
4. Select CMSIS Core only. Do NOT select “Device Startup”. Instead, you should use the one provided by the
course website.
5. If you are STM32L1 discovery kit, add the following source code files into the project. Right click the
“Source Group” and select “Add Existing Files to Group.” You can download the following source codes
from the textbook website and adds into the project if you are creating an assembly-based project.
startup_stm32l1xx_md.s
core_cm3_constant.s
stm32l1xx_constants.s
stm32l1xx_tim_constants.s
main.s
If you use STM32L4 discovery kit, add the following source code files into the assembly-based project.
core_cm4_constants.s
stm32l476xx_constants.s
startup_stm32l476xx.s
main.s
2
Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C ISBN 0982692633
If you are creating a C project, then you should include the following:
startup_stm32l1xx_md.s or startup_stm32l476xx.s
main.c.
From the menu, click Project ⟶ Option for Target, Go to the Output page, select “Create HEX file”
3
Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C ISBN 0982692633
Go to the Linker page, select “Use Memory Layout from Target Dialog”
4
Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C ISBN 0982692633
Go to the Flash Download page, and verity that STM32L1xx On-chip Flash is selected in the Programming
Algorithm. If not, click “Add” and select STM32L1xx On-chip flash in the popped dialog.
5
Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C ISBN 0982692633
You can ignore the following warning when the linking stage:
.\Objects\lab.sct(8): warning: L6314W: No section matches pattern *(InRoot$$Sections).
Connect your discovery kit to the computer and download the program to the STM32L processor.