PSoC 4000 Family: PSoC 4 Architecture TRM, Document No. 001-89309 Rev. *D 139
18. Program and Debug Interface
The PSoC
®
4 Program and Debug interface provides a communication gateway for an external device to perform program-
ming or debugging. The external device can be a Cypress-supplied programmer and debugger, or a third-party device that
supports programming and debugging. The serial wire debug (SWD) interface is used as the communication protocol
between the external device and PSoC 4.
18.1 Features
■ Programming and debugging through the SWD interface
■ Four hardware breakpoints and two hardware watchpoints while debugging
■ Read and write access to all memory and registers in the system while debugging, including the Cortex-M0 register bank
when the core is running or halted
18.2 Functional Description
Figure 18-1 shows the block diagram of the program and debug interface in PSoC 4. The Cortex-M0 debug and access port
(DAP) acts as the program and debug interface. The external programmer or debugger, also known as the "host", communi-
cates with the DAP of the PSoC 4 "target" using the two pins of the SWD interface - the bidirectional data pin (SWDIO) and
the host-driven clock pin (SWDCK). The SWD physical port pins (SWDIO and SWDCK) communicate with the DAP through
the high-speed I/O matrix (HSIOM). See the I/O System chapter on page 45 for details on HSIOM.
Figure 18-1. Program and Debug Interface
The DAP communicates with the Cortex-M0 CPU using the ARM-specified advanced high-performance bus (AHB) interface.
AHB is the systems interconnect protocol used inside the device, which facilitates memory and peripheral register access by
the AHB master. The device has two AHB masters – ARM CM0 CPU core and DAP. The external device can effectively take
control of the entire device through the DAP to perform programming and debugging operations.
HSIOM
Cortex-M0 DAP
Debug Port (DP)
Access Port (AP)
AP Access
SWDCK
SWDIO
SWD
Cortex-M0 CPU
AHB
DAP
AHB
ARM Cortex-M0 subsystem
AHB
SPC Interface
FLASH SROM SRAM
Peripheral
Modules
AHB
PSoC 4
Host Device