Application Note
11 of 45
001-84858 Rev. *N
2021-03-23
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
Source Files to Be Ported
SWD_PhysicalLayer.h
SWD_PhysicalLayer.c
SWD_PacketLayer.h
SWD_PacketLayer.c
SWD_UpperPacketLayer.h
SWD_UpperPacketLayer.c
Timeout.h
Timeout.c
HexImage.h
HexImage.c
DataFetch.h
DataFetch.c
ProgrammingSteps.h
ProgrammingSteps.c
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.
Timing Parameter
1
XRES_PULSE_100US
2
DEVICE_ACQUIRE_TIMEOUT
3
SROM_POLLING_TIMEOUT
To learn how to calculate the timeout parameters for a specific host programmer, see