Skip to content
A detailed guide to compile Arduino_STM32 bootloaders in Windows
Branch: master
Clone or download
Latest commit 745de08 Aug 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Add_Open_Command_Window_Here_as_Administrator.reg Update Add_Open_Command_Window_Here_as_Administrator.reg May 1, 2018
README.md Updated STEP 5 Aug 14, 2018
msys-1.0.dll dll file for WinAVR May 1, 2018

README.md

Introduction

This repo is a result of painstaking quest to find answer for How to compile STM32duino bootloaders ? Here I walk you through some steps so that you can compile the bootloaders provided by Roger Clark. The steps shown here are for compiling in Windows platform.

Procedure:

Follow the step carefully, so that you don't land up in soup.

Install 7z if you dont have.

STEP_1

Install WinAVR to get make command in Windows commandline from here.

Download this DLL file and keep the file in your WinAVR installation directory under utils/bin/. If you have installed in C:/ directory then drop the file inside C:\WinAVR-20100110\utils\bin.

STEP_2

Now download this zip, extract it, copy and paste the folders in the WinAVR installation directory. Yes! just replace the folders.

STEP_3

In System Variables and User Variables under Environment variables click on NEW and add the following directory to the PATH variable:

  • C:\WinAVR-20100110\utils\bin
  • C:\WinAVR-20100110\bin

If it is already present skip this step.

STEP_4(Optional)

Open command window and type avr-gcc -v and hit enter. The command prompt window should show gcc version 4.8.0 20130306 (experimental) (GCC) in the last line. If you see this you are good to go, else go through the previous steps once more.

STEP_5

This step is the most essential to successfully compile bootloaders. Download this ARM GCC Toolchain and extract(just extract here wil do) it in your desired location. You should see a folder named GNU Tools ARM Embedded. Inside the subfolder named 4.8.3-2014q1 you will find a folder named arm-none-eabi. Again moving inside you will find bin folder.

For example:

If you have extracted the folder inside C:\Program Files (x86) then the directory address should read C:\Program Files (x86)\GNU Tools ARM Embedded\4.8.3-2014q1\bin

Copy the directory of this bin folder and add it to the PATH variable of System Variables and User Variables

STEP_6(Optional)

Open command window and type arm-none-eabi-gcc and hit enter. If you see the following:

arm-none-eabi-gcc: fatal error: no input files

compilation terminated.

then, you have successfully completed STEP 5.

STEP_7

Download the bootloaders from here. Extract it and open command window in the same directory. If you are unable to open the command window in the extracted STM32duino-bootloader folder run the registry file provided in this repo. This will edit your registry, so that you can open command window in any of your desired directory. It makes your life a lot easier!!.

Right click on the bootloader directory and you show see Open Command Window here as Administrator option. Clicking on it will open a command window after a prompt.

If you want to compile bootloader for STM32F103C variant then refer to the make all.bat file in the STM32duino-bootloader folder. In this case I am using the popular BluePill board where the LED is connected to PC13 pin.

So in the command window run make generic-pc13. If everything goes good then you should see the following at the end of the process:

Copying to binaries folder

cp build/maple_boot.bin bootloader_only_binaries/generic_boot20_pc13.bin

Viola, you have successfully compiled bootloader in Windows !!! Go and get two beers 🍻, will have it together. Cheers!!

N.B Your compiled binary file is stored in bootloader_only_binaries folder.

You can’t perform that action at this time.