STM32 移植Linux内核

  1. Install arm toolchain:arm-2010q1-189-arm-uclinuxeabi-i686-pc ….

STM32 移植Linux内核_第1张图片

uncompress first and move the directory to /usr/bin use:

tar jxvf arm-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu.tar.bz2

mv arm-2010q1 /usr/bin

  1. Add toolchain directory to /etc/bash.bashrc use:

sudo vim /etc/bash.bashrc

Add “export PATH=$PATH: /usr/bin/arm-2010q1/bin” to the last line

source /etc/bash.bashrc

  1. Check toolchain use “arm-uclinuxeabi-g++ -v”

STM32 移植Linux内核_第2张图片

IF ERR :

Solution: sudo apt-get install lsb-core

  1. Install gcc-arm-none-eabi

sudo apt-get install gcc-arm-none-eabi

  1. Reboot your computer with “sudo reboot”
  2. Install libtool use “sudo apt-get install libtool”
  3. Install automake use “sudo apt-get install automake” (repair aclocal :not found)
  4. Install OpenOCD

STM32 移植Linux内核_第3张图片

IF ERR:

configure: error: libusb-1.x is required for the ST-Link JTAG Programmer

S: apt-get install libusb-1.0.0-dev

  1. Install genromfs

  1. Compile af-boot

uncompress afboot-stm32-master.zip

cd afboot-stm32-master

make stm32f429i-disco

STM32 移植Linux内核_第4张图片

  1. use Segger J-flash and write stm32f429i-disco.bin to flash address 0x08000000
  2. cd /linux/

make stm32_defconfig

make ARCH=arm CROSS_COMPILE=arm-none-eabi-

13.

(1)制作2M全FF文件 :

tr '\000' '\377' < /dev/zero | dd of=stm32f429-disco.img bs=1024 count=2k

(2)0x8000000地址开始写boot :

dd if=stm32f429i-disco.bin skip=0 of=stm32f429-disco.img seek=0 bs=1K count=85

(3)0x8004000地址写dtb :

dd if=stm32f429-disco.dtb skip=0 of=stm32f429-disco.img seek=16 bs=1K count=17

(4)0x8008000地址写xipImage :

dd if=xipImage skip=0 of=stm32f429-disco.img seek=32 bs=1K count=2000

 

 

.tar.gz     格式解压为          tar   -zxvf   xx.tar.gz

.tar.bz2   格式解压为          tar   -jxvf    xx.tar.bz2

解压cpio文件 cpio -idmv < filename.cpio

文件重命名 mv oldname newname

arch/arm/boot/dts ---dtb

arch/arm/boot/xipImage

vim arch/arm/configs/stm32_defconfig

cp arch/arm/boot/dts/stm32f429-disco.dtb /home/user/Desktop/img/

cp arch/arm/boot/xipImage /home/user/Desktop/img/

cp stm32f429-disco.img /mnt/hgfs/Downloads/

Busybox:

make menuconfig

 

修改驱动文件:

/linux-5.0.7/drivers

 

#! /bin/sh 是指此脚本使用/bin/sh 来执行

#!是特殊的表示符,其后面跟的是解释此脚本的shell的路径,如果没有声明,则脚本将在默认的shell中执行,默认shell是由用户所在的系统定义为执行shell脚本。

你可能感兴趣的:(STM32)