STM32 移植Linux内核

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

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”

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

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

  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脚本。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值