Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

the time delay question in ATA_SubmitIdentify() function when initing ATA deriver

$
0
0

Hi, everyone:

I use the RTFS system to read and write SATA on the OMAP-L138 board. And I use bios_5_41_13_42, rtfs_1_10_02_32, pspdrivers_01_30_01.

 My code stuck in ATA_DrvInit() function while it is working fine with RTFS example. After debugging I found that it is stuck in ATA_SubmitIdentify() function.

In the ATA_SubmitIdentify() function, there are a section of codes:

       pReq -> Retry   = 10u;

       ATA_SubmitReq (pDevice, pReq);

       while (pReq -> Retry != 0)

       {

          //PAL_osWaitMsecs (1u);

              m_delay(1u);

              //pReq -> Retry--;

       }

And the m_delay function:

void m_delay( Uint32 msecDelay)

{

    volatile Uint32 i,j;

//  TSK_sleep(msecDelay);

    for(i=0; i<msecDelay; ++i)

           for(j=0; j<0x1fff; ++j); //TODO ???

}

If I run straightly, the program will enter infinite loop in the m_delay function. But if I abandoned the “//” before “pReq -> Retry--;”, and set a breakpoint before “while (pReq -> Retry != 0)”, the ATA_SubmitIdentify() function could go successfully and then ATA_driver could be Initialized successfully.

So how does the variable pReq -> Retry be changed? Could you please tell me why it is like this here and how I should configure here? 

Please help me. Thanks a lot!

Best wishes

Samantha


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>