I'm using STM32(generic board) and I want to control bi-color LED(common anode). STM32 pin layout and scheme is below, so please see it. Now, in theory scheme Works, but in practice it Works halfway. Red LED is connected with PB8 pin and green LED is connected with PB3 pin. Code is simple so I think that problem is not in the code. Red LED Works, but green doesn't work. If I connect green cathode with GND manually, then it Works, otherwise(with STM32) it doesn't. Later I found that pin PB3 has Trace SWO mark(see pin layout below). I'm not completly sure what Trace SWO means, just found that it some kind of debugigng protocol(I guess) but I can't find info can it be used for digitalWrite purposes. Is there any way to habilitate PB3 pin for digitalWrite? All other pins are in use.


// DOWN   
digitalWrite(PB3, HIGH);
digitalWrite(PB8, LOW);

// UP
digitalWrite(PB8, HIGH);
digitalWrite(PB3, LOW);

STM32 pin layout

enter image description here

R4 doesn't exist, it's mistake in scheme

  • did you solder the headers?
    – Juraj
    Mar 3, 2019 at 13:17
  • Don't understand you?
    – Pararera
    Mar 3, 2019 at 16:39
  • usually the Blue Pill is sold without pin headers soldered
    – Juraj
    Mar 3, 2019 at 19:22
  • @Juraj really? I didn't know that. Thanks for info! 🤦🏻‍♂️
    – Pararera
    Mar 3, 2019 at 20:16
  • how can you don't know that? did you get it with pin headers soldered or without pin headers? cdn.instructables.com/F46/4FA4/JM8A987M/…
    – Juraj
    Mar 4, 2019 at 5:35


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.