AN84858
PSoC 4 Programming Using an External
Microcontroller (HSSP)
About this document
Scope and purpose
AN84858 shows you how to implement PSoC™ 4 device programming with an external microcontroller by using
modular C code. In this process, called Host Sourced Serial Programming (HSSP), the host microcontroller
programs PSoC 4 through the serial wire debug (SWD) interface. The C code is written so that it can be ported to
any microcontroller with minimal changes, speeding up HSSP application development for PSoC 4.
More code examples? We heard you.
To access an ever-growing list of hundreds of PSoC code examples, please visit our
You can also explore the video training library here.
Table of contents
About this document ....................................................................................................................... 1
Table of contents ............................................................................................................................ 1
1
Introduction .......................................................................................................................... 3
1.1
Types of Programmers ............................................................................................................................ 3
1.2
Terms and Definitions ............................................................................................................................. 3
2
2.1
SWD Protocol Physical Layer .................................................................................................................. 6
2.2
SWD Protocol Packet Layer ..................................................................................................................... 6
2.3
Fetching Programming Data ................................................................................................................... 6
2.4
HSSP Programming Steps ....................................................................................................................... 7
2.5
HSSP Timeout Parameters ..................................................................................................................... 7
2.6
HSSP Programming Data ........................................................................................................................ 8
2.7
Main Application Code ............................................................................................................................ 8
2.8
HSSP Error Status .................................................................................................................................... 8
3
4
4.1
Files That Must Be Ported ..................................................................................................................... 11
4.2
5
5.1
DEVICE_ACQUIRE_TIMEOUT ................................................................................................................. 13
5.2
SROM_POLLING_TIMEOUT ................................................................................................................... 14
5.3
XRES_PULSE_100US ............................................................................................................................. 15
6
7
HSSP Timing Validation ......................................................................................................... 19
8
9
9.1
Application Note
www.infineon.com
Please read the Important Notice and Warnings at the end of this document
page 1 of 45
code examples web
page.
001-84858 Rev. *N
2021-03-23