https://www.ebay.com/itm/STM32F103C8T6- … 1849363080
After soldering the pins on it, I was able to get the PB12 Generic Bootloader on it.
But when I connect it to a micro USB cable, it does not enumerate.
The message is like this:
[255177.002199] usb 2-1.3: new full-speed USB device number 9 using ehci-pci
[255177.074194] usb 2-1.3: device descriptor read/64, error -32
[255177.250204] usb 2-1.3: device descriptor read/64, error -32
[255177.426219] usb 2-1.3: new full-speed USB device number 10 using ehci-pci
[255177.498190] usb 2-1.3: device descriptor read/64, error -32
[255177.678208] usb 2-1.3: device descriptor read/64, error -32
[255177.782332] usb 2-1-port3: attempt power cycle
[255178.366159] usb 2-1.3: new full-speed USB device number 11 using ehci-pci
[255178.774205] usb 2-1.3: device not accepting address 11, error -32
[255178.846219] usb 2-1.3: new full-speed USB device number 12 using ehci-pci
[255179.254234] usb 2-1.3: device not accepting address 12, error -32
[255179.254346] usb 2-1-port3: unable to enumerate USB device
There is a script for this.
I’m sure its all in the FAQ
Your symptoms are consistent with BOOT0 set high.
The udev rule only comes into play after the enumeration.
Eric
Here is what I do:
- Connect B0+ to center.
Connect B1- to center.
Connect USB to TTL
Run stm32flash as below.
Here is the command:
$ ~/arduino/hardware/Arduino_STM32/tools/linux64/stm32flash/stm32flash -w ./generic_boot20_pb12.bin -v -g 0x0 /dev/ttyUSB0
stm32flash Arduino_STM32_0.9
http://github.com/rogerclarkmelbourne/arduino_stm32
Using Parser : Raw BINARY
Interface serial_posix: 57600 8E1
Version : 0x22
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0410 (Medium-density)
- RAM : 20KiB (512b reserved by bootloader)
- Flash : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote and verified address 0x08008324 (100.00%) Done.
Starting execution at address 0x08000000... done.
There are soooo many possible reasons it may not work
Defective board, – usually soldering problems
Defective USB connector or cable
Try uploadloading a blink sketch using your USB to Serial cable (this will remove the bootloader)
Check the LED flashes (this confirms the basic operation of the board e.g. external crystal is attached and working)
(Note. Just because STM32Flash can communicate with the STM32 it doesnt mean the board fully works, as the hardware bootloader in the STM32 works at a much lower level than the processor its self. It may not even by using the main ARM processor in this mode)
I can upload blink and EEPROM emulation test sketches (for a project I am working on), and they all work. Upload using the USB to TTL converter of course.
When loading an LED blink sketch and reading pin 12 (attached to LED), it shows voltage there.
USB cable works fine with my phone (displays storage contents).
Where else to look?
Tonight, I took a new black pill out of its sealed bag and soldered all the pins.
I installed jumpers on B0+ to center, B1- to center. I connected a USB/Serial adapter to 3.3v, GND, PA9, and PA10.
After clearing the rw protection with stm32flash -u and stm32flash -k, I downloaded a fresh copy of the bootloader from the wiki page and flashed the board.
./stm32flash -w /tmp/generic_boot20_pb12.bin -v -g 0x0 /dev/ttyUSB0
stm32flash Arduino_STM32_0.9
http://github.com/rogerclarkmelbourne/arduino_stm32
Using Parser : Raw BINARY
Interface serial_posix: 57600 8E1
Version : 0x22
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0410 (Medium-density)
- RAM : 20KiB (512b reserved by bootloader)
- Flash : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote and verified address 0x08005294 (100.00%) Done.
[kbahey – Wed Apr 18, 2018 1:45 am] –
I got this Black Pill from eBay:https://www.ebay.com/itm/STM32F103C8T6- … 1849363080
Any thoughts appreciated.
This board doesn’t look like a RobotDyn black pill. The picture they provide shows a different pin map. The pin layout doesn’t match the other Blue/Red/Black pills. I would take a multi meter to PA12 and check to see the resistance between the PA12 pin and 3v3. If it isn’t 1K5, then you can start to track down the resistor that controls the pull up and replace it.
You might track down a schematic for it. If you find it post a link here
Edit: Also, this board only has 34 pins instead of 40 pins. Did you check to see if the USB data pins are even connected to PA11/PA12? Some boards only provide power on the USB and don’t even connect the USBD+ and USBD-.
It is not a RobotDyn. But it is the same one as what is here on the wiki
http://wiki.stm32duino.com/index.php?title=Black_Pill
@fredbox,
Can you post a link to the Black Pill that you have with pictures?
I will compare to mine and see if they are the same.
I flashed the file
-rw-rw-r–. 1 eric eric 21140 Apr 6 22:05 generic_boot20_pb12.bin
and the flash tool also reported an end address of 0x08005294 and enumerates properly
Does the binary size match mine?
Note 0x5294 = 21140 decimal. So your file seems to be significantly larger bigger!
Rick,
these boards have a 1k5 resistor and, in my experience, work fine.
They are nice for some uses since they have mounting holes and no components on the rear side.
Eric
The RobotDyn one, the one in that link and I have one which only has 1 boot link (on Boot0)
There may be more types kicking around…
Thanks to @eggysylah: the file size was the clue that it is not the correct one.
Now I used the correct file, and it flashes.
I get this now:
[335034.050534] usb 2-1.3: new full-speed USB device number 65 using ehci-pci
[335034.143824] usb 2-1.3: New USB device found, idVendor=1eaf, idProduct=0003
[335034.143829] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[335034.143831] usb 2-1.3: Product: Maple 003
[335034.143833] usb 2-1.3: Manufacturer: LeafLabs
[335034.143835] usb 2-1.3: SerialNumber: LLM 003
[335036.413949] usb 2-1.3: USB disconnect, device number 65
[335036.610486] usb 2-1.3: new full-speed USB device number 66 using ehci-pci
[335036.708977] usb 2-1.3: New USB device found, idVendor=1eaf, idProduct=0004
[335036.708986] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[335036.708991] usb 2-1.3: Product: Maple
[335036.708995] usb 2-1.3: Manufacturer: LeafLabs
[335036.709474] cdc_acm 2-1.3:1.0: ttyACM0: USB ACM device
Thanks all!
Sketch uses 110096 bytes (83%) of program storage space. Maximum is 131072 bytes.
Global variables use 6584 bytes (32%) of dynamic memory, leaving 13896 bytes for local variables. Maximum is 20480 bytes.
./arduino/hardware/Arduino_STM32/tools/linux/maple_upload ttyACM0 2 1EAF:0003 /tmp/arduino_build_424386/OnStep.ino.bin
Failed to open serial device.
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
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 [email protected]
Opening DFU capable USB device...
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #2 ...
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 [ ] 3% 4096 bytes
Download [= ] 4% 5120 bytes
Download [== ] 8% 9216 bytes
Download [=== ] 12% 14336 bytes
Download [==== ] 16% 18432 bytes
Download [===== ] 20% 22528 bytes
Download [===== ] 21% 23552 bytes
Download [====== ] 24% 27648 bytes
Download [======= ] 28% 31744 bytes
Download [======== ] 32% 35840 bytes
Download [========= ] 36% 40960 bytes
Download [========= ] 38% 43008 bytes
Download [========== ] 40% 45056 bytes
Download [=========== ] 44% 49152 bytes
Download [============ ] 48% 54272 bytes
Download [============= ] 52% 58368 bytes
Download [============== ] 56% 62464 bytes
Download [============== ] 57% 63488 bytes
Download [=============== ] 60% 67584 bytes
Download [================ ] 64% 71680 bytes
Download [================= ] 68% 75776 bytes
Download [================== ] 72% 80896 bytes
Download [================== ] 74% 82944 bytes
Download [=================== ] 76% 84992 bytes
Download [==================== ] 80% 89088 bytes
Download [===================== ] 84% 94208 bytes
Download [====================== ] 88% 98304 bytes
Download [======================= ] 92% 102400 bytes
Download [======================== ] 96% 107520 bytes
Download [=========================] 100% 110096 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
This uses the Boot1 jump link to lock it in DFU mode.
However it sounds like you had a problem with the laptop.
E.g. “Tey turning it off and then on again”
The laptop thing turned out to be timing (pushing the button at the correct moment to make the IDE upload the sketch).
Thanks for all the help.
This section:
http://wiki.stm32duino.com/index.php?ti … ws_machine
Where it says: “Download the correct bootloader binary, in this case generic_boot20_pb12.bin”, the link should be corrected to be:


