无法在 Freescale i.MX28 上启动基本的 OpenEmbedded-Core [英] Can't boot basic OpenEmbedded-Core on Freescale i.MX28

查看:34
本文介绍了无法在 Freescale i.MX28 上启动基本的 OpenEmbedded-Core的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在 评估工具包用于飞思卡尔的ARM i.MX28,将 Freescale ARM 层用于OpenEmbedded-Core.不幸的是,我找不到基本的入门"指南(尽管有一个 Yocto 入门指南).不幸的是,我无法开始",无法成功启动到主板调试串行端口上的基本命令提示符.

这是我能够拼凑起来的东西,并且到目前为止我已经设法做到了.

获取来源

mkdir -p oe-core/freescale-armcd oe-core/飞思卡尔臂git clone git://git.openembedded.org/openembedded-core oe-coregit 克隆 git://github.com/Freescale/meta-fsl-arm.gitcd oe-coregit clone git://git.openembedded.org/meta-openembeddedgit clone git://git.openembedded.org/bitbake bitbake

搭建环境

<预><代码>../oe-init-build-env

这会将我们置于一个新的子目录 build 并设置某些环境变量.

编辑配置

编辑 conf/bblayers.conflocal.conf 文件:

conf/bblayers.conf 应该为 BBLAYERS 添加 meta-fls-armmeta-oe 层代码>.例如:

BBLAYERS ?= " \/home/craigm/oe-core/freescale-arm/oe-core/meta \/home/craigm/oe-core/freescale-arm/oe-core/meta-openembedded/meta-oe \${TOPDIR}/../../meta-fsl-arm \"

conf/local.conf中,我设置:

BB_NUMBER_THREADS = "4"PARALLEL_MAKE = "-j 4"机器 = "imx28evk"

构建

bitbake core-image-minimal

我在一夜之间运行了这个构建,它对我来说已经成功完成了.输出文件位于 ~/oe-core/freescale-arm/oe-core/build/tmp-eglibc/deploy/images.

我想尝试两个启动选项,如下所述.从 SD 卡启动更简单,但将映像写入 SD 卡需要相当长的时间(约 30 分钟).从 TFTP + NFS 启动速度更快,但需要更多设置.

从 SD 卡启动

将图像写入 SD 卡:

sudo dd if=tmp-eglibc/deploy/images/core-image-minimal-imx28evk.sdcard of=/dev/sdc

大约需要 30 分钟(3.5 GB 文件).然后我把它放在板子的SD卡插槽0,并通电.它已经加载内核,然后停止:

U-Boot 2012.04.01-00059-g4e6e824(2012 年 8 月 23 日 - 18:08:54)454 MHz 的飞思卡尔 i.MX28 系列启动:SSP SD/MMC #0,3V3DRAM:128 MBMMC:MXS MMC:0*** 警告 - CRC 错误,使用默认环境在:串行输出:串行错误:串行净值:FEC0、FEC1按任意键停止自动启动:0读取boot.scr** 无法从 mmc 0:2 读取 "boot.scr" **阅读uImage2598200 字节读取从 mmc 启动...## 在 42000000 处从 Legacy Image 引导内核...镜像名称:Linux-2.6.35.3-11.09.01+yocto-20创建时间:2012-08-23 7:53:40 UTC映像类型:ARM Linux 内核映像(未压缩)数据大小:2598136 字节 = 2.5 MiB加载地址:40008000入口点:40008000正在验证校验和...好的正在加载内核映像...好的好的启动内核...解压 Linux... 完成,启动内核.

从 TFTP + NFS 启动

首先,我尝试将 U-Boot 写入 SD 卡:

sudo dd if=tmp-eglibc/deploy/images/u-boot-imx28evk.mxsboot-sdcard of=/dev/sdc

然后我把它放在板子的 SD 卡槽 0 中,并通电.但是我在调​​试串口中得到的只是:

0x8020a01d

因此,我决定在 SD 卡上使用飞思卡尔的 U-Boot for i.MX28 发行版(来自他们的 LTIB 发行版).我使用来自 DHCP 的参数为 NFS 启动设置了合适的 U-Boot 参数.

setenv bootargs console=ttyAMA0,115200n8setenv bootargs_nfs setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=,v3,tcp fec_mac=${ethaddr}保存环境

我使用以下 DNSmasq 设置连接到 DD-WRT 路由器:

dhcp-boot=,,192.168.250.106dhcp-option=17,"192.168.250.106:/home/craigm/rootfs"

在我的主机 PC 上,我设置了一个 TFTP 服务器来为 ~/oe-core/freescale-arm/oe-core/build/tmp-eglibc/中的 uImage 文件提供服务部署/图像/.

我还设置了一个根 NFS 服务器来为根文件系统提供服务.我编辑了 /etc/exports 以提供 /home/craigm/rootfs.我解压了根文件系统:

bitbake meta-ide-supportrm -Rf ~/rootfsrunqemu-extract-sdk tmp-eglibc/deploy/images/core-image-minimal-imx28evk.tar.bz2 ~/rootfs

