IAR的使用教程.ppt
《IAR的使用教程.ppt》由会员分享,可在线阅读,更多相关《IAR的使用教程.ppt(61页珍藏版)》请在三一办公上搜索。
1、,IAR的使用方法,Contents,软件安装,新建STM32工程模板,程序下载及调试,两个例子,4,1,2,3,1.软件安装,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,1.软件安装,IAR版本:V7.1Step1:,Image information in product Note to cu
2、stomers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,1.软件安装,IAR版本:V7.1Step2:打开安装包等待安装包解压,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You ma
3、y not extract the image for any other use.,1.软件安装,IAR版本:V7.1Step3:选择安装“IAR Embbedded Workbench”,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,1.软件安装,IAR版本:V7.1Step4:点击“Next”
4、,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,1.软件安装,IAR版本:V7.1Step5:选择安装目录,Image information in product Note to customers:This image has been licensed to be used within th
5、is PowerPoint template only.You may not extract the image for any other use.,1.软件安装,IAR版本:V7.1Step6:安装结束后将破解工具复制到安装目录下,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,1.软件安装,I
6、AR版本:V7.1Step7:点击“Patch”,显示框中出现一下信息证明破解成功。File patched!OK-PATCHING DONE-,2.新建STM32工程模板,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,Step1:下载STM32固件库(http:/www
7、.stmcu.org/),Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,Step1:下载STM32固件库(http:/www.stmcu.org/),Image information in product Note to customers:This image has
8、 been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,Step1:下载STM32固件库(http:/www.stmcu.org/),Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not
9、 extract the image for any other use.,2.新建STM32工程模板,什么是STM32库?在51单片机的程序开发中,我们直接配置51单片机的寄存器,控制芯片的工作方式,如中断,定时器等。配置的时候,我们常常要查阅寄存器表,看用到哪些配置位,为了配置某功能,该置1还是置0。这些都是很琐碎的、机械的工作,因为51单片机的软件相对来说较简单,而且资源很有限,所以可以直接配置寄存器的方式来开发。STM32库是由ST公司针对STM32提供的函数接口,即API(Application Program Interface),开发者可调用这些函数接口来配置STM32的寄存器,
10、使开发人员得以脱离最底层的寄存器操作,有开发快速,易于阅读,维护成本低等优点。当我们调用库的API的时候可以不用挖空心思去了解库底层的寄存器操作,就像当年我们学习C语言的时候,用prinft()函数时只是学习它的使用格式,并没有去研究它的源码实现,如非必要,可以说是老死不相往来。实际上,库是架设在寄存器与用户驱动层之间的代码,向下处理与寄存器直接相关的配置,向上为用户提供配置寄存器的接口。,2.新建STM32工程模板,为什么采用库来开发?对于STM32,因为外设资源丰富,带来的必然是寄存器的数量和复杂度的增加,这时直接配置寄存器方式的缺陷就突显出来了:1)开发速度慢2)程序可读性差这两个缺陷直
11、接影响了开发效率,程序维护成本,交流成本。库开发方式则正好弥补了这两个缺陷。而坚持采用直接配置寄存器的方式开发的程序员,会列举以下原因:1)更直观2)程序运行占用资源少初学STM32的同学,普遍因为第一个原因而选择以直接配置寄存器的方法来学习。认为这种方法直观,能够了解到是配置了哪些寄存器,怎样配置寄存器。事实上,库函数的底层实现恰恰是直接配置寄存器方式的最佳例子,想深入了解芯片是如何工作的话,只要追踪到库的最底层实现就能理解,相信你会为它严谨、优美的实现方式而陶醉。要想修炼C语言,就从ST的库开始吧。,2.新建STM32工程模板,库目录、文件简介,Image information in p
12、roduct Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPeriph_Lib_V3.5.0LibrariesCMSIS“core_cm3.c文件”在CoreSupport中的是位于CMSIS标准的核内设备函数层 的M3核通用的源文件core_cm3.c和头文件core_cm3.h,
13、它们的作用是为那些采用Cortex-M3核设计SOC的芯片商设计的芯片外设提供一个进入M3内核的接口。这两个文件在其它公司的M3系列芯片也是相同的。至于这些功能是怎样用源码实现的,我们可以不用管它,我们只需把这个文件加进我们的工程文件即可,有兴趣的可以深究。,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other us
14、e.,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPeriph_Lib_V3.5.0LibrariesCMSIS“DeviceSupport文件夹”,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPe
15、riph_Lib_V3.5.0LibrariesCMSIS“system_stm32f10 x.c文件”是由ST公司提供的,遵守CMSIS标准。该文件的功能是设置系统时钟和总线时钟,M3比51单片机复杂得多,并不是说我们外部给一个8M的晶振,M3整个系统就以8M为时钟协调整个处理器的工作。我们还要通过M3核的核内寄存器来对8M的时钟进行倍频,分频,或者使用芯片内部的时钟。所有的外设都与时钟的频率有关,所以这个文件的时钟配置是很关键的。,Image information in product Note to customers:This image has been licensed to b
16、e used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPeriph_Lib_V3.5.0LibrariesCMSIS“stm32f10 x.h文件”所有处理器厂商都会将对内存的操作封装成一个宏,即我们通常说的寄存器,并且把这些实现封装成一个系统文件,包含在相应的开发环境中。这样,我们在开发自己的应用程序的时候只要将这个文件包含进来就可以了,Image information in produc
17、t Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPeriph_Lib_V3.5.0LibrariesCMSIS“启动文件(startup)”文件名的英文缩写的意义如下:cl:互联型产品,stm32f105/107系列vl:超值型产品,stm32f100系列xl:超高密度(容量)产品,
18、stm32f101/103系列ld:低密度产品,FLASH小于64Kmd:中等密度产品,FLASH=64 or 128hd:高密度产品,FLASH大于128,2.新建STM32工程模板,库目录、文件简介 STM32F10 x_StdPeriph_Lib_V3.5.0LibrariesCMSIS“启动文件(startup)”启动文件是任何处理器在上点复位之后最先运行的一段汇编程序。在我们编写的c语言代码运行之前,需要由汇编为c语言的运行建立一个合适的环境,接下来才能运行我们的程序。所以我们也要把启动文件添加进我们的的工程中去。总的来说,启动文件的作用是:1.初始化堆栈指针SP;2.初始化程序计数
19、器指针PC;3.设置堆、栈的大小;4.设置异常向量表的入口地址;5.配置外部SRAM作为数据存储器(这个由用户配置,一般的开发板可没有外部SRAM);6.设置C库的分支入口main(最终用来调用main函数);7.在3.5版的启动文件还调用了在system_stm32f10 x.c文件中的SystemIni()函数配置系统时钟,在旧版本的工程中要用户进入main函数自己调用SystemIni()函数。,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPeriph_Lib_V3.5.0LibrariesSTM32F10 x_StdPeriph_Driver,Image i
20、nformation in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPeriph_Lib_V3.5.0LibrariesSTM32F10 x_StdPeriph_Driver,Image information in product Note to custome
21、rs:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPeriph_Lib_V3.5.0ProjectSTM32F10 x_StdPeriph_Template“stm32f10 x_it.c文件”专门用来编写中断服务函数的,在我们修改前,这个文件已经定义了一些系统异常 的接口,其它普通中断服务函数由我们自己添加。但是我们
22、怎么知道这些中断服务函数的接口如何写呢?是不是可以自定义呢?答案当然不是的,这些都有可以在汇编启动文件中找到,具体的大家自个看库的启动文件的源码去吧。,Image information in product Note to customers:This image has been licensed to be used within this PowerPoint template only.You may not extract the image for any other use.,2.新建STM32工程模板,库目录、文件简介STM32F10 x_StdPeriph_Lib_V3.5
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- IAR 使用 教程

链接地址:https://www.31ppt.com/p-5433853.html