我正在试灯STM32F103C8T6上的LED指示灯(在端口c,针脚13上)。我没有使用IDE。码:
#include "include/stm32f10x.h"
int main()
{
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
GPIOC->CRH &= ~GPIO_CRH_CNF13;
GPIOC->CRH |= GPIO_CRH_MODE13_0;
GPIOC->BSRR = GPIO_BSRR_BR13;
while(1)
{
GPIOC->BSRR = GPIO_BSRR_BS13;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
在包含目录中包含文件的链接:
我就是这样编译的
arm-none-eabi-gcc --specs=nosys.specs -o output led.c
将其上传到mc后,什么也没有发生。