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.

OMAPL138 SATA how the pReq -> Retry changed after ATA_SubmitIdentify() function

Other Parts Discussed in Thread: OMAPL138

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.

When I do the ATA_DrvInit() , I stucked in the ATA_SubmitIdentify() function:

pReq -> Retry   = 10u;

ATA_SubmitReq (pDevice, pReq);

while (pReq -> Retry != 0)

{

      //PAL_osWaitMsecs (1u);

      m_delay(1u);

      //pReq -> Retry--;

}

I find other codes alike in the ata.c, as following:

static Int32 ATA_MaxLba (ATA_Drive_t *pDevice) 
{ 
  ATA_Dev_Req_t *pReq = NULL; 
  ATA_Dev_Stat_t Status; 
  Int32 retVal = ATA_ERR_GEN; 
 
  if(NULL != pDevice) 
  { 
        retVal = ATA_NO_ERR; 
      pReq = ATA_AllocReq (pDevice, False); 
      if (pReq != NULL) 
      { 
        pReq -> MediaHandle = NULL; 
        pReq -> IsInternal  = True; 
        pReq -> Command . Device = pDevice -> Dev; 
        pReq -> Command . Cmd = ATA_READ_MAX_SECT; 
        pReq -> Buffer = NULL; 
        pReq -> Mode = TASKFILE; 
        pReq -> Res . IsEvent = False; 
        pReq -> Handler = &ATA_IdentHndlr; 
        pReq -> ToHndlr = &ATA_IdentHndlr; 
        pReq -> Timeout = ATA_ONESEC_TO; 
        pReq -> Retry   = 10u; 
 
        ATA_SubmitReq (pDevice, pReq); 
 
        while (pReq -> Retry != 0) 
        { 
          m_delay(1u); 
        } 
 
        Status = pReq->Status; 

So how the value of pReq -> Retry changed? 

  • Hi,

    We are working on this and we will let you know at the earliest.

    Thanks & regards,
    Sivaraj K
  • Dear Samantha,
    Sorry for the delayed response on this.
    Which board are you using (custom or EVM) ?

    Just I've executed the SATA spin loop test on OMAPL138 LCDK board.
    So no more much expertise on this.

    Can you please try the code which is attached in the following e2e post ?
    e2e.ti.com/.../293058

    Let me try this example on OMAPL138 LCDK board and update you.
  • Dear Titus S,
    First of all, thanks for your reply.
    My board is OMAPL138-KB-EZ, So does the RTFS example work with it?
    That author runned successfully using RTFS example in EVM omapl138. Then he used PSP_blkmediaDrvIoctl((Ptr)&device, &drvIoctlInfo) to register. But I referred the datasheet BIOSPSP_SATA_Driver_Design, there are no information of IOCTL command.
    So does the IOCTL register function work witn sata? If I can do RAW read/write to SATA referring to NAND raw sample application example? I am confused because I prefer doing read/write to sata without RTFS system.
    I will appreciate it if you can reply another. Thanks.
    Regards
    Samantha
  • Dear Titus S,

    i know my board is not belonging to TI, and it is ICETEK OMAPL138-KB.
    If I want to use the sata rtfs examples, where I need to modify in detail? That is, if using the example in other board, where should be changed?
    I am eager to your reply. Thanks for your help. Bests wishes!

    Regards

    Samantha

  • Dear Samantha,
    Sorry for the delayed response on this.
    Which RTFS example are you running ?
    Can you please point out the example what you are using now ?
    Can you attach here the complete CCS project ?
    Let me try it on EVM board and will see any timing issues...
  • Dear Titus S. 

    I use sata example with the rtfs_1_10_02_32. I just downloaded the packed rtfs_1_10_02_32 from net and extracted it to ti file. This is the route of sata example: D:\ti\rtfs_1_10_02_32\packages\ti\rtfs\examples\sata\bios5\evm6748.

    I add my project fasata as a packed file.

    Thanks for your help sincerely. Best wishes!

    Regards

    Samantha

    fasata.rar

  • I'm able to build your SATA example after fixed so many dependencies on my PC setup.
    Finally, I'm getting the following logs in CCS console.

    [C674X_0] ATA Hard Drive Application Task 0 Starting.
    Configured ATA drive.
    Block Driver Initialization Succeeded
    Error getting drive ID.

    Can you post your CCS console logs ?
  • Dear Titus S. 

    First of all, thanks for your altruistic help.

    My log in CCS console:

    ATA Hard Drive Application Task 0 Starting.

    Configured ATA drive.

    Block Driver Initialization Succeeded.

    Get drive ID DONE. A

    But the program runned fly in the later clearPartition(driveId_1).

    Actually, the ATA_DrvInit() failed, because the return value of inside function:

            Err = ATA_MED_Register (&DevIdent[DevNum], &ATA_DevCallBack0,

                                  &(ATA_DrvInfo [DevNum] . pIntOps),

                                  &(ATA_DrvInfo [DevNum] . Handle));

    Where Err=-1.

    This is the key to my problem.

    Regards

    Samantha

     

  • Dear Samantha,

    I'm also exactly getting the same problem with your project.

    But I'm able to succeed with the actual code from "C:\ti\rtfs_1_10_02_32\packages\ti\rtfs\examples\sata\bios5\evm6748"

    I've attached the .out which I'd built, can you please try and let me know the status.

    sata_out.zip

    [C674X_0] ATA Hard Drive Application Task 0 Starting.

    Configured ATA drive.

    Version : 0001.0100

    NumOfCmdSlots : 32

    NumOfPorts : 1

    Speed : 3 Gbps

    SATA:AHCI-CAP:SNCQ SSNTF SLAP SAL SCLO SAM SPM PMD SSC PSC

    Block Driver Initialization Succeeded

    ATA Build: Debug.

    SATA PHY initialized : online

    Get drive ID DONE. A:

    Clear partition DONE

    This many cylinders: 524287

    This many  sectors : 268434944

    This many cylinders in first partition 200

    This many  sectors  in first partition 102400

    This many cylinders in second partition 524087

    This many  sectors  in second partition 268332544

  • Dear Titus S. 

    Thanks  for your help sincerely.

    I tried the sata.out, and this is the log  in CCS console:

    [C674X_0] ATA Hard Drive Application Task 0 Starting.

    [C674X_0] Configured ATA drive.

    [C674X_0] Version : 0001.0100

    [C674X_0] NumOfCmdSlots : 32

    [C674X_0] NumOfPorts : 1

    [C674X_0] Speed : 3 Gbps

    [C674X_0] SATA:AHCI-CAP:SNCQ SSNTF SLAP SAL SCLO SAM SPM PMD SSC PSC

    [C674X_0] Block Driver Initialization Succeeded

    [C674X_0] ATA Build: Debug.

    [C674X_0] SATA PHY Not initialized : offline

    [C674X_0] Check for SATA cable connected properly

    [C674X_0] Error getting drive ID.

    It seems that it failed. Maybe my files are not in the same place with you,  is it for this reson?

    Which board are you using ( EVM or LCDK)? And which edition of CCS do you use? Mine is CCSv5.1. But the example has just CCS3 and CCS4. My project sent to you before is just transfered from the CCS4, so why didn't it work?

    I am looking forward to your reply. Best wishes!

    =========================================================================================================================


    Regards

    Samantha

  • Hi Samantha,

    Which board are you using ( EVM or LCDK)? And which edition of CCS do you use? Mine is CCSv5.1. But the example has just CCS3 and CCS4. My project sent to you before is just transfered from the CCS4, so why didn't it work?

    I'm testing on OMAPL138 LCDK board (running this example on DSP core) and CCS version is 5.5


    It seems that it failed. Maybe my files are not in the same place with you, is it for this reson?

    No.It won't be.

    I just import the following project and resolved all the build issues and run the project.
    C:\ti\rtfs_1_10_02_32\packages\ti\rtfs\examples\sata\bios5\evm6748\ccs4

    Have you modified the example ?
    Have you tried the above I mentioned example (without any modification) ?
  • Dear Titus S,

    Thanks a lot for your reply sincerely.

    Following your advice, I just import the project without any modification, but it failed and ran fly. This is the log:

    [C674X_0] ATA Hard Drive Application Task 0 Starting.

    [C674X_0] Configured ATA drive.

    [C674X_0] Block Driver Initialization Succeeded

    [C674X_0] ATA Build: Debug.

    If I clicked the pause button, it stopped at here. It seems to be the same old problem.

    Besides, I have a question: if I don’t define BIOS_PWRM_ENABLE, it errors when I complied the project. So I added .h file, and this is its content:

    #define BIOSATA_PSC_ENABLE

    #define BIOS_PWRM_ENABLE

    #define CHIP_OMAPL138

    #define ATA_ATAPI_SUPPORT

    #define PSP_BLK_EDMA_MEMCPY_IO      //PSP_BLK_EDMA_MEMCPY_ASYNC

    So am I wrong? If I cancled the .h, it errored. So what should I do exactly?

    I am looking forwards to your reply. Best wishes!

    Regards

    Samantha


  • Besides, I have a question: if I don’t define BIOS_PWRM_ENABLE, it errors when I complied the project. So I added .h file, and this is its content:
    #define BIOSATA_PSC_ENABLE
    #define BIOS_PWRM_ENABLE
    #define CHIP_OMAPL138
    #define ATA_ATAPI_SUPPORT
    #define PSP_BLK_EDMA_MEMCPY_IO //PSP_BLK_EDMA_MEMCPY_ASYNC

    So am I wrong? If I cancled the .h, it errored. So what should I do exactly?

    I've not enabled anything.
    In your "fsata" project,I also defined "BIOS_PWRM_ENABLE" to solve the build problem but not with this actual project.
  • Dear Titus S,

    Thanks a lot for your help. You really helped me for my problem was solved.

    I deleted all define I made and it succeeded. Maybe there are something that do not support at CCS5 project. This is the key. So I choose the CCS4.

    Say thank you again heartly,  Titus S.  

    Best wishes to you all life.

    Regards

    Samantha

  • Dear Samantha,
    Superb. Glad to hear that you able to solve the problem.
    Thanks for your update.
  • I have encountered the same problem as you do you solve it? Look forward to your reply
  • What problem are you getting ?
    Actually you no need to change anything, just I build the project and run, got the expected results.
    What you have done ?
    Please create a new post for further follow up, there mention what you have done and error information etc.,
  • Hello Titus S

    I have solved my problem!

     Thanks!

  • Oh. Sounds good.
    Thanks for the update.
    Could you please tell us what you have done to fix this problem, it would be helpful to others who may face such as problem in future.
    Thank you.
  • Confirm SATA Input Clk, ,it's important to confirm SATA PLL CLK=1.5GHz.
    For example, Input CLK=75Mhz, Clock Multiplier Factor set 20 ,//75*20=1500Mhz=1.5Ghz;
    For example,the TI board Clk is 100Mhz, Clock Multiplier Factor set 15,//15*100=1500Mhz;
    According to your board set The Clock Multiplier Factor;
    otherwise, The SATA Initialization will falied!!!
  • Thank you for sharing the solution.
    Your help is very much appreciated.