3629|1

6423

帖子

17

TA的资源

版主

楼主
 

Compiling u-boot and Linux Kernel for Cyclone V SoC [复制链接]

本帖最后由 白丁 于 2016-6-4 22:39 编辑

原文地址
  Preparing SD Card
Prepare SD card using the following steps,
Replace sdd with the right device name. You can find it using sudo fdisk –l. You can also use dd instead of dcfldd. In Windows, you can use Win32 Disk Imager to write the image on to the SD card. You can find it here, Win32 Disk Imager
  Building u-boot, Software Preloader & Build tools
Follow the instruction given in Section 4 Installing baremetal compiler tool chain to install the required tool chain. Once completed you can follow the instruction to build u-boot, software preloader & the build tool mkimage.
  • Download sources from ftp://ftp.altera.com/outgoing/SoC_FPGA/ethernet_3.7/u-boot-altera-2012.10.tgz
  • Unpack the archive containing the source code u-boot-altera-2012.10.tgz using
    • tar xvzf u-boot-altera-2012.10.tgz
  • Please make sure your PATH variable is set in the rightway so that the compile tool arm-none-eabi-gcc is available.
  • Run the following commands to start compiling u-boot & mkimage
    • cd u-boot-altera-2012.10
    • export CROSS_COMPILE=arm-none-eabi-
    • ./MAKEALL socfpga_cyclone5
  • This should build u-boot.img & the tool mkimage. You can flash u-boot.img using the command (sdd3 corresponds to the 3rd partition on your microSD card)
    • sudo dd if=u-boot.img of=/dev/sdd3 bs=64k seek=4
  Building Linux kernel
Follow the instruction given in Section 5 Installing Linaro GCC to install the required toolchain. Once completed you can follow the instruction to build linux kernel
  • Download sources from ftp://ftp.altera.com/outgoing/SoC_FPGA/ethernet_3.7/linux-altera-3.7.tgz
  • Unpack the archive containing the source code using linux-altera-3.7.tgz
    • tar xvzf linux-altera-3.7.tgz
  • Please make sure your PATH variable is set in the rightway so that the compile tool arm-linux-gnueabihf-gcc is available. Also make sure the mkimage created under u-boot-bringup/tools the previous section is available in the PATH variable. For e.g this may be done using export PATH=:$PATH
  • Run the following commands to start compiling linux kernel
    • export ARCH=arm
    • make socfpga_defconfig
    • (optional to make changes to kernel configuration)
    • make menuconfig
    • export CROSS_COMPILE=arm-linux-gnueabihf-
    • make uImage LOADADDR=0x8000
  • This will create the linux kernel image uImage under arch/arm/boot. Copy this to the corresponding microSD card partition. For e.g. (this may vary in your machine)
    • cp arch/arm/boot/uImage /media/4459-058E/
Installing baremetal compiler toolchain
You can find the compiler toolchain Sourcery CodeBench Lite 2012.09-63 from here,
https://sourcery.mentor.com/GNUToolchain/package10928/public/arm-none-eabi/arm-2012.09-63-arm-none-eabi.bin
Install the toolchain using the following instructions,
  • sudo dpkg-reconfigure -plow dash
  • ls -lh /bin/sh
  • sudo mkdir -p /usr/local/codebench_2012_09_63
  • sudo chown $USER.users /usr/local/codebench_2012_09_63/
  • echo "export PATH=/usr/local/codebench_2012_09_63/bin:\$PATH" > ~/CodeBench_setup_linux.sh
  • /bin/sh arm-2012.09-63-arm-none-eabi.bin
This will launch the GUI installer. Use the location created above as the installation path (e.g. /usr/local/codebench_2012_09_63). Proceed by clicking next. Choose add to PATH if you prefer. De-select create links options. This should install the baremetal toolchain & the binaries will be placed in /usr/local/codebench_2012_09_63/bin
  Installing Linaro GCC   (Optional)Installing compiler toolchain 2012.03-57 for ARM GNU/Linux
You can find the compiler toolchain Sourcery CodeBench Lite 2012.03-57 for ARM GNU/Linux from here,
https://sourcery.mentor.com/GNUToolchain/package10382/public/arm-none-linux-gnueabi/arm-2012.03-57-arm-none-linux-gnueabi.bin
Install the toolchain using the following instructions,
  • sudo dpkg-reconfigure -plow dash
  • ls -lh /bin/sh
  • sudo mkdir -p /usr/local/codebench_2012_03-57_linux
  • sudo chown $USER.users /usr/local/codebench_2012_03-57_linux/
  • echo "export PATH=/usr/local/codebench_2012_03-57_linux/bin:\$PATH" > ~/CodeBench_setup.sh
  • /bin/sh arm-2012.03-57-arm-none-linux-gnueabi.bin
This will launch the GUI installer. Use the location created above as the installation path (e.g. /usr/local/codebench_2012_03-57_linux). Proceed by clicking next. Choose add to PATH if you prefer. De-select create links options. This should install the toolchain 2012.03-57 for ARM GNU/Linux & the binaries will be placed in /usr/local/codebench_2012_09_63/bin


此帖出自FPGA/CPLD论坛

最新回复

讲的非常好,看了收获很多,十分感谢   详情 回复 发表于 2020-9-20 14:23
点赞 关注
个人签名training
 

回复
举报

78

帖子

0

TA的资源

一粒金砂(初级)

沙发
 

讲的非常好,看了收获很多,十分感谢

此帖出自FPGA/CPLD论坛
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/6 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表