the right bootloader for this blue pill

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
joedodo2
Posts: 7
Joined: Sat Feb 03, 2018 3:53 am

the right bootloader for this blue pill

Post by joedodo2 » Sat Feb 03, 2018 5:50 pm

I got this version of blue pill. so far I have burned the generic_boot20_pc13.bin (the about 20kb one) to it and in windows, the system found it as Maple Serial. In one sketch, I tried using Serial.println("abc"); it actually shows that in the serial monitor in windows. However, I can't make the led flash. I have tried the example from a standard arduino example set and also the stm32 example set, still no blinking led. So doesn't that mean the usb is not working? Do I need to solder the resistant? Or I used the wrong bootloader 2.0?

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
STM32_BP_Alt_Top_View.jpg (91.49 KiB) Viewed 305 times

stevestrong
Posts: 2073
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: the right bootloader for this blue pill

Post by stevestrong » Sat Feb 03, 2018 6:01 pm

The LED may be soldered wrongly.
You can still check the PC13 pin whether it toggles or not.

User avatar
RogerClark
Posts: 7693
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: the right bootloader for this blue pill

Post by RogerClark » Sat Feb 03, 2018 8:57 pm

Ignore the error message at the end of the upload

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

joedodo2
Posts: 7
Joined: Sat Feb 03, 2018 3:53 am

Re: the right bootloader for this blue pill

Post by joedodo2 » Sun Feb 04, 2018 4:24 am

Thanks Roger, after the uploading, I heard the usb unplug and plug sound from my windows and it is back shown as Maple Serial. But I tried the following sketch, there is no output from pin PA4. I measured it with a multi-meter it shows only 0.2V or so.
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
}

User avatar
mrburnette
Posts: 2236
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: the right bootloader for this blue pill

Post by mrburnette » Sun Feb 04, 2018 4:56 am

From the documentation here:
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

joedodo2
Posts: 7
Joined: Sat Feb 03, 2018 3:53 am

Re: the right bootloader for this blue pill

Post by 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

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.

User avatar
mrburnette
Posts: 2236
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: the right bootloader for this blue pill

Post by mrburnette » Sun Feb 04, 2018 5:30 am

joedodo2 wrote:
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

joedodo2
Posts: 7
Joined: Sat Feb 03, 2018 3:53 am

Re: the right bootloader for this blue pill

Post by joedodo2 » Sun Feb 04, 2018 7:34 am

Thanks very much.

User avatar
Pito
Posts: 1744
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: the right bootloader for this blue pill

Post by Pito » Sun Feb 04, 2018 10:57 am

I would recommend to create a simple sketch which will show you all works fine after the bootloader has been flashed in.
For example this one:

Code: Select all

// 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
}
When it prints out and blinks then your BPill works fine most probably. When not, tell us what the problem is exactly..
Pukao Hats Cleaning Services Ltd.

User avatar
mrburnette
Posts: 2236
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: the right bootloader for this blue pill

Post by mrburnette » Sun Feb 04, 2018 2:02 pm

Thank you, Pito;

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
Examples_ArduinoIDE.jpg (85.33 KiB) Viewed 224 times
So, what would be very helpful is if we the extended members would run through these examples looking for improvements and also to validate after Roger makes a major merge from a pull-request.

Ray

Post Reply