• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » WinCE » WinCE forum » back to back uSD card file reads
Share
WinCE
  • Forum
Options
  • Subscribe via RSS

back to back uSD card file reads

back to back uSD card file reads

This question is answered
MPope
Posted by MPope
on Jun 18 2010 13:35 PM
Intellectual345 points

Hi All,

I'm having a problem in eboot (CE6) reading nk.bin after reading another configuration file.

Is there something that needs to be reset or done to the mmc/sd interface to do additional reads?

Should I not use the BLSDDownload function? If not what should I use? What is the sequence?

This is my serial output:

1st file (cfg file):

BLSDDwnld: FN: fpga.xsv
SDCardDet: 1
MMCIssueIdentify: SD card detected
reported block size = 512
Card size is = 1939456 512 byte sectors
max clock freq = 25000000
done.
  Directory Entry #2: <MLO         >
  Directory Entry #4: <FTPD     TMP>
  Directory Entry #7: <DATAIN~1 XML>
  Directory Entry #16: <EBOOTS~1 NAN>
Next directory sector 481, file data area start 512
  Directory Entry #17: <EBOOTSD  NB0>
  Directory Entry #18: <NK       BIN>
  Directory Entry #26: <FPGA     XSV> Found file, starting cluster = 427, file size = 72418
File Read/Cpy: 0x00007643

2nd file (os image):

BootDevice(4)
BootDevLoc(4809c000)
BLSDDwnld: FN: nk.bin
SDCardDet: 1
MMC Stat: 00018000
SDHC: command response timeout CTO!
MMC::MMCCommandResponse: MMCSendCommand error, command = 55
MMC::MMCCommandResponse: Command Response Error
MMC Stat: 00018000
SDHC: command response timeout CTO!
MMC::MMCCommandResponse: MMCSendCommand error, command = 1
MMC::MMCCommandResponse: Command Response Error
MMCIssueIdentify: busy bit never deactivated -- probably no card, ocr = 0x0
SDCardInit: No media found!
failed

If anyone can shed some light on this, that would be great - I'm stumped.

Matt

