Application Note
8 of 45
001-84858 Rev. *N
2021-03-23
PSoC 4 Programming Using an External Microcontroller (HSSP)
HSSP Firmware Architecture
Timestamp definitions are derived from the electrical timing specifications provided in the Device
Programming Specifications. The values of these timestamp parameter definitions in
Timeout.h
are for a
PSoC 5LP host programmer running at a clock frequency of 63 MHz.
Timestamp definitions and the delay routine are used in the function definitions in the
ProgrammingSteps.c
file.
To learn how to calculate the timestamp parameters for a specific host programmer, see the section
Calculating HSSP Timeout Parameters
2.6
HSSP Programming Data
Files that contain the programming data to be stored in the host programmer are described:
Table 5
Files Containing the Programming Data
Source Files
Description
HexImage
(.
c
and .
h
files)
These files contain the data to be programmed into the target device.
They also store the target device parameters used in HSSP programming, such as silicon ID,
checksum, total number of flash rows, and number of bytes per flash row.
The data in these files is stored in PSoC 5LP flash memory as an array of constants.
These files are generated by the C# application Hex File Parser, which is provided with this application note.
This application generates these files by taking the target device hex file as the input. The details of this
application are provided in
For details on the hex file format, see “Appendix B. Intel Hex File Format” in
the programming specifications
document of the respective device listed in the
For host programmers that lack the memory capacity to store the programming data in the on-chip memory,
the
HexImage.c
and
HexImage.h
files are not required. In such cases, the HSSP programming data is typically
sent to the host as packets through a communication interface, such as I
2
C, UART, or USB.
Note:
See the section
Interface for Receiving HSSP Programming Data
for information on modifying
the HSSP source code according to the method used to get the programming data.
2.7
Main Application Code
The
main.c
file is the main application code that calls the top-level HSSP programming steps in the sequence
shown in
. The function
ProgramDevice()
in
main.c
executes all the steps. Each step must be
executed successfully before you can proceed to the next step.
The HSSP operation is aborted if a FAILURE is returned after any step. The error status returned by the
ReadHsspErrorStatus()
function is used to identify the cause of the error. The status of the HSSP
operation, along with the error status register, is displayed on a character LCD in the attached HSSP project.
Note:
The character LCD and
Pin_Start
routines are specific to the PSoC 5LP host programmer and,
therefore, should be modified as required for any other host programmer.
2.8
HSSP Error Status
When any of the top-level steps in the HSSP application returns a failure status, the
ReadHsspErrorStatus()
function is called from the main application code to get the details of the error.