Generic STM32F103C8T6 (bluepill) with 2.0 bootloader for PC13

Windows XP,Vista,7,8 and 8.1 etc
Post Reply
e-dredon
Posts: 9
Joined: Sun Aug 30, 2015 9:04 am

Generic STM32F103C8T6 (bluepill) with 2.0 bootloader for PC13

Post by e-dredon » Sat Sep 05, 2015 7:16 am

Hello,

I'm having two issues with the following configuration :

Windows 8.1
STM32F103C8T6 (bluepill)
Arduino IDE 1.6.5
Arduino_STM32
STM32duino-bootloader - generic_boot20_pc13.bin

1. Compiling takes a lot of time
Everytime I'm compiling a new sketch, it seems every STM32F1/cores has to be compiled again in a new random folder located in %user%\AppData\Local
It takes a lot of time.

I don't have that issue with a generic arduino uno R3 or my Teensy 3.1

2. I can't make the bootloader working properly once arduino-serial is initialized

Here is the installation procedure I've completed
- Install the Arduino 1.6.5 ide
- Add the Arduino SAM boards (32-bits ARM Cortex M3) to get the toolchain
- Add the Arduino_STM32 folder to "C:\Program Files (x86)\Arduino\hardware"
- Install the DFU / virtual com port with the batch script C:\Program Files (x86)\Arduino\hardware\Arduino_STM32\drivers\win\install_drivers.bat
- Configure the board on the IDE as generic STM32F103C series - Variant STM32F103C8 (20k ram/128k flash)
- Basic blink test with PC13 LED sketch uploading thru a USB/TTL adapter (setup on COM4)
- Switch the Boot0 jumper
- Upload the bootloader with stm32flash.exe
C:\Program Files (x86)\Arduino\hardware\Arduino_STM32\tools\win>stm32flash.exe -
..\..\STM32duino-bootloader\generic_boot20_pc13.bin -v -g 0x0 COM4
- Switch back the Boot0 jumper and connect it thru USB
* The PC13 led is blinking and maple-dfu is showing up as a libusb-win32 device
- Configure the IDE upload method for STM32duino bootloader
- Upload a blank sketch

Code: Select all

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=237
Starting download: [##################################################] finished!
error resetting after download: usb_reset: could not reset device, win error: file not found.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
* notice the file not found error
- Upload is sucessful by the way. The board reboots and the Maple serial shows up on COM14
* PC13 in not blinking anymore as I've uploaded a blank sketch.
- Check COM14 is selected as the COM port on the Arduino IDE.

But, Any sketch i'm trying to upload with the bootloader gets me this error

Code: Select all

Maple_loader v0.1
Resetting to bootloader via DTR pulse
Searching for DFU device [1EAF:0003]...
Found it!

Lost Device after reset, assuming prod_id was incremented by oneNo DFU capable USB device found
an error occurred! Problem uploading via dfu-util: No Maple found
The board reset OK. it's seen as a Maple DFU again for a second, then switch again to a Maple-serial device

I can upload any sketch with the USB-TTL adapter erasing the bootloader with success.


Any help would be greatly appreciated

Best regards,

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

Re: Generic STM32F103C8T6 (bluepill) with 2.0 bootloader for PC13

Post by RogerClark » Sat Sep 05, 2015 8:51 am

1. Compiling takes a lot of time
It takes a lot of time.
This is normal for all "third party hardware". The Arduino IDE team know of this problem, but they have not fixed it, as it does not apply to the Uno or Due etc.
Everytime I'm compiling a new sketch, it seems every STM32F1/cores has to be compiled again in a new random folder located in %user%\AppData\Local
This is a change to the Arduino IDE in version 1.6.4, by the Arduino IDE team. I think it can be installed in "Portable" mode if you don't want it to use that folder.
(You will, need to Google how to re-install in Portable mode)

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

Re: Generic STM32F103C8T6 (bluepill) with 2.0 bootloader for PC13

Post by mrburnette » Sat Sep 05, 2015 2:39 pm

e-dredon wrote: <...>
1. Compiling takes a lot of time
Everytime I'm compiling a new sketch, it seems every STM32F1/cores has to be compiled again in a new random folder located in %user%\AppData\Local
It takes a lot of time.
<...>
This is just the way the Arduino system is configured. When compiling using Arduino IDE and the ESP8266, an intelligent compile takes place and compiled modules are reused if not changed. It is still somewhat "slow" which in itself is just perception.

All of this "slowness" can easily be rectified by throwing more host CPU cycles at the underlying GCC compiler. I have used this argument successfully to convenience myself over the years to upgrade my lab notebook. I suggest you give it a try; when you think about it, you probably new a new workstation anyway :lol:


Ray

e-dredon
Posts: 9
Joined: Sun Aug 30, 2015 9:04 am

Re: Generic STM32F103C8T6 (bluepill) with 2.0 bootloader for PC13

Post by e-dredon » Sat Sep 05, 2015 5:28 pm

Ok thanks for your comments. So no fix for the issue #1 for now. I can deal with that.

I'm not going to trade my Core I7 4770K + 16Gb DDR3 for the world, sorry, except if someone feels like giving away a Skylake I7-6700K complete set up ;)
Anyway, don't you think investing half a million dollars on a workstation, to make home developpments on a 3.5USD microcontroller is a bit odd ?
ESP8266 exemples compiles quite fine for me. Indeed most of the code is not recompiled everytime. In my experience it's even faster with eclipse+unofficial SDK

OK so let's hope the Arduino IDE team will consider fixing that issue in a near future.

What about my second issue with the bootloader ?

Best regards,

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

Re: Generic STM32F103C8T6 (bluepill) with 2.0 bootloader for PC13

Post by mrburnette » Sat Sep 05, 2015 7:11 pm

e-dredon wrote:<
...>
What about my second issue with the bootloader ?

Best regards,

There are indications from previous chatter that the Blue Pill bootloader was working with USB:
http://www.stm32duino.com/viewtopic.php?t=117&start=20

I'm simple and use the Maple Mini only; no issues to report but you may wish to repost the inquiry with a new title just to get new visibility.

Google bot crawls this site, so you may wish to craft a query and use the "site": qualifier syntax
"Blus pill bootloader" site:stm32duino.com


Ray

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

Re: Generic STM32F103C8T6 (bluepill) with 2.0 bootloader for PC13

Post by RogerClark » Sat Sep 05, 2015 9:26 pm

I dont have a blue pill. I have some red pill boards, but they are a bit different.

I think it can be made to work, but there may be a hardware issue with the pullup on USB D+. (PA12).

From what I recall, a few people got the Blue Pill to work, but they may have added a pullup.

Re:Compilation speed.

Unfortunately, the Arduino IDE does not use a "make" style build system. The IDE have tried some things to cache some object files, but generally it seems to end up recompiling at least half of all the core files.

I've noticed compilation speed seems to be faster on Linux than windows, (when I dual booted the same machine).

Eclipse will be faster to recompile, as it has a proper "make" system.

Post Reply