Porting The Hssp Application To A Host Programmer; Files That Must Be Ported; Code Changes Required While Porting - Infineon PSoC 4 Quick Start Quide

Table of Contents

Advertisement

PSoC 4 Programming Using an External Microcontroller (HSSP)

Porting the HSSP Application to a Host Programmer

4
Porting the HSSP Application to a Host Programmer
The project A_Hssp_Programmer, provided with this application note, uses PSoC 5LP as the host programmer
for the target device. In the HSSP application, the host programmer can be any other microcontroller. This
section explains the changes required to port the HSSP application code to the specific host used to program
the target device.
4.1

Files That Must Be Ported

The PSoC 5LP host programmer-based project includes files specific to PSoC 5LP. While porting the HSSP
application code to any other host programmer, you must port only the files listed:
Table 7
Files That Must Be Ported
Header Files to Be Ported
SWD_PhysicalLayer.h
SWD_PacketLayer.h
SWD_UpperPacketLayer.h
Timeout.h
HexImage.h
DataFetch.h
ProgrammingSteps.h
RegisterDefines.h
4.2

Code Changes Required While Porting

Make the following changes to each of the files while porting the attached HSSP application code to any host
programmer other than PSoC 5LP. Note that only some files need to be modified while porting.
RegisterDefines.h: Modify the definitions in this header file for the port numbers, pin numbers, mask values,
output registers, input registers, and drive mode registers according to the host programmer used.
SWD_PhysicalLayer.h: All the bit-banging macros defined in this header file are used in the function
definitions in the SWD_PhysicalLayer.c file. Modify these macros according to the host programmer used.
SWD_PhysicalLayer.c: Modify all the bit-banging functions defined in this file according to the host
programmer used.
Timeout.h: Modify the three timeout parameter definitions described according to the host programmer
used.
Table 8
Timing Parameters
S.No.
1
2
3
To learn how to calculate the timeout parameters for a specific host programmer, see
Timeout
Parameters.
Application Note
Timing Parameter
XRES_PULSE_100US
DEVICE_ACQUIRE_TIMEOUT
SROM_POLLING_TIMEOUT
Source Files to Be Ported
SWD_PhysicalLayer.c
SWD_PacketLayer.c
SWD_UpperPacketLayer.c
Timeout.c
HexImage.c
DataFetch.c
ProgrammingSteps.c
11 of 45
Calculating HSSP
001-84858 Rev. *N
2021-03-23

Advertisement

Table of Contents
loading

This manual is also suitable for:

An84858

Table of Contents