Skip to main content
JChaj.1
Associate
Feb 12, 2023 7:16 PM UTC
Question

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

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 dfu-util@lists.gnumonks.org

Filter on vendor = 0x1eaf product = 0x0003

Waiting for /dev/ttyACM0 serial...Done

This topic has been closed for replies.

9 replies

Javier1
Principal
Feb 13, 2023 8:45 AM UTC

>>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) .

hit me up in https://www.linkedin.com/in/javiermuñoz/
JChaj.1
JChaj.1Author
Associate
Feb 13, 2023 10:09 AM UTC

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?

Javier1
Principal
Feb 13, 2023 10:33 AM UTC

>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

hit me up in https://www.linkedin.com/in/javiermuñoz/
JChaj.1
JChaj.1Author
Associate
Feb 13, 2023 10:53 AM UTC

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.

Javier1
Principal
Feb 13, 2023 3:46 PM UTC

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

hit me up in https://www.linkedin.com/in/javiermuñoz/
JChaj.1
JChaj.1Author
Associate
Feb 13, 2023 4:02 PM UTC

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.

Javier1
Principal
Feb 13, 2023 5:11 PM UTC

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

https://www.youtube.com/watch?v=Myon8H111PQ

0693W00000YAcRuQAL.png

hit me up in https://www.linkedin.com/in/javiermuñoz/
AScha.3
Super User
Feb 13, 2023 5:29 PM UTC

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 on " Best Answer ".
JChaj.1
JChaj.1Author
Associate
Feb 13, 2023 8:03 PM UTC

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.