Last week I bough one of these boards from ebay:

- STM32F103RCT6(EbayBlueAndYellow).jpg (60.2 KiB) Viewed 581 times
[hobbya – Sun Jul 08, 2018 8:32 am] –
Have you verified again the connection of the LED?
I don’t have a schematic for the board but following the traces the LED seems to be connected to PB11. I also probed PB11 with my oscilloscope while the program was suppose to be running and could not see the pin toggle.
[hobbya – Sun Jul 08, 2018 8:32 am] –
did you set Boot0 back to GND after the upload?
Jip, initially I also thought I forgot it but since then I have tried it numerous times but no luck. As a test I even tried to program without setting boot0 but got a programming error.
Another thing I just remembered was that when I received the board and powered it up the first time, the LED was blinking. Maybe this was a program they uploaded as a test after assembling the board. If this is the case then I suppose the crystal and the rest of the hardware must be working (or the program used an internal oscillator, but probably unlikely).
Anyway, so I flashed the hex file and the LED is now blinking again like when I received it the first time!
Now the questions is why can’t I get it to work using STM32duino… ![]()
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/gpio.h>
int main (void) {
// Set clock to 72MHz using external 8MHz crystal
//rcc_clock_setup_in_hse_8mhz_out_72mhz();
rcc_periph_clock_enable(RCC_GPIOB);
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO11);
for (;;) {
gpio_toggle(GPIOB, GPIO11);
// create a small delay by looping for a while
for (int i = 0; i < 1000000; ++i) __asm("");
}
}
As you have an oscilloscope, will you probe the crytsal output when you comment out ” rcc_clock_setup_in_hse_8mhz_out_72mhz(); ” ?
Can you see if it is oscillating after loading the Arduino sktech or the factory hex file?
Lastly, is the crystal a 8Mhz but not some other frequency?
Sorry for not being able to help further.
I guess it’s safe to say that the crystal is broken and now I just have to decided if I will try to fix it or just buy a new board.
Thanks for all your help! If I make any further progress with the board I will post an update here…
Cheers, E.

