首先感谢发烧友、RT-Thread和英飞凌!
一、开箱
Psoc6-evaluationkit-062S2 是 RT-Thread 联合英飞凌推出的一款集成32位双核CPU子系统( ARM Cortex-M4 和 ARM Cortex-M0)的开发板,其具有单周期乘法的150-MHz Arm Cortex-M4F CPU (浮点和存储器保护单元),100-MHz Cortex M0+ CPU,带单周期乘法和MPU,可以充分发挥 PSoC6 双核芯片性能。
该开发板核心 板载资源 如下:
- MCU:CY8C624ABZI-S2D44,Cortex-M4主频 150MHz,Cortex-M0主频 100MHz,2MB Flash 和 1MB SRAM
- 板载资源:microSD card , 触摸滑条,Arduino 接口
- 开发环境:ModusToolbox 2.0/MDK V5 PSoC® Creator™
二、创建工程
基于RT-Studio,很方便的生成Psoc6-evaluationkit-062S2工程,目前RT-Thread Studio已经支持Psoc6-evaluationkit-062S2开发板BSP。
记得调试器是KitProg3,接口为SWD。
开发板hello world就是流水灯,走起:
#define LED_PIN GET_PIN(0, 0)
int main(void)
{
rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
for (;;)
{
rt_pin_write(LED_PIN, PIN_HIGH);
rt_thread_mdelay(500);
rt_pin_write(LED_PIN, PIN_LOW);
rt_thread_mdelay(500);
}
}
编译下,还是挺快的:
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_irq_psoc.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_lptimer.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_scb_common.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_syspm.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_system.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_uart.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_utils.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_utils_psoc.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/COMPONENT_CAT1A/source/triggers/cyhal_triggers_psoc6_02.c"
arm-none-eabi-gcc "../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/COMPONENT_CAT1A/source/pin_packages/cyhal_psoc6_02_68_qfn.c"
arm-none-eabi-gcc "../libraries/HAL_Drivers/drv_common.c"
arm-none-eabi-gcc "../libraries/HAL_Drivers/drv_gpio.c"
arm-none-eabi-gcc "../libraries/HAL_Drivers/drv_uart.c"
arm-none-eabi-gcc "../board/board.c"
arm-none-eabi-gcc "../applications/main.c"
linking...
arm-none-eabi-objcopy -O ihex "rtthread.elf" "rtthread.hex"
arm-none-eabi-size
text data bss dec hex filename
1126012 48 2908 1128968 113a08 rtthread.elf
Used Size(B) Used Size(KB)
Flash: 1126060 B 1099.67 KB
RAM: 2956 B 2.89 KB
20:15:04 Build Finished. 0 errors, 0 warnings. (took 10s.748ms)
三、运行
先把固件下载到本地:
[ 32%] [########## ] [ Programming ]
[ 35%] [########### ] [ Programming ]
[ 39%] [############ ] [ Programming ]
[ 45%] [############## ] [ Programming ]
[ 53%] [################ ] [ Programming ]
[ 65%] [#################### ] [ Programming ]
[ 83%] [########################## ] [ Programming ]
[ 98%] [############################### ] [ Programming ]
[100%] [################################] [ Programming ]
wrote 98304 bytes from file D:/RT-ThreadStudio/workspace/POC/Debug/rtthread.hex in 3.052991s (31.445 KiB/s)
** Programming Finished **
shutdown command invoked
Info : psoc6.dap: powering down debug domain...
串口登录,1M的大内存就是好啊。
流水灯也闪烁起来:
POC
|