Application Note
3 of 45
001-84858 Rev. *N
2021-03-23
PSoC 4 Programming Using an External Microcontroller (HSSP)
Introduction
1
Introduction
PSoC 4 device programming refers specifically to the programming of the nonvolatile memory in PSoC 4 by
using an external host programmer. The host can be the programmer supplied by Infineon (
), a third-party programmer, or a custom programmer (for example, an onboard microcontroller).
This application note explains how to implement a host programmer to program a PSoC 4 device. For more
information on the PSoC 4 architecture and to learn how to create projects for PSoC 4 using the PSoC Creator
™
software, see
1.1
Types of Programmers
The type of device programmer you choose depends on the stage of product development:
Prototyping
: A programmer must be able to perform the following functions:
1.
Program the device.
2.
Debug the device to troubleshoot the application.
The programmers used during prototyping must also interact with the integrated design environment (IDE)
—
for example,
to accomplish the programming and debugging operations. A few examples are
or the
, which can be used as a low-cost programmer/debugger.
Production
: You require a programmer that can program multiple devices. It parses the hex file to extract the
necessary information and implements programming through the programming interface, such as SWD.
There are two major categories of programmers:
•
In-system programmers can program the target device directly on the end-application PCB. You can
connect the external programmer to the device’s programming pins to do in
-system programming.
•
Socket programmers require the target device to be placed on the programmer hardware socket for
programming. After programming, solder the target device to the end-application PCB. Most
In both in-system and socket programming, the programmer implements an HSSP algorithm and generates
signals to program the hex file’s data.
This application note provides the C code to implement an HSSP programmer. You can easily port this C code
to any host microcontroller with minimal changes. By porting, you reduce the time required to develop HSSP
applications for PSoC 4 devices. The project provided with this application note uses a PSoC 5LP device as a
host programmer to program the target device.
Before reading this application note, review the programming specifications document of the respective device
listed in the
section. This document explains the programming interface,
programming algorithm, hardware connection, and electrical timing specifications required to program PSoC 4
devices. This application note is a practical implementation of the programming specifications.
1.2
Terms and Definitions
•
Serial wire debug (SWD)
: Developed by ARM, the SWD protocol uses only two wires
—
SWDCLK (clock) and
SWDIO (bidirectional data line)
—
to program and debug.
•
Debug access port (DAP):
DAP is the program/debug interface between SWD and the CPU in PSoC 4 It
includes a debug port (DP) and an access port (AP).
−
DP is responsible for the physical connection to the programmer/debugger.
−
AP provides the interface between the DAP module and the Cortex-M0 CPU, the flash memory, and so on.