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.

bootloader from 64Mbyte SD card.

Hi,

I want to run the "bootloader"of AM335x Starterware from 64Mbyte SD card.

RBL works fine! MLO is copied correctly by RBL.
The MLO then copies application image (app) from the SD card.
And then, it can't seems to recognize as "app" file on SD card.

However, if sd card is large size , it works well. for example 1G SD card.
32M , 64M and 128M SD Cards does not  work.

Does anyone know that?
I wonder why RBL works well.........

Best Regards,
-Taka

  • I think this is a limitation of the FatFS implementation that comes with Starterware and that is REALLY old. In this version the maximum number of blocks is limited to 64 million. Starting wiht FatFS 0.7a this value is increased to 131072000.

  • Thank you for the your post.
    I changed a Fatfs in starterware to ver0.10a and I tried doing it. But It didn't work.
     
    I analyzed this problem. At first, when AM335x sent CMD6 command to SDCard in MMCSDTranSpeedSet(),  the return value was 0 (FALSE).
    So, After I commented out  MMCSDTranSpeedSet() function calling from disk_initialize(),  It worked well with 32Mbyte SD card!!!

    And then  I checked the SDIO specification and understood that SD ver1.00 is not supported CMD6.
    Also, Our 32/64/128Mbyte SD card were ver 1.00.

    So, it must be changed as bellow if anyone want to support the SD cards ver 1.00 in starterware.

    unsigned int MMCSDTranSpeedSet(mmcsdCtrlInfo *ctrl)
    {
        mmcsdCardInfo *card = ctrl->card;
        unsigned int speed;
        int status;
        unsigned int cmdStatus = 0;
        mmcsdCmd cmd;

        if (card->sd_ver == 0)
        {
            return 0;
       }

        ctrl->xferSetup(ctrl, 1, dataBuffer, 64, 1);

        cmd.idx = SD_CMD(6);
        cmd.arg = ((SD_SWITCH_MODE & SD_CMD6_GRP1_SEL) | (SD_CMD6_GRP1_HS));
        cmd.flags = SD_CMDRSP_READ | SD_CMDRSP_DATA;
        cmd.nblks = 1;
        cmd.data = (signed char*)dataBuffer;






    Best Regards,
    -Taka
  • Hm, shouldn't this function return 1 in case of sd_ver==0? Elsewhere it fails in same way like it would when the unsupported command is used.

    And may be you are willing to provide your FatFS v0.10 including Sitara-specific changes here? People could be interested in updating to some more recent version (I'm still using v0.7, so don't have the latest version too to publish it).

  • Hans M��ller said:

    Hm, shouldn't this function return 1 in case of sd_ver==0? Elsewhere it fails in same way like it would when the unsupported command is used.

    disk_initialize() that is calling MMCSDTranSpeedSet don't check the return value.
    Any command didn't not work after AM335x sent the COM6 command to  ver1.00 SD card.

    Hans M��ller said:

    And may be you are willing to provide your FatFS v0.10 including Sitara-specific changes here? People could be interested in updating to some more recent version (I'm still using v0.7, so don't have the latest version too to publish it).

    I have changed three places for v0.10.
     [bl_hsmmcsd.c]
          -     f_mount(driveNum, &g_sFatFs); =>   f_mount(&g_sFatFs, "", 0);
         -     DRESULT disk_read ( ------------ BYTE count) {   =>  DRESULT disk_read ( ------------ UINT count)
         -     DRESULT disk_write( ------------ BYTE count) {   =>  DRESULT disk_write( ------------ UINT count)

    Best Regards,
    -Taka