It should be a hw problem. On one of my DISCO boards one of the LEDs is distorted. GND side of the LED is not soldered to the pad. If you are using an STM32 board you can simply try to print different messages in your therads. Here you can find an example of how to do it. Do not forget to override FileHandle* mbed::mbed_override_console(int)