How infineon/target_psoc6-generic works
Project Type and Purpose
• This is a Board Support Package (BSP) for the PSoC™ 6 microcontroller family.
• Its purpose is to provide hardware-abstraction, startup code, device initialization, clock/power configuration, and multi-toolchain support so that application projects can include a single “cybsp.h” header and immediately target a custom PSoC6 board.
• It is not a full-stack web application or microservice; rather, it is embedded-firmware infrastructure that sits between the bare metal hardware and end-user application code.
File Structure Analysis
• Top-level build files:
• bsp.mk – Makefile that pulls in default components and defines BSP configuration flags
• props.json, config/design.modus – hardware manifest and design metadata used by ModusToolbox
• Core components:
• COMPONENT_CM0P, COMPONENT_CM4 – startup and system files for the CM0+ and CM4 cores
• Each contains subfolders per toolchain (ARM, Clang, GCC, IAR) with linker scripts and startup assembly
• system_psoc6_cm0plus.c / system_psoc6_cm4.c – clock, power, and system initialization
• BSP HAL and headers:
• cybsp.c/.h, cybsp_hw_config.h, cybsp_types.h, cybsp_doc.h – hardware-abstraction API
• Documentation:
• docs/html – generated Doxygen API reference and BSP user guide
• Licensing and metadata:
• LICENSE, EULA, RELEASE.md
Key Insights from README
• The BSP is a template; it requires a custom manifest to define actual board pins and peripherals.
• Default clock (FLL, PLL) and power configurations are provided.
• BSP features are toggled via defines (e.g., CY_USING_HAL, CYBSP_WIFI_CAPABLE).
• Intended to be consumed via ModusToolbox or any make-based build system.
a. Main Components
1. Hardware Layer
• PSoC6 SoC with dual cores: CM0+ (low-power) and CM4 (application)
• On-chip peripherals: Clocks (FLL, PLL), GPIO, Power Management, IPC channel
2. BSP Software Layer
• Startup Sequences (core-specific assembly + linker scripts)
• system_psoc6_cm0plus.c / system_psoc6_cm4.c – clock/power init
• HAL APIs (cybsp.c/h) – board-level drivers for pins, power, system callbacks
• Configuration/Manifest (props.json, design.modus, mk files)
3. Build Toolchain Layer
• ModusToolbox or Make
• Toolchain adapters for ARM, Clang, GCC, IAR – select appropriate startup/linker
4. Application Layer
• User code includes cybsp.h, invokes BSP init, then uses HAL drivers and system callbacks
5. Documentation & Examples
• Doxygen-generated HTML under docs/html for API reference
b. Relationships & Interactions
• On power-up, the build system selects the correct toolchain folder; startup code runs on both cores.
• system_*.c configures clocks, power modes based on BSP defaults or user defines.
• cybsp.c/.h exposes HAL functions that abstract peripheral initialization and pin assignments.
• Application code calls into the HAL, which in turn manipulates hardware registers.
• Configuration files feed both the build system and the BSP code so that manifests, callbacks, and power settings can be customized.
c. Architectural Patterns & Principles
• Layered Abstraction – hardware registers < BSP system init < HAL API < user application
• Core Separation – dual-core startup and synchronization via IPC (implied)
• Toolchain Abstraction – maintain identical directory structures per toolchain for consistency
• Configuration-over-Code – uses manifest files and make-file defines to customize behavior
d. Relevant Technologies
• PSoC6 MCU (dual-core ARM Cortex®-M architecture)
• Make (bsp.mk, toolchain-specific makefiles)
• ModusToolbox design metadata (design.modus, props.json)
• Doxygen for documentation generation
Essential Details to Capture
• Both cores and their initialization paths
• Clock and power configuration flow
• HAL layer as the only exposed API to application
• Configuration feedback loop (defines, manifest)
• Multi-toolchain support points