Showing results for 
Search instead for 
Did you mean: 

How do I upload a sketch from Arduino IDE to an STM32F103C8?

Associate II

I have uploaded the maple bootloader and am trying to upload a sketch from the Arduino IDE (1.8.19 or 2.0.3). I get the following error:

Board identied as /dev/ttyACM0 (Maple Mini)

Upload fails:

Failed to open serial device.

setRTS(): TIOCMSET: Broken pipe

No DFU capable USB device found

dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.

Copyright 2010-2012 Tormod Volden and Stefan Schmidt

This program is Free Software and has ABSOLUTELY NO WARRANTY

Please report bugs to

Filter on vendor = 0x1eaf product = 0x0003

Waiting for /dev/ttyACM0 serial...Done


>>No DFU capable USB device found

Arduino needs the correct arduino bootloader to use DFU (usb flash programming).

Did you previously flashed the wrong arduino bootloader? (maybe the one for a stm32f103c8t6 bluepill?)

I would recommend you to use an STLINK, arduino supports SW (ISP as they call it) .

we dont need to firmware by ourselves, lets talk
Associate II

Thank you for taking the time to answer my question.

How do I know which is the correct bootloader? My understanding at this point is that the file to use it called generic_boot20_pc13.bin and is available from Roger Clarks Github. That is the one I am uploading to the board using an ST-LINKv2. That works fine, although I have discovered that the board must then be plugged directly into the PC rather than a USB hub to show up on /dev/ttyACM0.

Once the bootloader is uploaded the board shows up in the Arduino as a 'Maple Mini'. I have no idea whether this is DFU capable or not?

Since uploadfing using ST-LINKv2 works just fine, I would be happy to use that option. However where does the Arduino 'Serial' device output go? If I upload a sketch via ST-LINK-v2, the board does not appear to be accessible via the USB port or via A9/A10 as indicated on some tutorials?

>My understanding at this point is that the file to use it called generic_boot20_pc13.bin

Show us, post some link, are you sure your board is STM32F301C8 and not STM32F103C8?

>However where does the Arduino 'Serial' device output go?

It goes to the USB, same place

we dont need to firmware by ourselves, lets talk
Associate II

You are correct! Yes the board is an STM32F103C8!. My mistake in the title of the opening post which I have now corrected. I get nothing coming out of USB in terms of serial output.

show us a picture of your board, is there a chance is an aliexpress bluepill?

we dont need to firmware by ourselves, lets talk
Associate II

0693W00000YAc84QAD.jpg0693W00000YAcAAQA1.jpgI don't buy from AliExpress, but that doesn't mean its not a clone. I puchased it maybe a couple of years ago from eBay. Its been sat in a box of bits ever since. The black heat-shrink covers a resistor I added as per instructions to reduce the resistance down from 10k to 1.5k.

Just checking, did you move the corresponding jumper when flashing the arduino bootloader in your board?


we dont need to firmware by ourselves, lets talk

the 10k was wrong on all these boards, so 10-> 1k5 is right. is only needed for USB device working mode.

+ the unknown F301 mutating to well known F103 . 🙂

so now we know, what we talking about.

you have to know: you have 3 ways to start / load new program ->

  • F103 fix built in bootloader , by pressing "boot" when power up (or releasing reset) _ DFU mode, but on F103c8 only on USART1 .
  • with STlink connected via debug functions, working always with -> use programmer -> ***
  • you load (with Stlink..) a bootloader program, maybe your "maple xx" or other, and then connect with USB -> cdc "serial" port -> to arduino or other

so first : choose, what you wanna do. (i use stlink always, just working...and arduino only on AVR boards)

If you feel a post has answered your question, please click "Accept as Solution".
Associate II

I just reviewed that video and I see there is a different URL for the library. I still had the library by Dan Brown installed. I have now updated the library. I have also tried the bootloader discussed in the video, but don't even get a /dev/ttyACM0 port with hid_generic_pc13.bin...

BTW, yes I am moving the jumper to the position shown before flashing.