CS代写 STM32F4 Series and expand it

• What are ARM tools
• What is Keil
• What are
• Installing Keil Lite

Copyright By PowCoder代写 加微信 powcoder

• Create a new project using Keil
• Stepping through a simple assembly program • Understanding an assembly program

What is DK-ARM?
• Keil is a Cortex-M Development platform • There are many other platforms
• MDK-ARM stands for Microcontroller Development Kit for ARM
• Keil’s latest version is 5: www2.keil.com/mdk5
• There are many components to DK-ARM • uVision Integrated Development Environment (IDE)
• Compilation tools (C/C++)
• Assembler
• Link unities (used to program the physical device) • Simulator (when no hardware is available)
Aside from Keil there are many other open source and commercial tools: https://en.wikipedia.org/wiki/List_of_ARM_Cortex-M_development_tools

What is DK-ARM?

DK-ARM Editions See http://www.keil.com/mdk5/selector
• MDK-Professional contains all features of MDK-Plus. In addition, it supports IPv4/IPv6 dual-stack networking, IoT connectivity, and a USB Host stack. Once available, MDK-Professional includes ARMv8-M architecture support and a license for DS-MDK.
• MDK-Plus contains middleware libraries for IPv4 networking, USB Device, File System, and Graphics. It supports ARM Cortex-M, selected ARM Cortex-R, ARM7, and ARM9 processor based microcontrollers.
• MDK-Cortex-M supports Cortex-M processor-based microcontrollers.
• MDK-Lite is code size restricted to 32 KByte and intended for product evaluation, small projects, and the educational market.

Compilation Flow in Microcontroller Software Interface Standard (CMSIS)
• CMSIS provides the interface between the microcontroller peripherals and the MDK Middleware
• For our projects we need to have CMSIS CORE and DEVICES Startup files added to our code

Installing Keil-1
• visit www2.keil.com/mdk5/
• Download MDK-Lite
• After the download has finished, double click the .exe to install the program.
• Once installed, click finish
• The pack installer will load, and it takes some time for it to find all the
new packages available for install.
• Allow the pack installer to finish searching (shown by the action bar at the bottom of the screen)

Installing Keil – 2
• On the left side of the window under Devices, click to expand STMicroelectronics.
• Find STM32F4 Series and expand it
• Double click on STM32F401RE and it should add it to the packs list on the right side.
• Click all the buttons that say Install or Update to get all the features/packages that Keil offers.

• Open Keil uVision 5 from your Windows
• Make sure all projects are closed:
• Project→CloseProject
• Click on Project→new uVision Project … [1]
• In the window click on [1]
• Type the name of the project: ASM_NewProject [2]
• Go to the new folder that you just created [3]

Start A -2
• The Select Device window pops up
• In the search type: STM32F401RETx
• Click on the device (STM32F401RETx) that showed up and then click OK

Start A -3
• At this point the Manage Run window pops up
• CHECK CMSIS → CORE and DEVICE→STARTUP boxes – note that the color changes
• Then click OK

Start A -4
• At tis point your Project window should show the CMSIS and DEVICE – these are the CMSIS system initialization files and startup files in order for the RUN TIME to operate [1]
• Click on the OPTIONS FOR TARGET [2]
• Click on DEBUG tab [3]
• CHECK the SIMULATOR [4]
• Click on OK
• In the PROJECT window click on Source Group 1 and select ADD NEW ITEM….
• In the new window select

Start A -5
• In the PROJECT window click on Source Group 1 and select ADD NEW ITEM….
• In the new window select ASM files
• Then type the name of the ASM file: ASM_NewProject.s
• Click on ADD

Start A -6
• In the project window click on ASM_NewProject.s under the Source Group 1 folder
• Open the file
• Type in the following code
• Save the file
• Press F7 and make sure there are no
errors (as shown below)
• Click on the debug button – shown above
• Make sure there are no errors and step through the code as you click on the STEP IN button shown above
*** Using Compiler ‘V5.06 update 5 (build 528)’, folder: ‘C:\Keil_v5\ARM\ARMCC\Bin’Build target ‘Target 1’assembling change_register.s…linking…Program Size: Code=188 RO-data=404 RW-data=0 ZI-data=1536 “.\Objects\NewProject.axf” – 0 Error(s), 0 Warning(s).Build Time Elapsed: 00:00:00

Start A -7
• Setup your project windows are shown below
• To do so, click on VIEW and select the appropriate window
Assembly & Startup)
Disassembler

Let’s Examine The Code
• What are the values of the registers after you step through the entire code?
• What is the value of P?
• What happens if we change #P to P and remove #?
• In the Disassembler note how the codes are displayed. What is the starting memory location for the assembly code?
• What is the OPCODE for MOV instruction?
• What is the OPCODE for ADD instruction?
• How large (in terms of bits) is register R0?
• What exactly the following command achieves? ADD r2,r0,r1

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com