0
\$\begingroup\$

I am attempting to program and STM32F103C8T6 Blue Pill board using an ST-LINK V2 debugger, i have the 4 pins connected to SWDIO, SWCLK, 3.3V and GND, and then connected into the 4 pin header on the board itself. I am using the Arduino IDE to program it, and I can run the "Blink" program to flash PC13, but i modified the code to the following to try and flash an external LED:

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(PC13, OUTPUT);
  pinMode(PA7, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(PC13, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(PA7, HIGH);
  delay(1000);                       // wait for a second
  digitalWrite(PC13, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(PA7, LOW);
  delay(1000);                       // wait for a second
}

However this doesn't flash the LED in PA7 at all. Further, i would assume that plugging an LED into the 3.3V/5V and Ground on the blue pill would power it up, however it doesn't light up at all.

Am I doing something wrong is my board possibly broken? It doesnt seem to be outputting at all, other than the onboard LED.

\$\endgroup\$
2
  • \$\begingroup\$ What kind of LED are trying to turn on and off? Do you have a current limiting series resistor? It is very important to know the Vf of the LED as well so you can appropriately size the current limiting resistor. \$\endgroup\$
    – gcr
    Commented Mar 30, 2021 at 21:38
  • \$\begingroup\$ Plugging an LED directly into 3.3V or 5V is likely to destroy it, unless you got lucky and connected it backwards. You need to show us exactly how you are connecting these LEDs, with a schematic. \$\endgroup\$ Commented Mar 30, 2021 at 21:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.