Skip to content

Commit 80af15c

Browse files
SandraArrowkartben
authored andcommitted
boards: infineon: add cy8ckit_062s2_ai support
Add board support for cy8ckit_062s2_ai Signed-off-by: Sandra Schmidt <[email protected]>
1 parent e01107e commit 80af15c

File tree

10 files changed

+382
-0
lines changed

10 files changed

+382
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Arrow Electronics.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_CY8CKIT_062S2_AI
5+
select SOC_CY8C624ABZI_S2D44
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# During gdb session, by default connect to CM4 core.
4+
board_runner_args(openocd "--gdb-init=disconnect")
5+
board_runner_args(openocd "--gdb-init=target extended-remote :3334")
6+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
7+
8+
board_runner_args(pyocd "--target=cy8c6xxa")
9+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2024 Arrow Electronics.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board:
5+
name: cy8ckit_062s2_ai
6+
full_name: PSOC 6 AI Evaluation Kit
7+
vendor: infineon
8+
socs:
9+
- name: cy8c624abzi_s2d44
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/*
2+
* Copyright (c) 2024 Arrow Electronics.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <infineon/cat1a/mpns/CY8C624ABZI_S2D44.dtsi>
9+
#include <infineon/cat1a/system_clocks.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
12+
/ {
13+
model = "CY8CKIT-062S2-AI PSOC 6 AI Evaluation Kit";
14+
compatible = "infineon,cy8ckit_062s2_ai", "cypress,PSOC6";
15+
16+
chosen {
17+
zephyr,console = &uart5;
18+
zephyr,shell-uart = &uart5;
19+
zephyr,sram = &sram0;
20+
zephyr,flash = &flash0;
21+
};
22+
23+
aliases {
24+
led0 = &user_led0;
25+
sw0 = &user_bt;
26+
watchdog0 = &watchdog0;
27+
};
28+
29+
leds {
30+
compatible = "gpio-leds";
31+
user_led0: led_0 {
32+
label = "LED_0";
33+
gpios = <&gpio_prt5 3 GPIO_ACTIVE_HIGH>;
34+
};
35+
user_led1: led_1 {
36+
label = "LED_1";
37+
gpios = <&gpio_prt5 4 GPIO_ACTIVE_HIGH>;
38+
};
39+
};
40+
41+
gpio_keys {
42+
compatible = "gpio-keys";
43+
user_bt: button_0 {
44+
label = "SW_0";
45+
gpios = <&gpio_prt5 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
46+
zephyr,code = <INPUT_KEY_0>;
47+
};
48+
};
49+
};
50+
51+
&fll0 {
52+
status = "okay";
53+
clock-frequency = <100000000>;
54+
};
55+
56+
&clk_hf0 {
57+
clock-div = <1>;
58+
clocks = <&fll0>;
59+
};
60+
61+
/* CM4 core clock = 100MHz
62+
* &fll clock-frequency / &clk_hf0 clock-div / &clk_fast clock-div = 100MHz / 1 / 1 = 100MHz
63+
*/
64+
&clk_fast {
65+
clock-div = <1>;
66+
};
67+
68+
/* CM0+ core clock = 50MHz
69+
* &fll clock-frequency / &clk_hf0 clock-div / &clk_slow clock-div = 100MHz / 1 / 2 = 50MHz
70+
*/
71+
&clk_slow {
72+
clock-div = <2>;
73+
};
74+
75+
/* PERI core clock = 100MHz
76+
* &fll clock-frequency / &clk_hf0 clock-div / &clk_peri clock-div = 100MHz / 1 / 1 = 100MHz
77+
*/
78+
&clk_peri {
79+
clock-div = <1>;
80+
};
81+
82+
&gpio_prt5 {
83+
status = "okay";
84+
};
85+
86+
&gpio_prt10 {
87+
status = "okay";
88+
};
89+
90+
/* UART connected to KitProg3 */
91+
uart5: &scb5 {
92+
compatible = "infineon,cat1-uart";
93+
status = "okay";
94+
current-speed = <115200>;
95+
pinctrl-0 = <&p5_1_scb5_uart_tx &p5_0_scb5_uart_rx>;
96+
pinctrl-names = "default";
97+
};
98+
99+
uart1: &scb1 {
100+
compatible = "infineon,cat1-uart";
101+
status = "okay";
102+
current-speed = <115200>;
103+
pinctrl-0 = <&p10_0_scb1_uart_rx &p10_1_scb1_uart_tx>;
104+
pinctrl-names = "default";
105+
};
106+
107+
&p5_1_scb5_uart_tx {
108+
drive-push-pull;
109+
};
110+
111+
&p5_0_scb5_uart_rx {
112+
input-enable;
113+
};
114+
115+
&p10_1_scb1_uart_tx {
116+
drive-push-pull;
117+
};
118+
119+
&p10_0_scb1_uart_rx {
120+
input-enable;
121+
};
122+
123+
&watchdog0 {
124+
status = "okay";
125+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
identifier: cy8ckit_062s2_ai
2+
name: CY8CKIT-062S2-AI PSOC 6 AI Evaluation Kit
3+
type: mcu
4+
arch: arm
5+
ram: 1024
6+
flash: 2048
7+
toolchain:
8+
- zephyr
9+
supported:
10+
- gpio
11+
- uart
12+
- watchdog
13+
vendor: infineon
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2024 Arrow Electronics.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Enable MPU
5+
CONFIG_ARM_MPU=y
6+
7+
# Enable HW stack protection
8+
CONFIG_HW_STACK_PROTECTION=y
9+
10+
# Enable console
11+
CONFIG_CONSOLE=y
12+
CONFIG_UART_CONSOLE=y
13+
14+
# Enable UART driver
15+
CONFIG_SERIAL=y
16+
17+
# Enable GPIO driver
18+
CONFIG_GPIO=y
19+
20+
# Enable clock controller
21+
CONFIG_CLOCK_CONTROL=y
22+
23+
# Add catcm0p sleep images for CM0 Devices
24+
CONFIG_SOC_PSOC6_CM0P_IMAGE_SLEEP=y
64.7 KB
Loading
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
.. zephyr:board:: cy8ckit_062s2_ai
2+
3+
Overview
4+
********
5+
6+
The PSOC 6 AI Evaluation Kit (CY8CKIT-062S2-AI) is a cost effective and small development kit that
7+
enables design and debug of PSOC 6 MCUs.
8+
It includes a CY8C624ABZI-S2D44 MCU which is based on a 150-MHz Arm |reg| Cortex |reg|-M4 and
9+
a 100-MHz Arm |reg| Cortex |reg|-M0+, with 2048 KB of on-chip Flash, 1024 KB of SRAM,
10+
a Quad-SPI external memory interface, built-in hardware and software security features,
11+
rich analog, digital, and communication peripherals.
12+
13+
The board features an AIROC |reg| CYW43439 Wi-Fi & Bluetooth |reg| combo device,
14+
a 512 MB NOR flash, an onboard programmer/debugger (KitProg3), USB host and device features,
15+
two user LEDs, and one push button.
16+
17+
Hardware
18+
********
19+
20+
For 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+
28+
Supported Features
29+
==================
30+
31+
The ``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+
52+
The 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+
57+
System Clock
58+
============
59+
60+
The PCY8C624ABZI-S2D44 MCU SoC is configured to use the internal IMO+FLL as a source for
61+
the system clock. CM0+ works at 50MHz, CM4 - at 100MHz. Other sources for the
62+
system clock are provided in the SoC, depending on your system requirements.
63+
64+
65+
Fetch Binary Blobs
66+
******************
67+
68+
The CY8CKIT-062S2-AI board requires fetch binary files (e.g CM0+ prebuilt images).
69+
70+
To fetch Binary Blobs:
71+
72+
.. code-block:: console
73+
74+
west blobs fetch hal_infineon
75+
76+
77+
Build blinking led sample
78+
*************************
79+
80+
Here 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+
87+
Programming and Debugging
88+
*************************
89+
90+
The CY8CKIT-062S2-AI board includes an onboard programmer/debugger (`KitProg3`_)
91+
to provide debugging, flash programming, and serial communication over USB.
92+
Flash and debug commands use OpenOCD and require a custom Infineon OpenOCD version,
93+
that supports KitProg3, to be installed.
94+
95+
96+
Infineon OpenOCD Installation
97+
=============================
98+
99+
Both the full `ModusToolbox`_ and the `ModusToolbox Programming Tools`_ packages include Infineon OpenOCD.
100+
Installing either of these packages will also install Infineon OpenOCD.
101+
If neither package is installed, a minimal installation can be done by downloading the `Infineon OpenOCD`_ release
102+
for 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+
111+
West Commands
112+
=============
113+
114+
The path to the installed Infineon OpenOCD executable must be available to the ``west`` tool commands.
115+
There are multiple ways of doing this.
116+
The 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+
145+
Alternatively, pyOCD can also be used to flash the board using
146+
the ``--runner`` (or ``-r``) option:
147+
148+
.. code-block:: console
149+
150+
$ west flash --runner pyocd
151+
152+
References
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
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
if {[info exists env(OPENOCD_INTERFACE)]} {
2+
set INTERFACE $env(OPENOCD_INTERFACE)
3+
} else {
4+
# By default connect over Debug USB port
5+
set INTERFACE "cmsis-dap"
6+
}
7+
8+
source [find interface/$INTERFACE.cfg]
9+
10+
transport select swd
11+
12+
source [find target/psoc6_2m.cfg]

soc/infineon/cat1a/psoc6_02/Kconfig.defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ config NUM_IRQS
1313
config SYS_CLOCK_HW_CYCLES_PER_SEC
1414
default 100000000
1515

16+
config BUILD_OUTPUT_HEX
17+
default y
18+
1619
# add additional die specific params
1720

1821
endif # SOC_DIE_PSOC6_02

0 commit comments

Comments
 (0)