秉火stm32f429移植u-boot
参考: 《STM32F429i-Discovery 移植并成功跑起来u-boot 2016.05》作者:tcjy1000,链接: https://blog.csdn.net/tcjy1000/article/details/51475438
硬件平台: 使用秉火stm32f429的核心板,搭配挑战者野火stm32的底板。
MCU: stm329igt6,1MB的内部flash,256KB的RAM。
核心板: 8MB的外部SDRAM,IS42S16400J。16MB的外部SPI flash,winbond 25Q128FV。
终端: 使用USART1做为终端,波特率115200。
移植参考模板: 意法半导体公司的stm32开发板 STM32F429-descovery。该开发板和秉火的STM32F429开发板资源非常类似,只需要修改时钟和SDRAM的部分配置就可以了。
U-Boot版本: u_boot-2016.09,该版本u-boot已经支持stm32f429-descovery。下载地址:https://linux.linuxidc.com/index.php?folder=cHViL3UtYm9vdA==
交叉编译环境: 交叉编译器下载地址:https://launchpad.net/gcc-arm-embedded/+download
第一步:配置编译环境
我使用的CentOS虚拟机,使用root权限(其实没必要)
在根目录下创建一个文件夹:mkdir stm32f429ig
将上面下载的交叉编译器和u-boot源码放到这个目录下。
解压交叉编译器gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2到 /opt/ 目录下。
tar xjvf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 -C /opt/
[root@localhost stm32f429ig]# ls
gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 u-boot-2016.09.tar.bz2
[root@localhost stm32f429ig]# tar xjvf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 -C /opt/
在环境变量中加入该路径以方便调用。在 .bashrc的最后一句加入 export PATH=$PATH:/opt/gcc-arm-none-eabi-5_4-2016q3/bin
vim ~/.bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=$PATH:/opt/gcc-arm-none-eabi-5_4-2016q3/bin
source ~/.bashrc
使修改的环境变量立即生效。
使用echo $PATH
命令查看环境变量是否设置成功,使用which arm-none-eabi-gcc
和arm-none-eabi-gcc -v
命令查看交叉编译环境是否安装成功。
[root@localhost stm32f429ig]# vim ~/.bashrc
[root@localhost stm32f429ig]# source ~/.bashrc
[root@localhost stm32f429ig]# echo $PATH
/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/cj/bin:/opt/gcc-arm-none-eabi-5_4-2016q3/bin:/opt/gcc-arm-none-eabi-5_4-2016q3/bin
[root@localhost stm32f429ig]# which arm-none-eabi-gcc
/opt/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc
[root@localhost stm32f429ig]# arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc