This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335X u-boot.img从SPI FLASH启动不成功



我把MLO.spi和u-boot.img分别烧写到SPI FLASH的0x0和0x20000,然后设置从SPI启动。结果出现了如下的提示信息,一直卡在这里:

U-Boot SPL 2011.09 (Mar 19 2013 - 15:02:01)
Texas Instruments Revision detection unimplemented
Could not probe the EEPROM; something fundamentally wrong on the I2C bus.
read_eeprom() failure. continuing with ddr3
No daughter card present
Did not find a recognized configuration, assuming General purpose EVM in Profile 0 with Daughter board
SF: Detected W25Q64 with page size 4 KiB, total 8 MiB

我跟进去,找到了函数:spi_boot,然后打印出在内存CONFIG_SYS_TEXT_BASE的内容,和u-boot.img的内容是完全一样的,可是u-boot.img为什么就没有被执行呢?(注:我使用的是自己做的板子,用这个u-boot.img放到SD卡中,是可以被正常执行的)

void spi_boot(void)
{
struct spi_flash *flash;
void (*uboot)(void) __noreturn;

/*
* Load U-Boot image from SPI flash into RAM
*/

flash = spi_flash_probe(CONFIG_SPL_SPI_BUS, CONFIG_SPL_SPI_CS,
CONFIG_SF_DEFAULT_SPEED, SPI_MODE_3);
if (!flash) {
puts("failed.\n");
hang();
}

spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS,
CONFIG_SYS_SPI_U_BOOT_SIZE,
(void *) CONFIG_SYS_TEXT_BASE);

