Sunday, 30 October 2016

USB Boot Loader (Device-Firmware-Upgrade) for STM32F103C8T6

USB Boot Loader (Device-Firmware-Upgrade) for                                                  STM32F103C8T6

STM32F103C8T6 is most popular cheap and best micro-controller based on ARM-Cortex-M3 core
It is also called as minimum development board or Bluepill it can be used to do mini projects.
from ST official website you can get datasheet and software for this board.Key features of this board 
it got multiple serial communication protocols like
1) USART   2) USB     3)SPI     4)I2C     5)CAN
also has 7-channel DMA support with moderate on chip memory of RAM-20KB, FLASH-64KB
by default it has USART bootloader.
To program it through USART ISP one should set two yellow jumpers in above diagram in following position
Boot0-High
Boot1-Low

For programming this device either you can use ST-Link or USB to TTL Serial Converter 



It also has Micro USB port but by default it can be used only to supply power to board. Here i will show how to add secondary bootloader to STM32F103C8T6 (bulepill) board so that you can use same USB cable to power up as well as to program board at the expense of loss of  few KB  flash. First 12KB of flash will be occupied by this secondary boot loader.

Softwares that are required to add DFU support to STM32F103C8T6 
1) STM FlashLoader- Download from STsite   
2) STM USBdfuse - Download from STsite
note you should register to download from ST which is simple process (free)
3) IDE i will use Keil uv , you can get it from here  select STM32F1xx pack
4) STM DFU Firmware.hex - Download
Initially Install first three softwares  after installation you may find STMicrocontroller
 softwares in this path C:\Program Files (x86)\STMicroelectronics\Software
just go to Flash Loader Demo folder and pin STMFlashLoaderDemo.exe to task bar
similarly go to DfuSe v3.05 folder -> Bin folder  and pin DfuFileMgr.exe and DfuSe Demo.exe to Taskbar. 
Then open  STM FlashLoader to flash controller with STM DFU Firmware.hex
Initially this has to be done through USART0 
pins PA9-Tx of board must be connected to Rx of USB to Serial Converter
pins PA10-Rx of board must be connected to Tx of USB to Serial Converter
and by keeping Boot0 high Boot1 low press reset 
open FlashLoader.exe
you should get this kind of info on screen
Press reset button on board  and click on next  
you should get response like this
If you get no response from device
Troubleshoot: then click on ok and change echo to echo mode press reset and click next again you will get no response. This time revert it to echo disabled and press reset on board and immediately click next you will get above mentioned response.
   then click next

It will recognize STM32F103C8T6 as medium density device click next

check Download to device and click on open  menu to select DFU.hex
click next.
you should get response as Download operation finished successfully then click on close.
now change boot0 position to logic 0 .
Go to C:\Program Files (x86)\STMicroelectronics\Software 
DfuSe v3.05 folder and click on drivers based on Processor type 64 or 32bit and Windows type go to appropriate Drivers folder and install drivers.

Since it is secondary bootloader entrypoint is based on PB9 pin when you connect USB to system make sure that PB9 kept floating If it is connected to ground DFU drivers will be skipped and application code will be executed.


open DFUse Demo you should see Internal flash of 64KB 
Since Secondary bootloader takes 12KB you have to follow few modifications in application code

System_stm32f10x.c change VECT_TAB_OFFSET to  0x3000

under options for target change IROM from 0x8000000 to 0x8003000 

also check Linker option use memory layout from target dialog
thats it click on to generate hex 

and open DFU file manager to convert Hex to DFU file



then click on generate .dfu file
save with some name and extension as .dfu it will give success message

then use Dfuse demo to upload code in to flash



check on Verify after download and Optimize Upgrade duration
you should get verify successful then click reset so that application code will be executed
 that's it you can do program by using same usb cable


  Programming Tutorial can be followed from here

NOTE: DFU.hex is password protected whoever wants it can post their email id under comments section. 

Indonesia -done
Ukraine-done
Russia-done
Czech republic-done
Argentina-done
I am glad that I could interact with people of these countries.Hopefully I could help somemore in future.

