Goal: Compile STM32F4 firmware and brush into our development board: STM32F407VET6
1. compile under Linux operating system, windows users can run Linux in a virtual machine, it is recommended to download kali system (affiliated Linux system): https://www.kali.org/downloads/ , recommend the use of virtual machines corresponding to the system package, the virtual machine itself Baidu download and install cracked version.
2. After entering the Linux system, open a terminal (open: Click on the icon pointing to the head):
3. Enter the commands: sudo apt-get install git pressing the return
Objective: To install git tools
git features: download data
4. Enter command: sudo apt-get install gcc
Input command: sudo apt-get install gcc-arm-none-eabi
Objective: To install a cross-compiler, cross-compiler feature is the high-level language (for example: python, c language ...) translated into low-level language (for example: assembly language, machine language ...) operation
The input command: git clone https://github.com/micropython/micropython
Objective: Our objective git tool to download the source files --micropython
The download is complete: micropython will find the name of the folder in your home directory
Please read README.md the file folder, which has functional details of each file.
In micropython / ports / stm32 / boards folders which can be seen to support processors and development boards.
6. Enter command: cd micropython
Objective: To enter the home from the root directory to a file folder inside micropython
Instruction: ls to list the current directory files
7. The input command: cd ports / stm32 / boards
Objective: To enter the directory to select our development board chip model (STM32F407VET6), however, there are no corresponding version of the model, but the series STM32F4DISC, we use all the source files compiled firmware file we need STM32F4 of.
8. The input command: cp -r STM32F4DISC STM32F407VET6
Objective: To copy the source file and rename it: STM32F407VET6
9. output command: cd ..
cd ..
cd ..
Objective: cd .. instruction is to return to the parent directory, the purpose is to return to the directory micropython (note cd followed by a space)
10. The input command: cd mpy-cross
make
Objective: To compile what MicroPython cross-compiler (micropython cross-compiler)
11. The input command: cd ..
git init
git submodule update -init
Objective: To return to the micropython directory, sub-module and obtaining submodule update
12.cd ports/stm32/make BOARD=STM32F407VET6
Objective: compile operation proceeds stm32 directory, generating a firmware file DFU or HEX or ELF ......, BOARD = STM32F407VET6 is to be compiled for designating development board (inside the source file is read)
Wait for the completion of the translation: the compiler will generate success in a build-STM32F407VET6 stm32 directory folder, find firmware.dfu or firmware.hex ... firmware files copied to the windows desktop.
13. ST official website to download DfuSe Tools: https://www.stmicroelectronics.com.cn/content/st_com/zh/products/development-tools/software-development-tools/stm32-software-development-tools/stm32- programmers / stsw-stm32080.html
14. The development board hardware settings boot0: 1, boot1: 0, the computer using a USB connection, open DfuSe software, will be displayed in the DFU Devices The following connections on the display is connected, then click on the bottom right corner of the Choose to select the firmware file and then click Upgrade burn, burn wait for success.