1. 创建工程文件夹,并赋予可读可写权限:
lugl@lugl-virtual-machine:~$ mkdir cw32l052_pro
lugl@lugl-virtual-machine:~$ chmod 777 -R cw32l052_pro/
lugl@lugl-virtual-machine:~/cw32l052_pro$ git init
已初始化空的 Git 仓库于 /home/lugl/cw32l052_pro/.git/
lugl@lugl-virtual-machine:~/cw32l052_pro$ git config --global user.mane "name"
lugl@lugl-virtual-machine:~/cw32l052_pro$ git config --global user.email "name@qq.com"
lugl@lugl-virtual-machine:~/cw32l052_pro$ git clone https://gitee.com/lugl/cw32l052.git
正克隆到 'cw32l052'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 0
展开对象中: 100% (9/9), 6.91 KiB | 6.91 MiB/s, 完成.
lugl@lugl-virtual-machine:~/cw32l052_pro/cw32l052$ git push
枚举对象中: 144, 完成.
对象计数中: 100% (144/144), 完成.
使用 8 个线程进行压缩
压缩对象中: 100% (143/143), 完成.
写入对象中: 100% (143/143), 947.84 KiB | 8.46 MiB/s, 完成.
总共 143 (差异 41),复用 0 (差异 0)
remote: Resolving deltas: 100% (41/41), completed with 1 local object.
remote: Powered by GITEE.COM [GNK-6.4]
To https://gitee.com/lugl/cw32l052.git
a0b3de8..1cf0224 master - > master
7. make 一下:
lugl@lugl-virtual-machine:~/cw32l052_pro/cw32l052/cw32l052_gcc$ make
[DUMP] build_exec/template.elf - > build_exec/template.s
[SIZE] build_exec/template.elf
text data bss dec hex filename
1500 20 1572 3092 c14 build_exec/template.elf
-e Build Finish
static inline void LED_Init()
{
GPIO_InitTypeDef GPIO_InitStruct;
RCC_AHBPeriphClk_Enable(RCC_AHB_PERIPH_GPIOC, ENABLE);
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.IT = GPIO_IT_NONE;
GPIO_InitStruct.Pins = GPIO_PIN_10;
GPIO_Init(CW_GPIOC, &GPIO_InitStruct);
}
int main(void)
{
LED_Init();
InitTick(24000000);
// 开启两线调试接口
RCC_SWDIO_Config(RCC_SYSCTRL_SWDIOEN);
while (1)
{
GPIO_TogglePin(CW_GPIOC, GPIO_PIN_10);
SysTickDelay(500);
}
return 0;
}
lugl@lugl-virtual-machine:~/cw32l052_pro/cw32l052/cw32l052_gcc$ make flash
-e Start pyOCD
0000739 I Loading /home/lugl/cw32l052_pro/cw32l052/cw32l052_gcc/build_exec/template.elf [load_cmd]
[==================================================] 100%
0001348 I Erased 0 bytes (0 sectors), programmed 0 bytes (0 pages), skipped 1536 bytes (3 pages) at 2.47 kB/s [loader]
这样我们就可以看到开发板的LED在闪烁了。
审核编辑:汤梓红
全部0条评论
快来发表一下你的评论吧 !