Solved
BluePill: Program is uploaded but MCU doesn't run correctly
- September 5, 2025
- 6 replies
- 1525 views
Hi, I'm getting started at embedded programming, I've got this blue pill board having the STM32F103C6 MCU and ST-LINK v2 programmer.
Here's my code, just to light up the LED on port C 13:
#include "stm32f10x.h"
int main() {
RCC->APB2ENR |= (1<<4);
GPIOC->CRH |= ((1<<20) | (1<<21));
GPIOC->CRH &= ~((1<<22) | (1<<21));
GPIOC->BSRR = (1<<13);
return 0;
}
Despite the IDE flashes successfully the LED doesn't light up as I wanted, It will only lights up if I add a break point on debugging mode on Keil uVision



And here are my flash configurations:


Any help is appreciated.