WINCE BOOT SD Card sd mmc
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Jatin Jain
    Posted by Jatin Jain
    on Jul 06 2010 15:25 PM
    Suggested Answer
    Expert7250 points

    The problem is probably due to the SDHC/SD memory/FATFS subsystem in the bootloader only being designed for one shot use (in the XLDR it loads EBOOTSD.NB0 and then EBOOTSD loads NK.BIN).  Changing EBOOT code to load other files from the SD card is not a normal feature of the bootloader and needs extra work. 

    The new work would be to create a function that would reinitialize the bootloader SDHC/SD memory/FATFS to make it ready for accessing another file. 

    ---

    WINCE BSP EBOOT OMAP35x
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Adeneo Embedded support team
    Posted by Adeneo Embedded support team
    on Jul 09 2010 07:03 AM
    Verified Answer
    Verified by Jatin Jain
    Genius5285 points

    Actually you should be able to read many files from the SDCard in the bootloader, even though the FAT implementation in EBOOT is not complete. The trick is to call the function "FileIoInit()" only once, then call the function "FileIoOpen()" for each file you want to open. Calling "FileIoInit()"  twice yields to the SDCard bootloader driver getting stuck.

     

    Remember to keep the handle returned by "FileIoOpen()" if you want to access the same file later on because there is no way of closing an opened file.

    Adeneo Embedded Support team
    Contact us at sales@adeneo-embedded.com

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • MPope
    Posted by MPope
    on Jul 09 2010 09:59 AM
    Intellectual345 points

    I'll have a try at that and see what happens.

    Sounds like a good chance of working for what I need - as I only need two files, at the moment.

    Thanks all for the suggestions

    Matt

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • MPope
    Posted by MPope
    on Aug 20 2010 18:13 PM
    Intellectual345 points

    Sorry it's taken me a while to get back to this - other fires.

    So I've done my best to try the 1x only FileIoInit:

    This is what I get:

    ****************** FileIoInit 1x **************************

     

    BootDevice(4)

    BootDevLoc(4809c000)

    BLSDDwnld: FN: nk.bin

    FN2DIR

    F-OPEN

    MMC Stat: 00018000

    SDHC: command response timeout CTO!

    MMC::MMCCommandResponse: MMCSendCommand error, command = 13

    MMC::MMCCommandResponse: Command Response Error

    read error

    MMC Stat: 00018000

    SDHC: command response timeout CTO!

    MMC::MMCCommandResponse: MMCSendCommand error, command = 7

    MMC::MMCCommandResponse: Command Response Error

    SDCardReadSector: Error reading file, retry (sector 543)

    MMC Stat: 00018000

    SDHC: command response timeout CTO!

    MMC::MMCCommandResponse: MMCSendCommand error, command = 13

    MMC::MMCCommandResponse: Command Response Error

    read error

    MMC Stat: 00018000

    SDHC: command response timeout CTO!

    MMC::MMCCommandResponse: MMCSendCommand error, command = 7

    MMC::MMCCommandResponse: Command Response Error

    SDCardReadSector: Error reading file, retry (sector 543)

    MMC Stat: 00018000

    SDHC: command response timeout CTO!

    MMC::MMCCommandResponse: MMCSendCommand error, command = 13

    MMC::MMCCommandResponse: Command Response Error

    read error

    MMC Stat: 00018000

    SDHC: command response timeout CTO!

    MMC::MMCCommandResponse: MMCSendCommand error, command = 7

    MMC::MMCCommandResponse: Command Response Error

    SDCardReadSector: Error reading file! (sector 543)

    BOOTLOADER: read_sector 543 (DIR) failed

    BLSDCardDownload:  cannot open file

     

     

    When I leave the FileIoInit in so it does it twice - I get different results:

    ****************** FileIoInit 2x **************************

     

    BootDevice(4)

    BootDevLoc(4809c000)

    BLSDDwnld: FN: nk.bin

    FileIOInit: ***

    SDCardDet: 1

    MMC Stat: 00018000

    SDHC: command response timeout CTO!

    MMC::MMCCommandResponse: MMCSendCommand error, command = 55

    MMC::MMCCommandResponse: Command Response Error

    MMC Stat: 00018000

    SDHC: command response timeout CTO!

    MMC::MMCCommandResponse: MMCSendCommand error, command = 1

    MMC::MMCCommandResponse: Command Response Error

    MMCIssueIdentify: busy bit never deactivated -- probably no card, ocr = 0x0

    SDCardInit: No media found!

    *** FIO-failed

     

    Here's the previous read's output:

     

    BLSDDwnld: FN: fpga.xsv

    FileIOInit: ***

    SDCardDet: 1

    MMCIssueIdentify:

    GO_IDLE_STATE1

    GO_IDLE_STATE2

    SD_SEND_IF_COND

    APP_CMD

    SD_SEND_OP_CODE

    APP_CMD

    SD_SEND_OP_CODE

    MMCIssueIdentify-: SD card detected

    found card

    reported block size = 1024

    Card size is = 3842048 512 byte sectors

    max clock freq = 25000000

    *** FIO-done.

    FN2DIR

    F-OPEN

      Directory Entry #2: <MLO         >

      Directory Entry #3: <EBOOTSD  NB0>

      Directory Entry #4: <FPGA     XSV> Found file, starting cluster = 50, file size = 72418

    F-Open: done

     

    So in either case it appears to leave the card in a state where it is unresponsive.

    The 1x attempt - gets send_status & select/deselect cmd errors

    The 2x attempt - gets app cmd errors

     

    Not sure which is worse - but neither of them seem to work - so I'm suspecting some other cleanup needs to be done.

    I just don't have any idea what that is. I'm at a loss here.

    Hopefully someone out there has made this work and can help me out/point me in the right direction.

     

    Thanks,

    Matt

     

    WINCE EBOOT 3530 SD Card
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • MPope
    Posted by MPope
    on Aug 23 2010 15:58 PM
    Intellectual345 points

    OK - you guys may color me daft.

    I was going back through my code and I found that I left in some test code that did a reset of the SD controller.

    Once I took this out - the 1x - FileIoInit method worked.

    I give much praise and thanks to that suggestion as it worked as advertised.

    Thank you all very much - your suggestions and feedback has been greatly appreciated.

    Matt

     

    WINCE EBOOT 3530 SD Card
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • MPope
    Posted by MPope
    on Aug 23 2010 16:02 PM
    Intellectual345 points

    Here's the result:

    [1st file load]

    BLSDDwnld: FN: fpga.xsv

    FileIOInit: ***

    SDCardDet: 1

    MMCIssueIdentify:

    GO_IDLE_STATE1

    GO_IDLE_STATE2

    SD_SEND_IF_COND

    APP_CMD

    SD_SEND_OP_CODE

    APP_CMD

    SD_SEND_OP_CODE

    MMCIssueIdentify-: SD card detected

    found card

    reported block size = 1024

    Card size is = 3842048 512 byte sectors

    max clock freq = 25000000

    *** FIO-done.

    FN2DIR

    F-OPEN

      Directory Entry #2: <MLO         >

      Directory Entry #3: <EBOOTSD  NB0>

      Directory Entry #4: <FPGA     XSV> Found file, starting cluster = 50, file size = 72418

    F-Open: done

    ...

    [2nd file load -nk.bin]

    BLSDDwnld: FN: nk.bin

    SKIP FileIOInit

    FN2DIR

    F-OPEN

      Directory Entry #2: <MLO         >

      Directory Entry #3: <EBOOTSD  NB0>

      Directory Entry #4: <FPGA     XSV>

      Directory Entry #5: <NK       BIN> Found file, starting cluster = c3, file size = FF58A3

    F-Open: done

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use