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.

use RTFS on OMAPL138, SATA example

Other Parts Discussed in Thread: OMAPL138

 I use the sata example in the rtfs_1_10_02_32\packages\ti\rtfs\examples\sata\bios5. I uue bios_5_41_13_42, rtfs_1_10_02_32, pspdrivers_01_30_01. When I load it  the program run fly. And when I stoped it, there appears an red error:

No source available for "PMI_writeI2C(unsigned int, unsigned int, unsigned int) at 0xc03ff0b0"

So could anybody tell me why? Or if you have similar examples?

Please help me, and thanks a lot!

  • Samantha,

    Can you please clarify “When I load it  the program run fly”?  Is the program running OK?

    The “No source available…” message from CCS indicates that the debugger cannot find the source file corresponding to the function where the CPU halted.  This is not an application error.  But just CCS saying that it doesn’t know the path to the file with the function.  When this happens you can point CCS to the file by clicking on the “Locate File…” button, and then navigating to the directory that has the source file.  For that PMI function, you should go to this directory: …\bios_5_41_13_42\packages\ti\pmi\src\pmi

    Regards,
    Scott

  • Dear Scott,

    first of all, thanks a lot for your reply!

    As your suggestion, I found PMI_writeI2C function in pmi_i2c.c file so I added it to my project. But when I load the project, the program runs fly, that is , it did not get into my program,  and if I click the pause button it stopped in a sentence of  pmi_i2c.c, just like the picture below. Though I set the breakpoint in the main function, it could not get into the main function.

    I followed the sata example in ti\rtfs\examples\sata\bios5\evm6748, and I just revised the library file route to the omapl138 then use it on the OMAPL138 board.

    I am new with rtfs system and I am very confused. Do I neen to configure something about RTFS or others?

    I will appreciate it if you apply me another time. Thank  you very much, Scott!

    Regards,

    Samantha

  • Hi Samantha,

    Thanks for the additional details.

    What board are you running this on?  Is this a custom board?  

    Some background: If enabled, the Power Manager module (PWRM) can optionally do voltage scaling.  If that is enabled, it will attempt to talk to an external voltage controller over I2C.  This is done in the low-level “PMI” layer.  There are a few different PMI voltage control libraries included in the product:

    pmi_ctl_evm6748.a674 – for the evm6748 board
    pm_shared_evm6748.a674 – also for the evm6748 board, but allows for sharing of the I2C bus
    pmi_ctl_null.a674 – this is a non-functional library that satisfies the linker, but doesn’t actually talk to any PMIC

    The sources for the PMI layer reside in the product installation (for example, ...\bios_5_42_01_09\packages\ti\pmi\src), with the intent that customers can port this code to support a custom board or different PMIC chip.

    If this PMI_writeI2C() function is stuck, I think the expected PMIC chip is not available.  Or, there may be some conflict for use of the I2C bus.

    If you want to get past this error for the moment, you can try a few things.  You can do these in the graphical configuration tool, or via textual config (see section 2.23 in the API reference guide: www.ti.com/.../spru403s.pdf)

    Disable the PWRM module:
        bios.PWRM.ENABLE = false;

    Or just disable voltage/frequency scaling:
        bios.PWRM.SCALING = false;

    Or select the “null” voltage control library:
        bios.PWRM.VLTCONTROLLIB = "pmi_ctl_null.a674";

    That should get your program running.  If you indeed want voltage scaling support, I think you’ll need to investigate the I2C link to the PMIC, and if there is a collision, or if you need to build a board-specific library.

    Regards,
    Scott

  • Dear Scott,

    Thank you very much for your reply and you really helped me a lot.

    My board is ICETEK-OMAPL138-KB v2.0.

    First, as you suggested, I disabled  the PWRM module  in the graphical configuration tool. Then, my program could run normally!  But when I add the Ahci.c to my project, there appeared an error because it is defined like this in the psp_ata_pwrm.h, following the picture. So it seems like I need the PWRM support, is it right?

    So could you please tell me how to configure about I2C and PMI in detail? I really have no idea. I haved chosed the related library:pm_evm6748.a674 and pm_shared_evm6748.a674.

    I'll appreciate it if you can help me another time. thank you very much, Scott!

    Looking forward to your reply. Best wishes!

    Regards,

    Samantha

  • Hi Samantha,

    Sorry, I don’t know anything about that board.  I don’t know if it has a PMIC that is able to control the voltage, and if there is one, what type of interface is used.  If you want voltage scaling support on this board, you’ll need to study the board details, and the source code for the PMI layer and the provided libraries in your DSP/BIOS installation, and then create your own voltage control library.

    But if you don’t care about voltage scaling, I think you have the easier options of 1) Enabling the PWRM module, but just disabling voltage and frequency scaling support (bios.PWRM.SCALING = false;), or 2) select the null voltage control library (bios.PWRM.VLTCONTROLLIB = "pmi_ctl_null.a674";).

    Have you tried these easier options?

    Thanks,
    Scott

  • Dear Scott,

    Thanks a lot for your reply sincerely!

    In fact, I use the RTFS systems just in order to read and write sata. So I consider I do not need to use the voltage scaling support.

    Thanks to your advice, I disabled voltage and frequency scaling support and my program could run normally. But when initialized ATA driver stack by the function ATA_DrvInit(), it went wrong in the step ATA_MED_Register(). In detail, it entered infinite loop in the ATA_SubmitIdentify() function, just like the function code below. If I abandoned the “//” before the sentenced pReq -> Retry--, it could pass. But it went wrong at another sentence, that is, Ide_Ctlr_Info [Index] . Drive [Device] . Probe == ATA_DEV_INIT. The device always was in init state so it coule not go on correctly.

    So if it is something wrong with my configure in .tcf or other reasons? I met this question when I didn’t use rtfs systems before and I really have no idea. Please help me if you can, and I am very thankful for you sincerely.

    I am looking forward to your reply Best wishes to you!

    Regards,

    Samantha

     

    static void ATA_SubmitIdentify (ATA_Drive_t *pDevice, ATA_Dev_Stat_t * const pStatus, Bool IsAta)
    {
      ATA_Dev_Req_t *pReq;
    
      if((NULL != pDevice) && (NULL != pStatus))
      {
    	  pReq = ATA_AllocReq (pDevice, False);
    
    	  pReq -> Buffer = (Ptr) DriveIdent;
    	  if (IsAta == True)
    	  {
    	    pReq -> Command . Cmd = ATA_IDENTIFY;
    	  } else
    	  {
    	    pReq -> Command . Cmd = ATAPI_IDENTIFY;
    	  }
    	  pReq -> Command . Device = pDevice -> Dev;
    	  pReq -> TransferCount = sizeof (DriveIdent);
    	  pReq -> BlockCount = sizeof (DriveIdent);
    	  pReq -> Mode = TASKFILE;
    	  pReq -> Handler = &ATA_IdentHndlr1;
    	  pReq -> ToHndlr = &ATA_IdentHndlr1;
    	  pReq -> Timeout = ATA_ONESEC_TO;
    	  pReq -> IsInternal = True;
    	  pReq -> Retry   = 10u;
    
    
    	  ATA_SubmitReq (pDevice, pReq);
    
    	  while (pReq -> Retry != 0)
    	  {
    	    //PAL_osWaitMsecs (1u);
    		m_delay(1u);
    		//pReq -> Retry--; 	//去掉前面的'//'
    	  }
    
    	  pDevice -> pIdeInt -> pIdeOps -> CmdStatus (pDevice -> pIdeInt -> pIntHndl, pStatus, False, pReq->PortNum);
    
    	  if (pReq -> Res . ReqInfo . Status . Error == ATA_ERR_TO)
    	  {
    	    /* Inform that this request timeout out and the status is not valid */
    	    pStatus -> Error = 0xFFu;
    	    /* Set the Error Status on the device status */
    	    pStatus -> Stat  |= ATA_DEV_ERR;
    
    	  }
    	}
    }

     

  • Dear Scott,

    After the debug in yesterday afternoon, I find the true problem.

    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? I really can’t understand how to make it here. Could you please tell me why it is like this here and how I should configure here? Thanks a lot!

    I am looking forward to your reply Best wishes to you!

    Regards,

    Samantha

  • Hi Samantha,

    Thank you for the updates.  I’m glad you’ve gotten past the initial issues with moving to the new board.

    Regarding  getting stuck in ATA_SubmitIdentify()…  I searched the forums and found these three threads reporting similar problems:

    e2e.ti.com/.../310194

    e2e.ti.com/.../60350

    e2e.ti.com/.../92457

    Unfortunately, none of them seemed to come to a solid conclusion.  There seemed to be a mix of memory and interface-specific timing issues.  

    The best suggestion I have for this problem is to post a new question to the OAMP-L13x processors forum, which is best for handling RTFS questions: e2e.ti.com/.../

    And put ATA_SubmitIdentify() in the title to highlight this specific problem.

    Hopefully someone on that forum can help resolve this for you…

    Best regards,
    Scott

  • Dear Scott,

    Thanks a lot for all your help ! I will try as you said.

    Best wishes!

    Samantha