本帖最后由 南来之风 于 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:
主程序:
- 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);
- }
- }
- }
代码先初始化外设,然后打印字符串到串口。之后如果检测到串口数据“Enter”就暂停LED闪烁或者恢复LED闪烁。
|