This post guides you on compiling STM32duino bootloader from scratch.
Here I walk you through some steps so that you can compile the STM32 bootloaders provided by Roger Clark.
The steps shown here are for compiling in Windows platform.
Install 7z if you dont have.
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.
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
then, you have successfully completed STEP 5.
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
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.
Here I walk you through some steps so that you can compile the STM32 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 getmake
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
STEP_4(Optional)
Open command window and typeavr-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 typearm-none-eabi-gcc
and hit enter. If you see the following:arm-none-eabi-gcc: fatal error: no input files
compilation terminated.
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.
Comments
Post a Comment