BTW, when I uploading a sketch using usb, it shows as this:
maple_loader v0.1
Resetting to bootloader via DTR pulse
Searching for DFU device [1EAF:0003]…
Found it!
Opening USB Device 0x1eaf:0x0003…
Found Runtime: [0x1eaf:0x0003] devnum=1, cfg=0, intf=0, alt=2, name=”STM32duino bootloader v1.0 Upload to Flash 0x8002000″
Setting Configuration 1…
Claiming USB DFU Interface…
Setting Alternate Setting …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=260
Starting download: [##################################################] finished!
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
error resetting after download: usb_reset: could not reset device, win error: no connectionгЂ‚
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true

- STM32_BP_Alt_Top_View.jpg (91.49 KiB) Viewed 1526 times
You can still check the PC13 pin whether it toggles or not.
It’s either a bug in dfu-util or the java thing which called dfu-util
It has uploaded
If the board does not go back to showing Maple Seial after upload , then the resistor will need to be changed.
If the LED is not flashing, then eitehr you have not loaded the PC13 version of the bootloader or the LED etc is defective
I checked all the ohter pins as well, and didn’t find any pin outputs this pulse. In the bootloader master folder, there are “binaries” and “bootloader_only_binaries”, folders. from which one should I choose bin?
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(14, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(14, HIGH); // turn the LED on (HIGH is the voltage level)
delay(10000); // wait for a second
digitalWrite(14, LOW); // turn the LED off by making the voltage LOW
delay(5000); // wait for a second
}
http://wiki.stm32duino.com/index.php?title=Blue_Pill
The LED for the “blue pill” is PC13
Do not use pin numbers …. it will make you crazy. Pin numbers is likely the most stupid thing Arduino.cc implemented.
I have more tips here: http://stm32duino.com/viewtopic.php?f=2&t=3111
Ray
Some session should be added in the wiki, so people from arduino will know the right way. Thanks. @Roger
I guess one advantage of the numbers is that one can easily scan or output from/to a lot pins using loop. otherwise, one need to have an array or something similar and then map elements.
[joedodo2 – Sun Feb 04, 2018 5:21 am] –
Oh, my…. I was testing again and again, I used pc13 and it complained and I thought okay, then I used the number ….Some session should be added in the wiki, so people from arduino will know the right way. Thanks. @Roger
The information is in the WiKi and/or in the core documentation .. . While the forum accepts new users, the forum has no full-time moderators like Arduino.cc
https://github.com/rogerclarkmelbourne/ … stallation
Windows
Copy the Arduino_STM32 folder to My Documents/Arduino/hardware (Note: if the hardware folder doesn’t exist you will need to create it).
If using Maple or Maple mini, you need to install drivers for the Serial and DFU (upload devices). Please open a cmd window (run as administrator), navigate to the folder: /drivers/win/ and run: install_drivers.bat. Note: This doesn’t actually install drivers. Windows comes pre-installed with a compatible Serial USB driver and a DFU (upload) driver. However the built in drivers need to be associated with the USB ID of the Maple serial and DFU devices. The batch file and wdi-simple.exe do the clever stuff to convince Windows 7 or newer, that it should use its drivers with the Maple serial and DFU devices.
Re-start the Arduino IDE, and select the appropriate board from the “Tools” -> “Board menu”, and select the appropriate Com port for your Maple mini or serial upload device. Note: If you do not see a Maple Serial com device, this is probably because the Maple mini has not been loaded with the blink sketch. So upload a the Maple mini blink sketch from examples\Digital\Blink and the Maple serial device should now be available on the Port menu.
The STM32DUINO core is not like Arduino.cc
The core files “mimick” Arduino only from the point-of-view that the ArduinoIDE (unmodified) can compile-build-upload to some STM32 devices – not all devices are supported.
To further complicate life, the forum also has an Official Core for Nucleo Boards. Eventually, that section may make the stm32duino core obsolete.
Ray
Global Moderator, part-time
For example this one:
// Basic test for BluePill and friends
#define LED PC13
void setup() {
delay(5000); // Wait till the USB Serial will be available at the PC side
Serial.begin(115200); // Start the Serial
pinMode(LED, OUTPUT); // Set LED pin to the output mode
}
// the loop function runs over and over again forever
void loop() {
Serial.println(" Hello World !");
digitalWrite(LED, HIGH);
delay(1000); // Wait for a second
digitalWrite(LED, LOW);
delay(1000); // Wait for a second
}Many ArduinoIDE users fail to realize that the IDE pulls together all of the examples in the core into a nice, neat pick-list.

- Examples_ArduinoIDE.jpg (85.33 KiB) Viewed 1445 times
Unfortunately not all of Arduino’s built in examples bother to use their own conventions and some examples define the pin number in the code to something else e.g. D13 perhaps
I’m not sure about the other examples, but I supsect they are equally inconsistent, and I’m surprised that no one changes them to get some uniformity
But from what I’ve seen, getting PR’s to the IDE happens at a glacial rate.
http://wiki.stm32duino.com/index.php?ti … 103_boards
The list is surely not representative of all boards… if you find a new one, we will try and get it added but remember the information to complete the profile will likely come from you, the owner of the unidentified board.
Ray
I’m using the same board, it always works as Maple DFU after pluging in USB port, even if I uploaded a sketch.
My uploading message is the similar:
maple_loader v0.1
Resetting to bootloader via DTR pulse
Reset via USB Serial Failed! Did you select the right serial port?
Searching for DFU device [1EAF:0003]...
Assuming the board is in perpetual bootloader mode and continuing to attempt dfu programming...
Found it!
Opening USB Device 0x1eaf:0x0003...
Found Runtime: [0x1eaf:0x0003] devnum=1, cfg=0, intf=0, alt=2, name="STM32duino bootloader v1.0 Upload to Flash 0x8002000"
Setting Configuration 1...
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=331
Starting download: [##################################################] finished!
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
error resetting after download: usb_reset: could not reset device, win error: зі»з»џж‰ѕдёЌе€°жЊ‡е®љзљ„ж–‡д»¶гЂ‚
Did you flash the latest stm32duino bootloader binary?
Yes I flashed the latest bootloader ‘generic_boot20_pc13.bin’ by UART, and then set both BOOT0/BOOT1 to GND.
Blue Pill seems OK ( acts as ‘Maple DFU’, LED blinked fast/slow, can switch to UART device if pull up PB14 at slow blink).
You should flash the sketch quickly when the flash message appears (RED text), or you will fail.
After uploading the sketch, the user sketch run in right way, and the board switches to Serial device, but , can’t upload sketch by this COMx port (set upload method, select COMx port).
If you re power this board, it acts as ‘Maple DFU’ device and the user sketch looks fine.
More Information:
If BP board connected to PC(Win10) before Starting Up PC, the board can act as ‘Maple Seria(COMx)’, but cannot upload sketch ( Upload Method = Serial, Port = Maple Serial ), the upload message is :
Failed to init device.
stm32flash 0.4
http://stm32flash.googlecode.com/
Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1
Serial is for programming through PA9 and PA10. You should be able to repeatedly upload a simple sketch such as blink. If your code crashes, then you will need to press the reset button just before uploading a new sketch.
Can the bootloader work in a stable mode ? ( DFU when initially upload bootloader, or Serial when a user sketch uploaded).
The DFU mode is not perfect — you need to wait (un plug the board) untill the upload message come.
I hope it works in Serial mode after any user sketch uploading. Why does it go to DFU mode again even if there is a user sketch running?
In this case you don’t need the bootloader.
The bootloader is needed only if you want to upload new code over USB (DFU). In this case you don’t need to switch the BOOT1 jumper, and don’t need the USB serial adapter for upload. However, you can still use the adapter for serial communication (done in your uploaded code).
Obviously you set the IDE to USB upload mode, and you are wondering why it is not uploading over serial !?
Yes, uploading over USB DFU is not perfect, the PC needs ]5 second to re-enumerate the serial port (to COMM) after DFU mode.
But there is the HID upload method, it works way faster. Try it.
How to realize the HID uploading? need an HID bootloader?
If in HID upload mode, can the user make an USB based application?
Thanks
https://github.com/rogerclarkmelbourne/ … bootloader
https://wiki.stm32duino.com/index.php?t … bootloader
the ‘perpetual’ mode is invented originally in the maple / maple mini, but blue pill has different hardware (the connections and one extra tactile button for boot0 that i think bp doesn’t have)
http://docs.leaflabs.com/static.leaflab … oader-mode
the tool to install the sketch is actually dfu-util http://dfu-util.sourceforge.net/, bundled in the libmaple stm32duino core
users on windows platform users has more struggles installing dfu-util as you need to make sure the libusb stack is properly installed
https://zadig.akeo.ie/
https://sourceforge.net/p/libusb-win32/wiki/Home/
then running dfu-util on the command line when bp/mm is waiting for dfu to connect would show you some outputs on the command line
it works well for me in linux, but i’m not too sure about windows
i’ve been using dfu-util (get the latest version) to install arduino sketches on mm / bp and various other boards e.g. stm32f407 boards with the native STM32 DFU flash upload
i think there are stories of leds being soldered in reverse when manufactured, so they won’t light up ! (couldn’t remember if that is exactly it, and that there are different color leds used)
the usual tools are a multi-meter, some power supply e.g. a battery to light up the led and go about measuring and tracing the pins and connections
too lazy to fix that? order a bunch of blue pills possibly go for the cheapest so that statistically you may have one that works, hopefully
you could also use a breadboard or some dupont wires for a external led and connect it to a pin that you know



