Update on [STM32F103C8 “Blue Pill” Woes]

RobotDyn STM32F103C8T6

So I tried programming the RobotDyn STM32F103C8 board using its preinstalled bootloader directly, with a known good micro USB cable this time, from Arduino IDE. It works!

Sketch uses 20788 bytes (31%) of program storage space. Maximum is 65536 bytes.
Global variables use 3804 bytes (18%) of dynamic memory, leaving 16676 bytes for local variables. Maximum is 20480 bytes.
/home/joshua/.arduino15/packages/STM32/tools/STM32Tools/1.4.0/tools/linux/maple_upload.sh: line 29: /home/joshua/.arduino15/packages/STM32/tools/STM32Tools/1.4.0/tools/linux/upload-reset: No such file or directory

Could not automatically reset device *
Please manually reset device! *

dfu-util 0.8
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
dfu-util: No DFU capable USB device available
Trying 4 more time(s)
dfu-util 0.8
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
dfu-util: No DFU capable USB device available
Trying 3 more time(s)
dfu-util 0.8
dfu-util: Invalid DFU suffix signature
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
dfu-util: No DFU capable USB device available
Trying 2 more time(s)
dfu-util 0.8
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Opening DFU capable USB device...
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #2 ...
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device
Download [                         ]   0%            0 bytes
Download [=                        ]   4%         1024 bytes
Download [==                       ]   9%         2048 bytes
Download [===                      ]  13%         3072 bytes
Download [====                     ]  18%         4096 bytes
Download [=====                    ]  23%         5120 bytes
Download [======                   ]  27%         6144 bytes
Download [========                 ]  32%         7168 bytes
Download [=========                ]  37%         8192 bytes
Download [==========               ]  41%         9216 bytes
Download [===========              ]  46%        10240 bytes
Download [============             ]  50%        11264 bytes
Download [=============            ]  55%        12288 bytes
Download [===============          ]  60%        13312 bytes
Download [================         ]  64%        14336 bytes
Download [=================        ]  69%        15360 bytes
Download [==================       ]  74%        16384 bytes
Download [===================      ]  78%        17408 bytes
Download [====================     ]  83%        18432 bytes
Download [======================   ]  88%        19456 bytes
Download [=======================  ]  92%        20480 bytes
Download [======================== ]  97%        21084 bytes
Download [=========================] 100%        21084 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
Waiting for /dev/ttyACM0 serial...... Done.

When Arduino IDE was uploading the program to the board, it said Please manually reset device! so I pressed the on-board reset button. The program was uploaded successfully. The test program that I used is just turning the LED on PC13 on (LOW) instead of blinking, that’s it.

To test if the program is on the board for good, I disconnected the USB cable, and then powered the board using a USB charger. This way, the board is not connected to the computer. The result: initially the PC13 LED is blinking, and then it stays on. I think the initial blinking PC13 LED is Roger Clark’s bootloader waiting for new programming from the USB port, and when it doesn’t detect any, it continues with executing the already existing program (the test program I had just uploaded).

In other words, this is a success! The program is there even after powering off or pressing the reset button. I know, I know, some of you will think: “so he managed to light up a LED, big deal!” Keep in mind it took me nearly two weeks from ordering the boards and programmers to finally being able to upload program directly from the on-board micro USB connector.

I have also tried the same method/protocol on the two generic Blue Pill boards. They works too. So now I have all three boards able to be programmed from the on-board micro USB connector.

I still haven’t managed to upload directly from PlatformIO to the board using the on-board micro USB connector. But at least I no longer need to fiddle around with BOOT0 jumper, USB to Serial Converter or ST-LINK V2 clone, and their wirings. Too bad about the requirement to manually press the reset button for every upload, though.

See you next time.

One response on “Update on [STM32F103C8 “Blue Pill” Woes]