【英飞凌 CY8CKIT-062S2-AI评测】介绍、环境搭建、工程测试
本文介绍了英飞凌 CY8CKIT-062S-AI 开发板的相关信息,包括外观、产品参数、资源特点、原理图等,实现了开发环境搭建、例程测试等流程
介绍
PSOC ™ 6 AI 评估套件是一个专注于机器学习 (ML) 的硬件平台。它使客户能够评估英飞凌的 ML 平台 DEEPCRAFT ™ Studio(以前称为 Imagimob Studio),以及准备部署的 ML 模型和其他软件产品。数据收集通过 PSOC ™ 6 MCU、雷达、声学、压力和 IMU 传感器实现。
详见:cy8ckit-062s2-ai - 评估板 | Infineon英飞凌官网 .
开箱
包装



外观


特性
- 超低功耗
- Arm ® Cortex ® -M4 和 Arm ® Cortex ® -M0+
- 2048 KB 片上闪存
- 1024 KB SRAM
- Quad-SPI 外部存储器接口
- 内置硬件、软件安全功能
- 丰富的模拟、数字和通信外设
参数
- 目标应用:可穿戴设备、物联网、预测性维护
- 家庭:微控制器
- 软件支持:Modus工具箱
- 软件生态系统
- ModusToolbox
- DEEPCRAFT™ Studio
- ModusToolbox™ 软件
- 连接
- CYW43439 Wi-Fi/蓝牙®组合模块
- USB(Type-C 数据线)
原理图
硬件框图

Connector

Interface

GPIO

Peripheral

USB

Power supply

Power

Sensors

Memory

WiFi-BLE

详见:CY8CKIT-062S2-AI - Evaluation Boards | Infineon Technologies
调试
PSOC™ 6 AI 评估板可通过板载 KitProg3 进行编程和调试。
- KitProg3 是一款具备 USB-UART 和 USB-I2C 功能的板载编程器/调试器;
- KitProg3 基于 Infineon 的 PSOC™ 5LP 芯片实现。
测试
- 使用 Type-C 数据线连接开发板和电脑;
- 打开设备管理器,可发现新增的 KitProg3 串口和总线设备

- 使用 Tera Term 软件连接设备串口(波特率115200),短按板载 RESET 键,输出初始化信息

详见:《KitProg3 用户指南》。
- 若未连接设备,可通过 ModusToolbox Programmer 编程器软件更新固件

环境搭建
- 在 CY8CKIT-062S2-AI 设备 官方网站 下载对应的开发工具和 IDE 软件;

包括 ModusToolbox 软件、IoTConnect 工具、深度学习工具等;

- 可通过 ModusToolbox Setup 软件安装相关软件和工具链

工程测试
这里介绍了 CY8CKIT-062S-AI 开发板实现 Demo 工程加载和测试的相关流程。
工程创建
- 进入 Eclipse for ModusToolbox 软件;
- 在 Quick Package 标签界面下选择 Start - New Application;
- 待加载出设备目录后(需要科学上网),在检索框中输入
CY8CKIT-062S2-AI 获取对应设备;
- 勾选 Getting Started 目录下的 Hello World 工程,点击 Create 按钮;

流程图

代码
打开工程目录中的 main.c 文件,代码如下
#include "cyhal.h"
#include "cybsp.h"
#include "cy_retarget_io.h"
/*****************
* Macros
******************/
/* LED blink timer clock value in Hz */
#define LED_BLINK_TIMER_CLOCK_HZ (10000)
/* LED blink timer period value */
#define LED_BLINK_TIMER_PERIOD (9999)
/****************
* Global Variables
****************/
bool timer_interrupt_flag = false;
bool led_blink_active_flag = true;
/* Variable for storing character read from terminal */
uint8_t uart_read_value;
/* Timer object used for blinking the LED */
cyhal_timer_t led_blink_timer;
void timer_init(void);
static void isr_timer(void *callback_arg, cyhal_timer_event_t event);
/******************
* Function Name: main
******************/
int main(void)
{
cy_rslt_t result;
#if defined (CY_DEVICE_SECURE)
cyhal_wdt_t wdt_obj;
/* Clear watchdog timer so that it doesn't trigger a reset */
result = cyhal_wdt_init(&wdt_obj, cyhal_wdt_get_max_timeout_ms());
CY_ASSERT(CY_RSLT_SUCCESS == result);
cyhal_wdt_free(&wdt_obj);
#endif /* #if defined (CY_DEVICE_SECURE) */
/* Initialize the device and board peripherals */
result = cybsp_init();
/* Board init failed. Stop program execution */
if (result != CY_RSLT_SUCCESS)
{
CY_ASSERT(0);
}
/* Enable global interrupts */
__enable_irq();
/* Initialize retarget-io to use the debug UART port */
result = cy_retarget_io_init_fc(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX,
CYBSP_DEBUG_UART_CTS,CYBSP_DEBUG_UART_RTS,CY_RETARGET_IO_BAUDRATE);
/* retarget-io init failed. Stop program execution */
if (result != CY_RSLT_SUCCESS)
{
CY_ASSERT(0);
}
/* Initialize the User LED */
result = cyhal_gpio_init(CYBSP_USER_LED, CYHAL_GPIO_DIR_OUTPUT,
CYHAL_GPIO_DRIVE_STRONG, CYBSP_LED_STATE_OFF);
/* GPIO init failed. Stop program execution */
if (result != CY_RSLT_SUCCESS)
{
CY_ASSERT(0);
}
/* \x1b[2J\x1b[;H - ANSI ESC sequence for clear screen */
printf("\x1b[2J\x1b[;H");
printf("****************** "
"HAL: Hello World! Example "
"****************** \r\n\n");
printf("Hello World!!!\r\n\n");
printf("For more projects, "
"visit our code examples repositories:\r\n\n");
printf("https://github.com/Infineon/"
"Code-Examples-for-ModusToolbox-Software\r\n\n");
/* Initialize timer to toggle the LED */
timer_init();
printf("Press 'Enter' key to pause or "
"resume blinking the user LED \r\n\r\n");
for (;;)
{
/* Check if 'Enter' key was pressed */
if (cyhal_uart_getc(&cy_retarget_io_uart_obj, &uart_read_value, 1)
== CY_RSLT_SUCCESS)
{
if (uart_read_value == '\r')
{
/* Pause LED blinking by stopping the timer */
if (led_blink_active_flag)
{
cyhal_timer_stop(&led_blink_timer);
printf("LED blinking paused \r\n");
}
else /* Resume LED blinking by starting the timer */
{
cyhal_timer_start(&led_blink_timer);
printf("LED blinking resumed\r\n");
}
/* Move cursor to previous line */
printf("\x1b[1F");
led_blink_active_flag ^= 1;
}
}
/* Check if timer elapsed (interrupt fired) and toggle the LED */
if (timer_interrupt_flag)
{
/* Clear the flag */
timer_interrupt_flag = false;
/* Invert the USER LED state */
cyhal_gpio_toggle(CYBSP_USER_LED);
}
}
}
保存代码。
效果
- 连接开发板和电脑,点击菜单栏的运行按钮,完成固件上传;
- 打开串口调试助手,连接开发板对应的设备端口号


总结
本文介绍了英飞凌 CY8CKIT-062S-AI 开发板的相关信息,包括外观、产品参数、资源特点、原理图等,实现了开发环境搭建、例程测试等流程,为相关产品的开发和快速应用提供了参考。