摘要
MCU芯片一般都使用JTAG作为调试接口,但JTAG至少要占用4个引脚,而SWD(Serial wire debugger)只占用2个引脚,适合封装引脚数较少的芯片。由于SWD是串行的,数据按时钟边沿一位一位传输。按照传统的编程方法,在大量编程时会导致冗余与复杂,难以理解与应用。通过对SWD协议的深入研究,首先将协议中复位、密钥、空闲、写指令等基本操作编写为基本任务,然后通过调用一些基本任务来编写中型任务,最后通过调用中型任务以实现大型任务的编写。在CDS/incisiv142仿真环境下,使用大型任务进行编程,实现了通过SWD调试接口访问的MCU芯片内核寄存器及外设。
Generally,the MCU chips use JTAG as the debugging interface,but JTAG takes up at least 4 pins,while SWD(Serial wire debugger) only takes up 2 pins,which is suitable for the encapsulating chips with fewer pins.Since SWD is serial,the data is transmitted one by one at the edge of the clock.According to the traditional programming method,the programs will be redundant and complex,and are difficult to understand and apply when a large number of programming.Through the in-depth study of SWD protocol,the basic operations are written as basic tasks,such as reset,key,idle,and write instructions in the protocol,then the medium-sized tasks are written by calling some basic tasks,and finally the large-scale tasks are written by calling medium-sized tasks.The kernel register and peripheral of the MCU chips are accessed by the debugging interface of SWD,which was implemented by programming with large tasks in the simulation environment of CDS/incisiv142.
作者
史兴强
鲍宜鹏
SHI Xingqiang;BAO Yipeng(China Electronics Technology Group Corportion No.5S Research Institute,Wuxi 214072,China)
出处
《电子与封装》
2019年第1期32-36,共5页
Electronics & Packaging