[PSOC™] 【英飞凌 CY8CKIT-062S2-AI评测】-1- 开箱

[复制链接]
79|1
南来之风 发表于 2025-10-29 11:24 | 显示全部楼层 |阅读模式
本帖最后由 南来之风 于 2025-10-29 12:26 编辑

感谢英飞凌和21IC提供的测评机会!


英飞凌的PSOC™6人工智能评估套件是一套完美的创新工具用来原型制作和收集真实数据,以快速构建机器学习模型。硬件平台尺寸小巧(35mm*45mm),专注于边缘 Al应用,使客户能够评估英飞凌的机器学习平台DEEPCRAFT™Studio以及准备部署的机器学习模型。该平台由PSOC6 MCU和QSPI Flash组成,同时有多种接口对接各种传感器如-雷达、麦克风、压力传感器等。该平台可完美兼容DEEPCRAFT™Studio,包括运行已训练好的模型如啼哭检测,打鼾检测,跌倒检测等。


产品实物如下:


板子引脚资源:



前期准备:

• ModusToolbox™ software v3.4 or later (for developing PSOC™ 6 MCU-based applications)
• DEEPCRAFT™ v5.3 (for developing machine learning models)
• UART terminal software such as Tera Term or Minicom

之后根据开发板盒子背面的日期决定是否要更新一个Streaming固件,2025年2月份之前生成的需要更新,之后的不需要。

• Streaming Firmware - PSOC™ 6 AI Evaluation Kit (hex file)
• Download and install ModusToolbox™ Programmer (flash utility)
• PSOC™ 6 AI Evaluation Kit (CY8CKIT-062S2-AI)


打开ModusToolBox Programmer,自动检测到当前的固件不是最新的:



点击Update Firmware更新固件:


稍等一会,自动更新完成,检查输出窗口是否有提示update successfully.


新建工程:


在模板中选择Hello World:


主程序:
  1. int main(void)
  2. {
  3.     cy_rslt_t result;

  4. #if defined (CY_DEVICE_SECURE)
  5.     cyhal_wdt_t wdt_obj;

  6.     /* Clear watchdog timer so that it doesn't trigger a reset */
  7.     result = cyhal_wdt_init(&wdt_obj, cyhal_wdt_get_max_timeout_ms());
  8.     CY_ASSERT(CY_RSLT_SUCCESS == result);
  9.     cyhal_wdt_free(&wdt_obj);
  10. #endif /* #if defined (CY_DEVICE_SECURE) */

  11.     /* Initialize the device and board peripherals */
  12.     result = cybsp_init();

  13.     /* Board init failed. Stop program execution */
  14.     if (result != CY_RSLT_SUCCESS)
  15.     {
  16.         CY_ASSERT(0);
  17.     }

  18.     /* Enable global interrupts */
  19.     __enable_irq();

  20.     /* Initialize retarget-io to use the debug UART port */
  21.     result = cy_retarget_io_init_fc(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX,
  22.             CYBSP_DEBUG_UART_CTS,CYBSP_DEBUG_UART_RTS,CY_RETARGET_IO_BAUDRATE);

  23.     /* retarget-io init failed. Stop program execution */
  24.     if (result != CY_RSLT_SUCCESS)
  25.     {
  26.         CY_ASSERT(0);
  27.     }

  28.     /* Initialize the User LED */
  29.     result = cyhal_gpio_init(CYBSP_USER_LED, CYHAL_GPIO_DIR_OUTPUT,
  30.                              CYHAL_GPIO_DRIVE_STRONG, CYBSP_LED_STATE_OFF);

  31.     /* GPIO init failed. Stop program execution */
  32.     if (result != CY_RSLT_SUCCESS)
  33.     {
  34.         CY_ASSERT(0);
  35.     }

  36.     /* \x1b[2J\x1b[;H - ANSI ESC sequence for clear screen */
  37.     printf("\x1b[2J\x1b[;H");

  38.     printf("****************** "
  39.            "HAL: Hello World! Example "
  40.            "****************** \r\n\n");

  41.     printf("Hello World!!!\r\n\n");
  42.     printf("For more projects, "
  43.            "visit our code examples repositories:\r\n\n");

  44.     printf("https://github.com/Infineon/"
  45.            "Code-Examples-for-ModusToolbox-Software\r\n\n");

  46.     /* Initialize timer to toggle the LED */
  47.     timer_init();

  48.     printf("Press 'Enter' key to pause or "
  49.            "resume blinking the user LED \r\n\r\n");

  50.     for (;;)
  51.     {
  52.         /* Check if 'Enter' key was pressed */
  53.         if (cyhal_uart_getc(&cy_retarget_io_uart_obj, &uart_read_value, 1)
  54.              == CY_RSLT_SUCCESS)
  55.         {
  56.             if (uart_read_value == '\r')
  57.             {
  58.                 /* Pause LED blinking by stopping the timer */
  59.                 if (led_blink_active_flag)
  60.                 {
  61.                     cyhal_timer_stop(&led_blink_timer);

  62.                     printf("LED blinking paused \r\n");
  63.                 }
  64.                 else /* Resume LED blinking by starting the timer */
  65.                 {
  66.                     cyhal_timer_start(&led_blink_timer);

  67.                     printf("LED blinking resumed\r\n");
  68.                 }

  69.                 /* Move cursor to previous line */
  70.                 printf("\x1b[1F");

  71.                 led_blink_active_flag ^= 1;
  72.             }
  73.         }
  74.         /* Check if timer elapsed (interrupt fired) and toggle the LED */
  75.         if (timer_interrupt_flag)
  76.         {
  77.             /* Clear the flag */
  78.             timer_interrupt_flag = false;

  79.             /* Invert the USER LED state */
  80.             cyhal_gpio_toggle(CYBSP_USER_LED);
  81.         }
  82.     }
  83. }

代码先初始化外设,然后打印字符串到串口。之后如果检测到串口数据“Enter”就暂停LED闪烁或者恢复LED闪烁。












本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
szt1993 发表于 2025-10-29 15:18 | 显示全部楼层
人工智能评估套件是一套完美的创新工具用来原型制作和收集真实数据
您需要登录后才可以回帖 登录 | 注册

本版积分规则

70

主题

295

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部