中国半导体行业协会封装分会会刊

中国电子学会电子制造与封装技术分会会刊

导航

电子与封装 ›› 2019, Vol. 19 ›› Issue (1): 032 -36. doi: 10.16257/j.cnki.1681-1070.2019.0008

• 电路设计 • 上一篇    下一篇

基于HDL任务的SWD协议实现与仿真

史兴强,鲍宜鹏   

  1. 中国电子科技集团公司第五十八研究所,江苏 无锡 214072
  • 收稿日期:2018-07-06 出版日期:2019-01-21 发布日期:2019-01-21
  • 作者简介:史兴强(1976—),男,江苏宜兴人,1999年毕业于南京理工大学电子工程专业,现从事SoC数字设计及低功耗技术研究。

Implementation and Simulation of the SWD Agreement Based on the HDL Task

SHI Xingqiang,BAO Yipeng   

  1. China Electronics Technology Group Corportion No.58 Research Institute,Wuxi 214072,China
  • Received:2018-07-06 Online:2019-01-21 Published:2019-01-21

摘要: MCU芯片一般都使用JTAG作为调试接口,但JTAG至少要占用4个引脚,而SWD(Serial wire debugger)只占用2个引脚,适合封装引脚数较少的芯片。由于SWD是串行的,数据按时钟边沿一位一位传输。按照传统的编程方法,在大量编程时会导致冗余与复杂,难以理解与应用。通过对SWD协议的深入研究,首先将协议中复位、密钥、空闲、写指令等基本操作编写为基本任务,然后通过调用一些基本任务来编写中型任务,最后通过调用中型任务以实现大型任务的编写。在CDS/incisiv142仿真环境下,使用大型任务进行编程,实现了通过SWD调试接口访问的MCU芯片内核寄存器及外设。

关键词: MCU, SWD协议, 任务, 调试接口

Abstract: Generally,the MCU chips use JTAG as the debugging interface,but JTAG takes up at least 4 pins,while SWD(Serialwire debugger)onlytakesup2 pins,which is suitable for the encapsulatingchips with fewer pins.Since SWDisserial,the data is transmitted one byone at the edge of the clock.Accordingto 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,whichwasimplementedbyprogrammingwithlarge tasksinthe simulationenvironmentofCDS/incisiv142.

Key words: MCU, SWD agreement, task, debug interface

中图分类号: