How infineon/kitprog3 works
Purpose and deliverables
KitProg3 is embedded firmware for the PSoC5LP-based KitProg3 debug/programming probe. It builds with PSoC Creator 4.4 into HEX and Cypress bootloader (.cyacd) images; distribution and field updates are performed by the external fw-loader utility. The DAPLink codebase itself is explicitly external.
• KitProg3.cydsn/KitProg3.cyprj
• KitProg3.cydsn/KitProg3.cydwr
• KitProg3.cywrk
Firmware entry and system composition
The primary application starts in main.c and coordinates probe operation through hardware/device definitions, KitProg state, and generated PSoC peripheral code. The PSoC schematic is a material hardware boundary: it defines the board wiring and components consumed by the generated source.
• KitProg3.cydsn/main.c
• KitProg3.cydsn/kitprog.h
• KitProg3.cydsn/TopDesign/TopDesign.cysch
USB host interface and command boundary
USB is the host-facing control plane. The USB interface/user-HID layers receive host requests and bridge them into firmware command processing; generated USBFS vendor and endpoint ISR code sits below this boundary. Host protocol compatibility is therefore concentrated at the USB/command interfaces rather than in transport drivers.
• KitProg3.cydsn/usbinterface.c
• KitProg3.cydsn/usb_user_hid.c
• KitProg3.cydsn/commandprocessor.h
Debug-access protocol stack
The probe’s target-debug path supports CMSIS-DAP-facing logic plus SWD and JTAG data-port implementations. DAP configuration/vendor extensions adapt the standard debug protocol to KitProg behavior, while SWD/JTAG layers control physical target access.
• KitProg3.cydsn/DAP.c
• KitProg3.cydsn/SW_DP.c
• KitProg3.cydsn/JTAG_DP.c
Application modes and target bridges
Mode switching and bridge interfaces separate normal debug/provisioning functions from target-facing bridge behavior. The application switch is the likely control boundary for selecting probe functions, while bridge APIs isolate higher-level commands from concrete target transports.
• KitProg3.cydsn/app_switch.c
• KitProg3.cydsn/bridgesInterface.c
• KitProg3.cydsn/swd.c
Hardware control and concurrency
Power, LEDs, reset-related ISR logic, and mutexes manage board-visible state and timing-sensitive access. These components operate below command/protocol layers and must preserve electrical and synchronization constraints when target transactions occur.
• KitProg3.cydsn/power.c
• KitProg3.cydsn/led.c
• KitProg3.cydsn/mutex.c
Boot and deployment boundaries
A separate PSoC bootloader project provides the firmware-update runtime; the main application emits the update artifact it consumes. Windows driver packages provide host enumeration/support for KitProg-family USB and UART devices, but are not firmware runtime code.
• KitProg3_Bootloader.cydsn/main.c
• KitProg3_Bootloader.cydsn/KitProg3_Bootloader.cyprj
• drivers/KitProg3/KitProg3/Win7/KitProg3.inf
Shared component infrastructure
The repository also contains a reusable PSoC Creator SPI Master component/library, including generated embedded C API and Creator-side customizer code. It is design-time component infrastructure, distinct from the probe application and bootloader projects.
• KitProg3_Library.cylib/SPI_Master_v2_50/API/SPI_Master.c
• KitProg3_Library.cylib/SPI_Master_v2_50/SPI_Master_v2_50.cysch
Main entry points: KitProg3.cyprj Probe application project · main.c Firmware entry · usbinterface.c USB host interface · TopDesign.cysch Board schematic
Components 20
Probe Firmware
- Probe application project
KitProg3.cydsn/KitProg3.cyprj - Board schematic · Defines wired PSoC components consumed by generated firmware.
KitProg3.cydsn/TopDesign/TopDesign.cysch - Firmware entry
KitProg3.cydsn/main.c - KitProg state
KitProg3.cydsn/kitprog.h - USB host interface
KitProg3.cydsn/usbinterface.c - User HID layer
KitProg3.cydsn/usb_user_hid.c - Command processor · Host protocol command boundary.
KitProg3.cydsn/commandprocessor.h - Application modes
KitProg3.cydsn/app_switch.c - Power, LEDs & mutexes · Coordinates board-visible state and synchronized target access.
KitProg3.cydsn/power.c
Target Debug
- Target bridge API
KitProg3.cydsn/bridgesInterface.c - CMSIS-DAP logic · Includes KitProg DAP configuration and vendor extensions.
KitProg3.cydsn/DAP.c - SWD data port
KitProg3.cydsn/SW_DP.c - JTAG data port
KitProg3.cydsn/JTAG_DP.c - SWD physical access
KitProg3.cydsn/swd.c
Build & Deployment
- PSoC Creator workspace
KitProg3.cywrk - Bootloader project · Separate update runtime for application images.
KitProg3_Bootloader.cydsn/KitProg3_Bootloader.cyprj - Bootloader entry
KitProg3_Bootloader.cydsn/main.c - Windows USB driver · Supports KitProg-family USB and UART enumeration.
drivers/KitProg3/KitProg3/Win7/KitProg3.inf
Component Library
- SPI Master component · Reusable design-time component with generated embedded API.
KitProg3_Library.cylib/SPI_Master_v2_50/API/SPI_Master.c - SPI component schematic
KitProg3_Library.cylib/SPI_Master_v2_50/SPI_Master_v2_50.cysch
Connections 22
- PSoC Creator workspace → Probe application project: contains
- PSoC Creator workspace → Bootloader project: contains
- Probe application project → Board schematic: uses design
- Probe application project → Firmware entry: builds
- Board schematic → USB host interface: provides USB peripherals
- Board schematic → Power, LEDs & mutexes: provides board peripherals
- Firmware entry → KitProg state: coordinates
- Firmware entry → USB host interface: initializes
- Firmware entry → Application modes: selects mode
- USB host interface → User HID layer: receives requests through
- User HID layer → Command processor: dispatches
- Command processor → Application modes: selects functions
- Application modes → Target bridge API: routes target commands
- Target bridge API → CMSIS-DAP logic: invokes debug access
- CMSIS-DAP logic → SWD data port: uses SWD
- CMSIS-DAP logic → JTAG data port: uses JTAG
- SWD data port → SWD physical access: drives
- Power, LEDs & mutexes → SWD physical access: protects access
- Probe application project → Bootloader project: emits update image for
- Bootloader project → Bootloader entry: builds
- Windows USB driver → USB host interface: host enumeration
- SPI component schematic → SPI Master component: generates API