# Use SWD debug download the MDK-ARM

To illustrate, here will be used as an example STM32F103C8T6.

**SWD interface to download programs in MDK-ARM**

1.First need to Open Debugger of SWD interface CLK, DIO, GND STM32F103C8T6 based target board in PA13, PA14 and GND are connected and open MDK-ARM.

2.Click Project, Option for Target'XXX 'or use the corresponding shortcut icon Alt + F7 or click on the toolbar to open the configuration options.

![](https://1339817493-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2HWtRMO1SOVoE1wKC5%2F-M2HWuqfjq-tAqyjGf2g%2F-M2HWxcOroEDSOrETKSY%2Fswd%201.png?generation=1584080146815273\&alt=media)

3.Select the Debug tab, select the J-Link / J-Trace Cortex Options。

![](https://1339817493-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2HWtRMO1SOVoE1wKC5%2F-M2HWuqfjq-tAqyjGf2g%2F-M2HWxcQ7LLcCOwJngPp%2Fswd%202.png?generation=1584080146245367\&alt=media)

4.Then click the settings button next to enter the Cortex JLink / JTrace Target Driver Setup settings, choose the way in SW Debug tab in Port。

![](https://1339817493-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2HWtRMO1SOVoE1wKC5%2F-M2HWuqfjq-tAqyjGf2g%2F-M2HWxcSXT2Gn119BrVG%2Fswd%203.png?generation=1584080148096301\&alt=media)

5.Adding in Flash Download in Programming Algorithm corresponding algorithms do here is STM32F103C8 SCM instance, select STM32F10x Med-density Flash On-chip Flash 128k algorithm and click Add

![](https://1339817493-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2HWtRMO1SOVoE1wKC5%2F-M2HWuqfjq-tAqyjGf2g%2F-M2HWxcUHCy9Y-AAYflV%2Fswd%204.png?generation=1584080145716380\&alt=media)

6.Select Use Target for the Utilities tab, select Flash Programming Tool J-Link / J-Trace Cortex, and then click OK to exit。

![](https://1339817493-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2HWtRMO1SOVoE1wKC5%2F-M2HWuqfjq-tAqyjGf2g%2F-M2HWxcWF3Nm37el8-TS%2Fswd%205.png?generation=1584080147985598\&alt=media)

7.At this point, the setup is complete, you can compile the program, such as the error can be able to point LOAD button to start downloading the program to the chip.

![](https://1339817493-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2HWtRMO1SOVoE1wKC5%2F-M2HWuqfjq-tAqyjGf2g%2F-M2HWxcYrP5p1j6FyAsu%2Fswd%206.png?generation=1584080147178190\&alt=media)
