1.. zephyr:board:: cy8ckit_062s2_ai
2
3Overview
4********
5
6The PSOC 6 AI Evaluation Kit (CY8CKIT-062S2-AI) is a cost effective and small development kit that
7enables design and debug of PSOC 6 MCUs.
8It includes a CY8C624ABZI-S2D44 MCU which is based on a 150-MHz Arm |reg| Cortex |reg|-M4 and
9a 100-MHz Arm |reg| Cortex |reg|-M0+, with 2048 KB of on-chip Flash, 1024 KB of SRAM,
10a Quad-SPI external memory interface, built-in hardware and software security features,
11rich analog, digital, and communication peripherals.
12
13The board features an AIROC |reg| CYW43439 Wi-Fi & Bluetooth |reg| combo device,
14a 512 MB NOR flash, an onboard programmer/debugger (KitProg3), USB host and device features,
15two user LEDs, and one push button.
16
17Hardware
18********
19
20For more information about the CY8C624ABZI-S2D44 MCU SoC and CY8CKIT-062S2-AI board:
21
22- `CY8C624ABZI-S2D44 MCU SoC Website`_
23- `CY8C624ABZI-S2D44 MCU Datasheet`_
24- `CY8CKIT-062S2-AI Website`_
25- `CY8CKIT-062S2-AI User Guide`_
26- `CY8CKIT-062S2-AI Schematics`_
27
28Supported Features
29==================
30
31The ``cy8ckit_062s2_ai/cy8c624abzi_s2d44`` board target supports the following hardware features:
32
33+-----------+------------+-----------------------+
34| Interface | Controller | Driver/Component      |
35+===========+============+=======================+
36| NVIC      | on-chip    | nested vectored       |
37|           |            | interrupt controller  |
38+-----------+------------+-----------------------+
39| SYSTICK   | on-chip    | system clock          |
40+-----------+------------+-----------------------+
41| GPIO      | on-chip    | GPIO                  |
42+-----------+------------+-----------------------+
43| PINCTRL   | on-chip    | pin control           |
44+-----------+------------+-----------------------+
45| UART      | on-chip    | serial port-polling;  |
46|           |            | serial port-interrupt |
47+-----------+------------+-----------------------+
48| WATCHDOG  | on-chip    | watchdog              |
49+-----------+------------+-----------------------+
50
51
52The default configuration can be found in the defconfig and dts files:
53
54  - :zephyr_file:`boards/infineon/cy8ckit_062s2_ai/cy8ckit_062s2_ai_defconfig`
55  - :zephyr_file:`boards/infineon/cy8ckit_062s2_ai/cy8ckit_062s2_ai.dts`
56
57System Clock
58============
59
60The PCY8C624ABZI-S2D44 MCU SoC is configured to use the internal IMO+FLL as a source for
61the system clock. CM0+ works at 50MHz, CM4 - at 100MHz. Other sources for the
62system clock are provided in the SoC, depending on your system requirements.
63
64
65Fetch Binary Blobs
66******************
67
68The CY8CKIT-062S2-AI board requires fetch binary files (e.g CM0+ prebuilt images).
69
70To fetch Binary Blobs:
71
72.. code-block:: console
73
74   west blobs fetch hal_infineon
75
76
77Build blinking led sample
78*************************
79
80Here is an example for building the :zephyr:code-sample:`blinky` sample application.
81
82.. zephyr-app-commands::
83   :zephyr-app: samples/basic/blinky
84   :board: cy8ckit_062s2_ai/cy8c624abzi_s2d44
85   :goals: build
86
87Programming and Debugging
88*************************
89
90The CY8CKIT-062S2-AI board includes an onboard programmer/debugger (`KitProg3`_)
91to provide debugging, flash programming, and serial communication over USB.
92Flash and debug commands use OpenOCD and require a custom Infineon OpenOCD version,
93that supports KitProg3, to be installed.
94
95
96Infineon OpenOCD Installation
97=============================
98
99Both the full `ModusToolbox`_ and the `ModusToolbox Programming Tools`_ packages include Infineon OpenOCD.
100Installing either of these packages will also install Infineon OpenOCD.
101If neither package is installed, a minimal installation can be done by downloading the `Infineon OpenOCD`_ release
102for your system and manually extract the files to a location of your choice.
103
104.. note::
105
106    Linux requires device access rights to be set up for KitProg3.
107    This is handled automatically by the ModusToolbox and ModusToolbox Programming Tools installations.
108    When doing a minimal installation, this can be done manually by executing the script
109    ``openocd/udev_rules/install_rules.sh``.
110
111West Commands
112=============
113
114The path to the installed Infineon OpenOCD executable must be available to the ``west`` tool commands.
115There are multiple ways of doing this.
116The example below uses a permanent CMake argument to set the CMake variable ``OPENOCD``.
117
118   .. tabs::
119      .. group-tab:: Windows
120
121         .. code-block:: shell
122
123            # Run west config once to set permanent CMake argument
124            west config build.cmake-args -- -DOPENOCD=path/to/infineon/openocd/bin/openocd.exe
125
126            # Do a pristine build once after setting CMake argument
127            west build -b cy8ckit_062s2_ai/cy8c624abzi_s2d44 -p always samples/basic/blinky
128
129            west flash
130            west debug
131
132      .. group-tab:: Linux
133
134         .. code-block:: shell
135
136            # Run west config once to set permanent CMake argument
137            west config build.cmake-args -- -DOPENOCD=path/to/infineon/openocd/bin/openocd
138
139            # Do a pristine build once after setting CMake argument
140            west build -b cy8ckit_062s2_ai/cy8c624abzi_s2d44 -p always samples/basic/blinky
141
142            west flash
143            west debug
144
145Alternatively, pyOCD can also be used to flash the board using
146the ``--runner`` (or ``-r``) option:
147
148.. code-block:: console
149
150   $ west flash --runner pyocd
151
152References
153**********
154
155.. target-notes::
156
157.. _CY8C624ABZI-S2D44 MCU SoC Website:
158    https://www.infineon.com/cms/en/product/microcontroller/32-bit-psoc-arm-cortex-microcontroller/psoc-6-32-bit-arm-cortex-m4-mcu/psoc-62/psoc-62x8-62xa/cy8c624abzi-s2d44/
159
160.. _CY8C624ABZI-S2D44 MCU Datasheet:
161    https://www.infineon.com/dgdl/Infineon-PSOC_6_MCU_CY8C62X8_CY8C62XA-DataSheet-v16_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ee7d03a70b1
162
163.. _CY8CKIT-062S2-AI Website:
164    https://www.infineon.com/cms/en/product/evaluation-boards/cy8ckit-062s2-ai/?redirId=273839
165
166.. _CY8CKIT-062S2-AI User Guide:
167    https://www.infineon.com/dgdl/Infineon-CY8CKIT_062S2_AI_KIT_GUIDE-UserManual-v01_00-EN.pdf?fileId=8ac78c8c90530b3a01906d4608842668
168
169.. _CY8CKIT-062S2-AI Schematics:
170    https://www.infineon.com/dgdl/Infineon-CY8CKIT-062S2-AI_PSoC_6_AI_Evaluation_Board_Schematic-PCBDesignData-v01_00-EN.pdf?fileId=8ac78c8c8eeb092c018f0af9e109106f
171
172.. _ModusToolbox:
173    https://softwaretools.infineon.com/tools/com.ifx.tb.tool.modustoolbox
174
175.. _ModusToolbox Programming Tools:
176    https://softwaretools.infineon.com/tools/com.ifx.tb.tool.modustoolboxprogtools
177
178.. _Infineon OpenOCD:
179    https://github.com/Infineon/openocd/releases/latest
180
181.. _KitProg3:
182    https://github.com/Infineon/KitProg3
183