然后我将 U-Boot SD 卡放入板卡的 SD 卡槽 0,并通电.到此为止,然后停止:

<代码>...TCP立方注册NET:注册协议族 17can:控制器局域网核心(rev 20090105 abi 8)NET:注册协议族 29can:原始协议(修订版 20090105)mxs-rtc mxs-rtc.0:将系统时钟设置为 1970-01-01 00:03:33 UTC (213)eth0:飞思卡尔 FEC PHY 驱动程序 [通用 PHY] (mii_bus:phy_addr=0:00, irq=-1)eth1:飞思卡尔 FEC PHY 驱动程序 [通用 PHY] (mii_bus:phy_addr=0:01, irq=-1)发送 DHCP 请求.PHY:0:00 - 链接已启动 - 100/Full., 好的IP-Config:从 192.168.250.106 得到 DHCP 应答,我的地址是 192.168.250.142IP-Config: 完成:设备=eth0,地址=192.168.250.142,掩码=255.255.255.0,gw=192.168.250.1,主机=192.168.250.142,域=,nis-域=(无),引导服务器=192.168.250.106,根服务器=192.168.250.106,根路径=/home/craigm/rootfs在 192.168.250.106 上查找 RPC 100003/3 的端口在 192.168.250.106 上查找 RPC 100005/3 的端口VFS:在设备 0:15 上挂载根目录(nfs 文件系统).释放初始化内存:160K

我不确定它是在没有串行控制台的情况下运行,还是其他一些问题.我可以在 192.168.250.142 上 ping 它,但我不能 Telnet 或 SSH 到它.

问题

  • 是否有针对 Freescale i.MX28 上的 OpenEmbedded-Core 的入门"指南?
  • 飞思卡尔 ARM 层是否真的适用于 OpenEmbedded-Core、Yocto 或其他什么东西?我真的不明白这些项目是如何关联的.
  • 是否有其他人在飞思卡尔的 i.MX28 上成功启动了 OpenEmbedded-Core 的最小映像?如果是这样,您的程序与我的有何不同?
  • 现阶段我不确定问题是否只是无法正常工作的串行控制台,还是其他类型的问题.很难诊断这些甚至阻止基本系统运行的问题.关于此时如何诊断的任何指示?
  • 为什么 U-Boot 会坏掉,甚至无法启动?

解决方案

从启动消息看来 U-boot 工作正常.U-boot 没有坏.

以下启动信息

2598200 字节读取从 mmc 启动...## 在 42000000 处从 Legacy Image 引导内核...镜像名称:Linux-2.6.35.3-11.09.01+yocto-20创建时间:2012-08-23 7:53:40 UTC映像类型:ARM Linux 内核映像(未压缩)数据大小:2598136 字节 = 2.5 MiB加载地址:40008000入口点:40008000正在验证校验和...好的正在加载内核映像...好的好的启动内核...解压 Linux... 完成,启动内核.

通过上面的日志,u-boot 已经完成了它的工作.引导内核"是引导加载程序将控制权交给内核的点.

我猜问题可能出在内核映像或内存中.

要排除内存问题,请尝试查看手册并尝试使用板子的参考手册在RAM中读写.

从启动日志 RAM 看起来没有问题.已初始化.

DRAM:128 MiB

检查以下消息是否没有引起任何问题.* 警告 - CRC 错误,使用默认环境

检查是否所有设备都已初始化并且在错误的 crc 警告后没有跳过任何内容.

I've been trying to build and boot OpenEmbedded-Core on the evaluation kit for Freescale's ARM i.MX28, using the Freescale ARM layer for OpenEmbedded-Core. Unfortunately, I can't find a basic "Getting Started" guide (though there is a Yocto getting-started guide). Unfortunately, I haven't been able to "get started", to the point of successfully booting to a basic command prompt on the board's debug serial port.

Here is what I've been able to piece together, and as far as I've managed to get so far.

Fetch sources

mkdir -p oe-core/freescale-arm
cd oe-core/freescale-arm
git clone git://git.openembedded.org/openembedded-core oe-core
git clone git://github.com/Freescale/meta-fsl-arm.git
cd oe-core
git clone git://git.openembedded.org/meta-openembedded
git clone git://git.openembedded.org/bitbake bitbake

Set up environment

. ./oe-init-build-env

That puts us in a new sub-directory build and sets certain environment variables.

Edit configuration

Edit the conf/bblayers.conf and local.conf files:

conf/bblayers.conf should have the meta-fls-arm and meta-oe layers added for BBLAYERS. E.g.:

BBLAYERS ?= " \
  /home/craigm/oe-core/freescale-arm/oe-core/meta \
  /home/craigm/oe-core/freescale-arm/oe-core/meta-openembedded/meta-oe \
  ${TOPDIR}/../../meta-fsl-arm \
  "

In conf/local.conf, I set:

BB_NUMBER_THREADS = "4"
PARALLEL_MAKE = "-j 4"
MACHINE = "imx28evk"

Build

bitbake core-image-minimal

I ran this build overnight, and it has completed successfully for me. Output files were in ~/oe-core/freescale-arm/oe-core/build/tmp-eglibc/deploy/images.

