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.

SD卡启动初始化失败

各位大神好!

      我在调试AM335X starterware 通过SD卡启动程序时,出现sd卡mount失败,

具体错误出在如下函数位置:third_party\fatfs\port\fat_mmcsd.c文件disk_initialize函数中调用status = MMCSDCardInit(card->ctrl);

被调用的函数是libmmcsd.lib中的函数,我通过debug方式,单步运行到status = MMCSDCardInit(card->ctrl);时

debug信息提示:Break at address "0x4030ce10" with no debug information available, or outside of program code.

在通过将boot_ti.bin重命名为MLO,考入到sd卡进行启动时,可以确认boot已经启动,但是在从sd卡复制app过程中,

对sd卡进行初始化出现卡死,导致程序无法运行。

请问这个问题,我该从哪入手分析,或者哪位大神有解决办法?

  • 您是按照以下链接描述的步骤操作的吗?插入sd卡之后有什么打印信息?
    processors.wiki.ti.com/.../AM335X_StarterWare_Booting_And_Flashing
  • 是的,我是按照文档中的介绍进行SD卡制作,
    插入sd卡后有如下信息:
    HALaser Systems AM335x bootloader
    BlPlatformMMCSDSetup
    SD Card found
    MMCSDCtrlInit
    MMCSDIntEnable
    begin HSMMCSDFsMount,drive num = 0
    1111111111 LD2PD(vol) 0
    Start MMCSDCardInit

    后面5行log是我自己加的。
    当执行到
    DSTATUS
    disk_initialize(
    BYTE bValue) /* Physical drive number (0) */
    {
    unsigned int status = 0;

    if (DRIVE_NUM_MAX <= bValue)
    {
    return STA_NODISK;
    }

    if ((DRIVE_NUM_MMCSD == bValue) && (fat_devices[bValue].initDone != 1))
    {
    mmcsdCardInfo *card = (mmcsdCardInfo *) fat_devices[bValue].dev;
    UARTprintf("Start MMCSDCardInit \r\n");
    /* SD Card init */
    status = MMCSDCardInit(card->ctrl);


    这段代码后,发现程序不再继续运行了。
    单步调试,想要进入 MMCSDCardInit(card->ctrl);这个函数
    调试时出现了这个提示:Break at address "0x4030ce10" with no debug information available, or outside of program code

    我感觉就是进不去MMCSDCardInit这个函数
  • 从打印信息来看应该还没有成功执行MLO,卡在sd卡初始化的地方,感觉有可能是sd卡有问题。看一下TRM上对这部分的要求。
    Each interface has booting restrictions on which type of memory it supports: -
    • MMC0 supports booting from the MMC/SD card cage and also supports booting from eMMC/eSD/managed NAND memory devices with less than 4GB capacity.
    • MMC1 supports booting from eMMC/eSD/managed NAND memory device with 4GB capacity or greater