/*
* Jump to U-Boot image
*/
uboot = (void *) CONFIG_SYS_TEXT_BASE;
(*uboot)();

}

  • eeprom那部分代码都去掉了么?

  • 根据你的log信息,ms没有去掉EEPROM。

    read_eeprom() failure. continuing with ddr3

    你可以在board/ti/arm335x/evm.c中的board_init()函数中去掉EEPROM的相关操作。

  • 我现在去掉了EEPROM的相关操作了,还是一样的。而且我感觉跟EEPROM没什么关系。程序运行到函数:(*uboot)(),也就是u-boot.img,就过不去了。但是当我make am335x_evm产生的MLO和make am335x_evm_spiboot产生的u-boot.img 一起放到MMC卡,这时候可以正常启动,进入到u-boot命令行:

    U-Boot SPL 2011.09 (Mar 19 2013 - 10:08:40)
    Texas Instruments Revision detection unimplemented
    Could not probe the EEPROM; something fundamentally wrong on the I2C bus.
    read_eeprom() failure. continuing with ddr3
    No daughter card present
    Did not find a recognized configuration, assuming General purpose EVM in Profile 0 with Daughter board
    OMAP SD/MMC: 0
    reading u-boot.img

    U-Boot 2011.09 (Mar 20 2013 - 10:01:42)

    I2C: ready
    DRAM: 256 MiB
    WARNING: Caches not enabled
    NAND: HW ECC Hamming Code selected
    No NAND device found!!!
    0 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    SF: Detected W25Q64 with page size 4 KiB, total 8 MiB
    *** Warning - bad CRC, using default environment

    Net: cpsw
    Hit any key to stop autoboot: 0
    U-Boot#

    这样的话,应该能表明u-boot.img也没错啊,可是为什么从SPI FLASH读出来后没能正常执行呢?

  • uboot 烧写的地址对么?

  • 对的,我打印出来uboot=0x80100000,和Am335x_evm.h里面定义的是一样的。而且我在执行(*uboot)()函数前,把内存起始地址为0x80100000的内容给打印出来,跟下载到SPI FLASH的u-boot.img比较,内容也是完全一样的。

  • 您好,我看了您之前的帖子,您之前没有发现spi 

    SF: Unsupported manufacturer ff
    Failed to initialize SPI flash at 0:0

    ,现在我看您的信息已经发现了SF: Detected W25Q64 with page size 4 KiB, total 8 MiB,您做了什么处理?请指教,我的QQ:348566267

  • 将EVM 的PROFILE开关2设置为ON,其余设置为OFF

    同时需要重新编译u-boot,

     

    重新编译MLO和u-boot:
     make O=am335x CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm am335x_evm_spiboot
    生成 MLO.byteswap和u-boot.img
     
     
  • 我也出现了上述现象,一直卡在这里

    U-Boot SPL 2011.09 (Apr 16 2013 - 17:09:41)
    Texas Instruments Revision detection unimplemented
    No daughter card present
    Did not find a recognized configuration, assuming General purpose EVM in Profile
    0 with Daughter board
    SF: Detected W25Q64 with page size 4 KiB, total 8 MiB

    请问楼主解决了吗?跪求解决啊 

  • 你好,启动方式我是选择对的了。而且我也是用make O=am335x CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm am335x_evm_spiboot 这条命令去生成对应的文件,不过我生成的文件是:MLO.spi和u-boot.img,并没有你说的MLO.byteswap,烧写到SPI  FLASH对应的位置是0x0,0x20000

  • 解决方法在sitara-linuxsdk-sdg-05.05.00.00.pdf找到了:

    U-Boot# sf probe 0
    U-Boot# sf erase 0 +80000
    U-Boot# mmc rescan
    U-Boot# fatload mmc 0 ${loadaddr} MLO.spi
    U-Boot# sf write ${loadaddr} 0 ${filesize}
    U-Boot# fatload mmc 0 ${loadaddr} u-boot.bin
    U-Boot# sf write ${loadaddr} 0x20000 ${filesize}

    我应当使用u-boot.bin而不是u-boot.img。

  • 我也解决了  方法和你的一样  但是现在网络不能用   您的网络能用吗  Lee Jiejia

  • 可以用啊,网络那一部分的内容我什么也没改。不过IP得两边都设置为同一网段。 请问你的kernel也能成功加载了吗?

  • 你的是什么开发板    我的QQ是348566267     加我  我们QQ聊

  • 想请问一下,从SPI FLASH启动时,uboot的启动参数要怎么设置,设置完成后要怎么保存到SPI FLASH中去。

    已经找到了相关资料:http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot#SPI_Flash。至于变量的保存,只需要在u-boot 命令行下输入saveenv即可。

  • 你好 我正在做 spi flash 启动 我们的 spi flash 换成了 W25Q128 情况和你一样 也还是运行到 SF: Detected W25Q128 with page size 4 KiB, total 16 MiB 就停止了,我想问一下怎么 打印出在内存CONFIG_SYS_TEXT_BASE的内容,和 u-boot.img  的内容啊!! qq 296380219

  • 最近我也在搞这个spi启动uboot,目前遇到sd卡启动下发送sf probe 0,不能识别flash的情况,我的uboot版本是2011.09(英蓓特的版本),跟你的版本是一样的,我修改了evm.c中的通用版管脚设置,修改了am335x_evm.h 中对应的板子上的flash型号的定义,编译后总是出现 sf: unsupport manufacture 0,看到你已经解决了,麻烦问问是怎么解决的,我的qq:20112000,请赐教

  • 已解决,硬件问题

  • Hi Gary,

          你好。

        我在BeagleBone Black板子上Mount一个W25Q64,通过修改Uboot代码,配置SPI0,将I2C1的Mux配置代码注释掉了。将U-boot配置成AM335x_evm_spiboot再重新编译 ,生成了MLO和uboot.img文件,没有MLO.byteswap文件。copy到SD卡里,将S2强制接地(boot引脚为11000),然后上电,从串口输出了字符发现了SPI DataFlash,然后我按如下命令烧录,再重新上电,串口什么信息也没有输出。我用的是arm-rtems4.11-gcc, 内核是RTEMS 4.11操作系统,不是Linux.

    如下是我的LOG,请赐教。

     

    U-Boot# mmc rescan
    U-Boot# sf probe 0
    SF: Detected W25Q64CV with page size 256 Bytes, erase size 4 KiB, total 8 MiB
    U-Boot# sf erase 0 +80000
    SF: 524288 bytes @ 0x0 Erased: OK
    U-Boot# fatload mmc 0 ${loadaddr} MLO
    reading MLO
    76548 bytes read in 8 ms (9.1 MiB/s)
    U-Boot# sf write ${loadaddr} 0 ${filesize}
    SF: 76548 bytes @ 0x0 Written: OK
    U-Boot# fatload mmc 0 ${loadaddr} u-boot.img
    reading u-boot.img
    341928 bytes read in 23 ms (14.2 MiB/s)
    U-Boot# sf write ${loadaddr} 0x20000 ${filesize}
    SF: 341928 bytes @ 0x20000 Written: OK
    U-Boot# sf erase 80000 +${spiimgsize}
    SF: 3604480 bytes @ 0x80000 Erased: OK
    U-Boot# fatload mmc 0 ${loadaddr} rtems-app.img
    reading rtems-app.img
    60295 bytes read in 9 ms (6.4 MiB/s)
    U-Boot# sf write ${loadaddr} ${spisrcaddr} ${filesize}
    SF: 60295 bytes @ 0xe0000 Written: OK
    U-Boot# run spiboot
    Booting from spi ...
    SF: Detected W25Q64CV with page size 256 Bytes, erase size 4 KiB, total 8 MiB
    SPI RXS timed out, status=0x00000007
    SF: 3547136 bytes @ 0xe0000 Read: ERROR
    Bad Linux ARM zImage magic!
    U-Boot#

  • Hi Lee, 我也没有生成 MLO.spi, 只有MLO,请问你的uboot.img怎样转换成uboot.bin的?我的uboot配置是am335x_evm_spiboot