There are two boot options that I'd like to try, as described below. Boot from SD card is simpler, but takes quite a long time (~30 min) to write the image to the SD card. Booting from TFTP + NFS is faster, but requires more set-up.

Boot from SD Card

Write image to SD card:

sudo dd if=tmp-eglibc/deploy/images/core-image-minimal-imx28evk.sdcard of=/dev/sdc

It took something like 30 minutes (3.5 GB file). Then I put it in the board's SD card slot 0, and powered-up. It got as far as loading the kernel, then stopped:

U-Boot 2012.04.01-00059-g4e6e824 (Aug 23 2012 - 18:08:54)

Freescale i.MX28 family at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
DRAM:  128 MiB
MMC:   MXS MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   FEC0, FEC1
Hit any key to stop autoboot:  0
reading boot.scr

** Unable to read "boot.scr" from mmc 0:2 **
reading uImage

2598200 bytes read
Booting from mmc ...
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-2.6.35.3-11.09.01+yocto-20
   Created:      2012-08-23   7:53:40 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2598136 Bytes = 2.5 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Boot from TFTP + NFS

First, I tried to write U-Boot onto an SD card:

sudo dd if=tmp-eglibc/deploy/images/u-boot-imx28evk.mxsboot-sdcard of=/dev/sdc

Then I put it in the board's SD card slot 0, and powered-up. But all I got in the debug serial port was:

0x8020a01d

So, I decided to use Freescale's distribution of U-Boot for i.MX28 (from their LTIB distribution) onto an SD card. I set suitable U-Boot parameters for NFS booting with parameters from DHCP.

setenv bootargs console=ttyAMA0,115200n8
setenv bootargs_nfs setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=,v3,tcp fec_mac=${ethaddr}
saveenv

I connected to a DD-WRT router with the following DNSmasq settings:

dhcp-boot=,,192.168.250.106
dhcp-option=17,"192.168.250.106:/home/craigm/rootfs"

On my host PC, I set up a TFTP server to serve the uImage file from ~/oe-core/freescale-arm/oe-core/build/tmp-eglibc/deploy/images/.

I also set up a root NFS server to serve the root file system. I edited /etc/exports to serve /home/craigm/rootfs. I extracted the root file system:

bitbake meta-ide-support
rm -Rf ~/rootfs
runqemu-extract-sdk tmp-eglibc/deploy/images/core-image-minimal-imx28evk.tar.bz2 ~/rootfs

Then I put the U-Boot SD card in the board's SD card slot 0, and powered-up. It got as far as this, then stopped:

...
TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
mxs-rtc mxs-rtc.0: setting system clock to 1970-01-01 00:03:33 UTC (213)
eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)
eth1: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1)
Sending DHCP requests .
PHY: 0:00 - Link is Up - 100/Full
., OK
IP-Config: Got DHCP answer from 192.168.250.106, my address is 192.168.250.142
IP-Config: Complete:
     device=eth0, addr=192.168.250.142, mask=255.255.255.0, gw=192.168.250.1,
     host=192.168.250.142, domain=, nis-domain=(none),
     bootserver=192.168.250.106, rootserver=192.168.250.106, rootpath=/home/craigm/rootfs
Looking up port of RPC 100003/3 on 192.168.250.106
Looking up port of RPC 100005/3 on 192.168.250.106
VFS: Mounted root (nfs filesystem) on device 0:15.
Freeing init memory: 160K

I'm not sure if it's running without a serial console, or some other problem. I can ping it on 192.168.250.142, but I can't Telnet or SSH to it.

Questions

  • Is there any sort of "getting started" guide for OpenEmbedded-Core on Freescale's i.MX28?
  • Is the Freescale ARM layer really intended for use with OpenEmbedded-Core, Yocto, or what? I don't really understand how those projects relate.
  • Has anyone else had success booting a minimal image of OpenEmbedded-Core on Freescale's i.MX28? If so, how did your procedure differ from mine?
  • I'm not sure at this stage whether the problem is just a non-functional serial console, or some other sort of issue. It's hard to diagnose these problems that prevent even getting a basic system running. Any pointers on how to diagnose at this point?
  • Why would the U-Boot be broken so it can't even boot?

解决方案

From the boot message it looks like U-boot is working fine. U-boot is not broken.

The following boot message

2598200 bytes read
Booting from mmc ...
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-2.6.35.3-11.09.01+yocto-20
   Created:      2012-08-23   7:53:40 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2598136 Bytes = 2.5 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

By the above log u-boot has done its job. "Booting the kernel" is the point where bootloader given the control to the kernel.

I guess the problem might be in kernel image or in memory.

To eliminate the problem of memory, try to check the manual and try to read and write in the RAM using the board's reference manual.

From the boot log RAM looks like has no problem. It has been initialized.

DRAM:  128 MiB

Check if the following message is not causing any problem. * Warning - bad CRC, using default environment

Check if all the devices have been initialized and nothing is skipped after the bad crc warning.

这篇关于无法在 Freescale i.MX28 上启动基本的 OpenEmbedded-Core的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