基于ARM Cortex-M0+ KL系列MCU的汇编构件设计Design of assembly component based on KL series MCU in ARM Cortex-M0+
蔡伯峰,王宜怀
摘要(Abstract):
汇编编程的复杂性及有关32位ARM Cortex-M0+等内核汇编开发资料和样例程序的短缺,使编程者学习、研究和开发微处理器汇编程序难度很大。针对这一现状,在对ARM Cortex-M0+内部寄存器、汇编指令系统等进行深入分析的基础上,以NXP半导体公司KL系列MCU为蓝本,提出一种规范、易用、实用的汇编构件设计编程方法。该方法根据软件工程构件设计思想,基于构件封装要点分析和汇编工程框架,设计并实现汇编构件,并给出了典型UART模块的汇编底层驱动构件的样例程序。通过对汇编构件设计编程方法的使用和样例程序的学习与理解,降低嵌入式汇编学习和编程难度,并进而轻松设计其他类似的规范化的汇编构件和程序。
关键词(KeyWords): ARM Cortex-M0+;汇编构件设计;KL系列MCU;底层驱动构件;汇编工程框架;UART
基金项目(Foundation): 国家自然科学基金项目(61070169);; 江苏省高等职业院校国内高级访问学者计划资助项目(2015FX078)~~
作者(Author): 蔡伯峰,王宜怀
DOI: 10.16652/j.issn.1004-373x.2018.01.009
参考文献(References):
- [1]ARM.Cortex-M0+processor technical reference manual[DB/OL].(2012-12-16)[2016-06-20].http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0432c/index.html.
- [2]NXP.KL25 sub-family reference manual[EB/OL].(2012-09-01)[2016-06-20].http://www.nxp.com/.
- [3]蔡剑卿,王宜怀,冯德旺,等.可移植的UART底层驱动构件设计[J].福建农林大学学报(自然科学版),2014,43(3):332-335.CAI Jianqing,WANG Yihuai,FENG Dewang,et al.Design of UART′s bottom-layer driving component with good portability[J].Journal of Fujian Agricultural and Forestry University,2014,43(3):332-335.
- [4]胡宗棠,王宜怀.构件化Cold Fire系列MCUs通用GPIO驱动设计[J].微计算机信息,2012,28(4):69-71.HU Zongtang,WANG Yihuai.Component-oriented general GPIO driver design of Cold Fire series MCUs[J].Microcomputer information,2012,28(4):69-71.
- [5]杨炯,曹金华,王宜怀.基于KL25的UART通信UHM构件研究与实现[J].实验室研究与探索,2014,33(9):122-126.YANG Jiong,CAO Jinhua,WANG Yihuai.Research and realization of UHM unit for UART based on KL25[J].Laboratory research and exploration,2014,33(9):122-126.
- [6]凌艺春,黄飞.汇编程序移植性的研究与实践[J].制造业自动化,2011,33(3):174-175.LING Yichun,HUANG Fei.Research and practice of assembler portability[J].Manufacturing automation,2011,33(3):174-175.
- [7]NXP.Kinetis KL25 sub-family data sheet[EB/OL].(2014-08-01)[2016-06-20].http://www.docin.com/p-2035480854.html.
- [8]GIOVANI G,SEBASTIAN F.Tracing and recording interrupts in embedded software[J].Journal of systems architecture,2012,58(9):372-385.
- [9]王宜怀,朱仕浪,郭芸.嵌入式技术基础与实践:ARM CortexM0+Kinetis L系列微控制器[M].3版.北京:清华大学出版社,2013:48-51.WANG Yihuai,ZHU Shilang,GUO Yun.Embedded technology foundation and practice:ARM Cortex-M0+Kinetis L series microcontrollers[M].3rd ed.Beijing:Tsinghua University Press,2013:48-51.
- [10]ARM.Cortex-M0+devices generic user guide[EB/OL].(2012-12-18)[2016-06-20].https://wenku.baidu.com/view/f26247f2-f61fb7360b4c65a9.html.
- [11]NXP.Kinetis assembler reference manual[EB/OL].(2014-02-01)[2016-06-20].http://www.nxp.com/.