172 comments:

  1. hi Vikram, this my email krisna.2w@gmail.com. i need the password please. thanks.

    ReplyDelete
  2. hi can you please send me the dfu.hex password to my email imansetiawan1970@yahoo.com

    ReplyDelete
  3. Hi! Can i get a pass for dfu.hex on may email major_x@mail.ru
    Thanks!

    ReplyDelete
  4. hi can you please send me the dfu.hex password to my email lukas083@gmail.com

    ReplyDelete
  5. Thank for Share, Please Give me a Pass for DFU.hex
    my Email ivay54sr@gmail.com

    ReplyDelete
  6. Hi, can you please send me the password? My email is electronicauncu@gmail.com
    Many thanks,
    Eduardo (from Argentina)

    ReplyDelete
  7. Please send me the password my mail is saha.papu.sumalya@gmail.com

    ReplyDelete
  8. Thanks very much in advance, very good job. Please can you send to me the password for the "dfu.rar". Thanks

    Manuel Garcia
    bouchainmg@gmail.com

    ReplyDelete
    Replies
    1. Good afternoon sensei Bouchain, greetings by Miguel Nava, i follow your steps in the microcontrollers.

      Delete
  9. Good day!
    Thank you very much for your effort! Can you please send me the file dfu.hex with password?

    With best regardes,
    Vladimir Stolbov from Kazakhstan
    vstolbov1979@gmail.com

    ReplyDelete
  10. Good job. Please can you send to me the password for the "dfu.rar". Thanks

    De Santis Giuseppe

    desantisgiuseppe59@yahoo.fr

    ReplyDelete
  11. Thank You for your tutorial

    and email id of mine is mayurshuklaex@gmail.com

    ReplyDelete
  12. Thanks very much, good job, please send me the dfu.hex password to ikonbigfoot@gmail.com.

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Sir,I am getting no response from the device..its showing the no response label.I have tried the trouble shoooting but in vain.
    please help

    ReplyDelete
  15. пожалуйста. Praporshik.ru@mail.ru

    ReplyDelete
  16. Hi, this too can make the source code???

    ReplyDelete
  17. Thank You for your tutorial

    and email id of mine is stevensklavos@gmail.com

    ReplyDelete
  18. Hi u would need password. My email is duffy@duffy.sk

    ReplyDelete
  19. Please send the password to szingman@gmail.com

    Thanks, Steve

    ReplyDelete
  20. SEND PASSWORD a.kaviarasan@gmail.com

    ReplyDelete
  21. Please send me the password my mail is ahmmedsamier2017@gmail.com

    ReplyDelete
  22. Thank for Share, Please Give me a Pass for DFU.hex
    my Email is alyssonapm@gmail.com

    ReplyDelete
  23. please pass word sukomaryanto@gmail.com

    ReplyDelete
  24. please pass word eloiz07@gmail.com

    ReplyDelete
  25. please pass word lehungmt94@gmail.com

    ReplyDelete
  26. Hello. Please send password on mauhem@tut.by

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. hi Vikram, this my email darwinefraincastro@gmail.com. i need the password please. thanks.

    ReplyDelete
  29. Hello Please send password at kashif.mehmood@skyelectric.com

    ReplyDelete
  30. its great please send me password archtz94@gmail.com
    thankyou

    ReplyDelete
  31. hi cheers, a great tutorial. please in need the password to unlock the hex my email deavong12@gmail.com

    ReplyDelete
  32. Hola, muchas gracias. por favor necesito la clave de acceso, mi correo es:jose_nicolini@yahoo.com.ar.

    ReplyDelete
  33. Hi! the tutorial is great! I need the pasword for the dfu.rar please, thanks! mi email is refugiero@hotmail.com

    ReplyDelete
  34. hi, I want test your fw code, my email es recki@live.com. thks.

    ReplyDelete
  35. Nice tutorial, please your code for password DFU.hex, my e-mail is lightcalamar@gmail.com. Thanks

    ReplyDelete
  36. pass please!
    vano--94@yandex.ru

    ReplyDelete
  37. Dear friend, can you send the password, please?
    my email is aripandelis@gmail.com
    From Brazil best regards!

    ReplyDelete
  38. password please my email lapinoo39@free.fr
    i m from france

    ReplyDelete
  39. Hi, can you send me a password, please? i386@poczta.onet.pl
    I'm from Poland

    ReplyDelete
  40. hi, can you send me password for dfu.hex? eslamsnono45@gmail.com

    ReplyDelete
  41. hi, can you send me password for dfu.hex? kazimgok78@gmail.com

    ReplyDelete
  42. hi can you send me the dfu.hex password? stephen@hyperlight.net

    ReplyDelete
  43. hi, pls DFU.hex password
    tomas.stransky.95@seznam.cz

    ReplyDelete
  44. Good job. Please can you send to me the password for the "dfu.rar". Thanks

    mr.mascote@gmail.com

    ReplyDelete
  45. password please mart_lan@hotmail.com great tutorial

    ReplyDelete
  46. Hi, I'm interrested in testing the hex file. Cuuld you send me the password to kubkpower@gmail.com , please ?

    ReplyDelete
  47. password for .hex file please! arozojr@gmail.com. Thanks

    ReplyDelete
  48. Dear friend, can you send the password, please?
    my email is hifiprojects@gmail.com

    ReplyDelete
  49. Hello! I would like to have a password too :)
    juris3d@gmail.com
    (I am from Riga, Latvia, if that is somehow relevant)

    ReplyDelete
  50. Hello! Nice tutorial. I would like to have the password for the .hex. Thank you! harmon.gary83@gmail.com

    ReplyDelete
  51. Hello Dear i also want paasword for dfu.hex. thankyou
    yogesh.chaudhary954@gmail.com

    ReplyDelete
  52. please send password : snilkov@gmail.com

    ReplyDelete
  53. por favoor la contraseña wilmerluismorales@gmail.com

    ReplyDelete
  54. can you send passward to hassanluby@gmail.com

    ReplyDelete
  55. i love your work, can you send the password ?
    mrtruongchinhnguyen@gmail.com

    ReplyDelete
  56. can you send password to qremosin_rawwr@hotmail.com please

    ReplyDelete
  57. DFU.hex password please
    ivan.tesija@gmail.com
    thanks in advance

    ReplyDelete
  58. DFU.hex password please
    reednoel4u@yahoo.com

    ReplyDelete
  59. This comment has been removed by the author.

    ReplyDelete
  60. DFU.hex password please
    joelin97@gmail.com

    ReplyDelete
  61. can you send me the password for dfu.hex to ruslan_inst@yahoo.com

    Indonesia -done

    ReplyDelete
  62. Dear sir,
    I don't understand some step, but in this forum I can attach the picture.
    Please check email, and help me.
    Thanks
    Rgs,
    Reed Noel

    ReplyDelete
  63. halo Vikram, i am from indonesia, thanks for share document. i need pass for file dfu.rar. can you share to me please? robert_ferdinandus@yahoo.co.id

    Thanks

    ReplyDelete
  64. Dear Vikram,
    Please show me , how to open :
    System_stm32f10x.c change VECT_TAB_OFFSET to 0x3000
    and Next Step.
    Rgs
    reednoel@yahoo.com

    ReplyDelete
  65. Great work ! . please send me password. my email is aamir@mzjtechnology.com.

    ReplyDelete
  66. please send me the password of hex file to swt.sowmya11@gmail.com
    thanks.

    ReplyDelete
  67. Hi nice blog Please send me password of rar file to zerohackers46@gmail.com

    ReplyDelete
  68. Thank For Share Vikram!, Please send me Password to ivay54sr@gmail.com

    ReplyDelete
  69. heey , send the password please rafa.grigorian@gmail.com

    ReplyDelete
  70. Heey, my email is levon-xxl@mail.ru pls password me

    ReplyDelete
  71. Thank you for your work
    Could you please send me the password to dguillemot@wizama.com

    ReplyDelete
  72. except this is my email if you can kindly send me the password: diegoalm@hotmail.it

    ReplyDelete
  73. great tutorial. Can you send me password for the hex? My email is black.out@gmx.de

    ReplyDelete
  74. This comment has been removed by the author.

    ReplyDelete
  75. can you send password to danilocoutinho@lesc.ufc.br

    ReplyDelete
  76. Great work ! . please send me password. my email is shimky85@gmail.com

    ReplyDelete
  77. hi can you please send me the dfu.hex password to my email arthurtomelopes@gmail.com

    ReplyDelete
  78. Hello, I tried with the bootloader of STM32duino-bootloader but I have the Descriptor Error when I connect for USB to PC.

    Can I have this firmware? my email is unrealmitch@gmail.com

    Thanks!

    ReplyDelete
  79. Отличная работа ! . пожалуйста, пришлите мне пароль. моя Электронная почта jek5983@mail.ru

    ReplyDelete
  80. please mail dfu.rar password

    mbkpmj@gmail.com

    ReplyDelete
  81. please mail dfu.rar password
    shaharazan@gmail.com

    ReplyDelete
  82. Thank you for your contribution!
    Please send me password. My email is wh8306@gmail.com

    ReplyDelete
  83. Thank you for all!
    Please send me password. My email is elektronika62@gmail.com

    ReplyDelete
  84. please mail dfu.rar password

    omeralmaci@gmail.com

    ReplyDelete
  85. hello, please send me the password of hex file to bnowak1990@gmail.com
    thanks :)

    ReplyDelete
  86. hello, please send me the password of hex file to rom4nksl@gmail.com
    thanks :)

    ReplyDelete
  87. please can you send me the password
    majd-ghadab@hotmail.com

    ReplyDelete
  88. Hi. Can u send me a password please? stream88888@gmail.com

    ReplyDelete
  89. please can you send me the password
    salarazwar4@gmail.com

    ReplyDelete
  90. Hi.Im Tin .Im Thai people .Im interesting your project.can I get the rar password .Thanks a lot

    Gmail:thipok17@gmail.com

    ReplyDelete
  91. send me the password on my mail id shubhamtrivedi95@gmail.com
    thank you

    ReplyDelete
  92. I am very interest for the project, this is my first... please send me the password. Thanks a lot
    my e-mail: sarmilih10@gmail.com

    ReplyDelete
  93. i would apreciate very much if you can share me the password. Thank you

    disturbed.phaeton@gmail.com

    ReplyDelete
  94. Hi, can you please give me password. Thank you
    kremezz@mail.ru

    ReplyDelete
  95. Hi can you please send me the password
    utsavll0@gmail.com

    ReplyDelete
  96. utsavll0@gmail.com

    can you send me the password

    ReplyDelete
  97. kozanli.onadir@gmail.com

    Can you send me password?

    ReplyDelete
  98. can u send me password?

    nuhdedeoglu@gmail.com

    ReplyDelete
  99. I too am need the password for the hex file. Please send to baotuyet67@yahoo.com. Thank you very much!

    ReplyDelete
  100. im m iresh..please email the password to : ireshjayawardana@gmail.com

    ReplyDelete
  101. Good Job bro, but need your password :-)
    send it to me
    "jitkundu6@gmail.com"

    ReplyDelete
  102. Hello can you please e-mail me the password?
    oguzhan9794@hotmail.com

    ReplyDelete
  103. hi Vikram, my email is sonbktdh@gmail.com. i need the password please. thanks.

    ReplyDelete
  104. Hai i need password send me , my mail id - antonymsp27@gmail.com

    ReplyDelete
  105. Hi...thanks for ur valuable info...plz send the password to this mail
    irajrajeev@gmail.com... Thank you

    ReplyDelete
  106. This comment has been removed by the author.

    ReplyDelete
  107. Your post is great! Can you send me the password please? Thank you very much!
    My email is quanghuypthiet@gmail.com

    ReplyDelete
  108. Nice ! Please send me a password.
    My e-mail: topbh387@gmail.com

    ReplyDelete
  109. Please send the password to baribalik@mail.ru

    Thanks, Bari.

    ReplyDelete
  110. Hi.
    Please send the password to h.roman.lviv@gmail.com
    thanks

    ReplyDelete
  111. Hallo!
    yuliya.sm7@gmail.com
    Thanks for good job

    ReplyDelete
  112. nice post can u send the password to veeramani.retech@gmail.com

    ReplyDelete
  113. Nice ! Please send me a password.
    My e-mail: amin.ganjeali@gmail.com

    ReplyDelete
  114. This comment has been removed by the author.

    ReplyDelete
  115. Hi.Please send the password to kitsana.jm@gmail.com Thank you very much.

    ReplyDelete
  116. Hi.Please send the password to mroger.oliveira@gmail.com Thank you very much.

    ReplyDelete
  117. Привет отличная работа можно мне пароль на архив skovpin@gmail.com

    ReplyDelete
  118. Please send the password at zeshanabdullah@yahoo.com

    ReplyDelete
  119. Nice article!
    Could please send me the password to david9411@web.de

    ReplyDelete
  120. Nice article send the password to lalo82tec@gmail.com thanks

    ReplyDelete
  121. please send me the password to zafer_a_1997@hotmail.com

    ReplyDelete
  122. Hello!

    Please send me password to rainbowkiwifox@gmail.com.

    Thank you.

    ReplyDelete
  123. please send me password to ivespa5758@gmail.com

    ReplyDelete
  124. could you please send the password?
    khalatkaraniruddh@gmail.com

    ReplyDelete
  125. please send me the password my mail is :
    eslam.ahmed5253@gmail.com
    thank you too much.

    ReplyDelete
  126. hi can you please send me the dfu.hex password to my email zrom1969@yahoo.fr

    ReplyDelete
  127. Password Please
    Email : eng.sedoooo@gmail.com

    ReplyDelete
  128. need password pls, email:21nawfal@gmail.com

    ReplyDelete
  129. Would you please send me the password. Thanks a lot.
    super169@126.com

    ReplyDelete
  130. Hello thanks for the tutorial. Please i love to get the password for the dfu. my email- oyes2011@gmail.com

    ReplyDelete
  131. Hello. I`m from Poland. Would you please send me the password? :) matchabikgm@gmail.com

    ReplyDelete
  132. Hello. Can you give me the DFU.hex password. Thanks

    ReplyDelete
  133. Thanks for the great sharing may I request for the password, my email as following tml_98010@hotmail.com

    ReplyDelete
  134. Molto interessante, Grazie. La mia email : liquididropfill@gmail.com

    ReplyDelete
  135. I write "thank you" in Roumanian language: "multumesc!" for dfu password.
    augustin.serban@gmail.com

    ReplyDelete
  136. Hello. I`m from Slovakia. Would you please send me the password? dlugos7@gmail.com

    ReplyDelete
  137. Hello, Thank you for this detailed tutorial, please can you provide me with the "dfu.rar" file password?? Thank you! (email: salar.yunnis@gmail.com)

    ReplyDelete
  138. hola micorreo es jsbp_960810@hotmail.com

    ReplyDelete
  139. hola micorreo es jsbp_960810@hotmail.com

    ReplyDelete
  140. Would you kindly send me the password. My email is gyao_sap@hotmail.com

    ReplyDelete
  141. PassWord Please!!!
    dungdangha2@gmail.com

    ReplyDelete
  142. This comment has been removed by the author.

    ReplyDelete
  143. Hi! Can i get a password for dfu.hex on may email rizqi.uhuy@gmail.com
    Thanks!

    ReplyDelete
  144. Hello, This is CC Tan from Malaysia. Great work on this bootloader. Can you please share the dfu.hex password. my email is ctan10@gmail.com
    Thanks

    ReplyDelete
  145. Please can you let me have the password to ian@ilsoft.co.uk. Thanks.

    ReplyDelete
  146. This comment has been removed by the author.

    ReplyDelete
  147. السلام عليك ارجو ان ترسل لي كلمة السر
    benlahrach.ali@gmail.com

    ReplyDelete
  148. SUPERB..PLEASE GET ME PASSWARD FOR DFU.RAR
    mahesh.vsnl@yahoo.com

    ReplyDelete
  149. This comment has been removed by the author.

    ReplyDelete
  150. SUPERB..PLEASE GET ME PASSWARD FOR DFU.RAR
    SUPERB..PLEASE GET ME PASSWARD FOR DFU.RAR

    tapancs@gmail.com
    thank yuo

    ReplyDelete
  151. Thanks ...
    Pls send the password, sir
    curiousarmy@gmail.com

    ReplyDelete
  152. Would you pls send password of firmware.hex to mylettuce@gmail.com? Thanks a lot!

    ReplyDelete
  153. Thanks
    Would you pls send password of firmware.hex to:
    mydigitalemail@gmail.com

    ReplyDelete
  154. Many thanks...
    Would you share and send the password to brews_ce86@yahoo.com

    ReplyDelete
  155. This comment has been removed by the author.

    ReplyDelete
  156. Hi sir,

    could you please send me the password for dfu file on neelamrani@indivar.com

    ReplyDelete
  157. Buen trabajo,
    podrías , por favor compartirme el password del archivo dfu.rar en mi email: mayepes@unal.edu.co

    ReplyDelete
  158. Hi sir,

    could you please send me the password for dfu file on ravi.varya@gmail.com

    ReplyDelete
  159. This comment has been removed by the author.

    ReplyDelete
  160. Thanks
    Please send the password, sir
    harit.shukla@vegg.co.in

    ReplyDelete
  161. Great tutorial
    Please emal me teh password for DFU file
    abcuk2019@gmail.com
    Thank you

    ReplyDelete
  162. hi~!! My email is outtorun1@gmail.com. I need the password please. thanks.

    ReplyDelete
  163. Dear friend, send the password, please.
    khdeem76@gmail.com

    ReplyDelete
  164. Dear, friend could you please send the password,please?
    fekm35@gmail.com

    ReplyDelete