ARM Technical Support Knowledge Articles

How can I use the SWJIM which comes with Cortex-M3 for my chip-level design?

Applies to: Cortex-M3


This answer is applicable only to chip designers who have licensed the processor RTL for inclusion in their chip designs. The components referenced here are part of the RTL deliverable bundle delivered to RTL licensees.


The SWJIM (Serial Wire / JTAG Interface Manager) allows you to execute a sequence of debug accesses through a CoreSight DAP (Debug Access Port) in simulation.

It is a good idea to run the example system which was delivered with your Cortex-M3 to gain familiarity with the processor and the debug and trace capabilities provided, before trying to port this test capability to your chip level test bench.

The Cortex-M3 'example' system provides some test programs containing both a 'C' program to run on the target processor and a DAP Macro Language (DAPML) program to run on the SWJIM in a combined '.cdapml' source file. It should be straightforward to connect the SWJIM to the debug port on the boundary of your chip-level design, and use the provided "cdapml" test programs as a starting point to build your own debug test.

If you go to your Cortex-M3 installation directory and perform: find . -name "*SWJ*" you will find the SWJIM located under "./example/coresight/logical/SWJIM/". The procedure to use this is already coded in the example provided with Cortex-M3, located under './example/'.

The cdapml programs are located at "./example/Software/*.cdapml" under your top level Cortex-M3 (AT420... or AT425...) installation. In the "example" directory, use: "grep run_ex README" to see a quick list of example invocation of the run_example script. You can find more information in the relevant chapter (Appendix A) of the Cortex-M3 Integration and Implementation Manual.

The "run_example" script goes to the ./Software/ directory and runs 'make'. The Makefile includes a call to "" to split off the DAPML portion of the source code and copy it into ./coresight/tests/. (Or you could write your DAPML as a separate file and skip this step of splitting it out of a ".cdapml' source file.) It then goes to the ./coresight/tests/ directory and runs 'make' there. This Makefile runs the three conversion scripts to prepare the DAPML source into the executable format required by the components of the SWJIM. The SWJIM, the BST, and the DAPML language are documented in the pdf files located in ./coresight/doc'.

Rate this article

Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential