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.

_PMI_deepSleepInit not found in SYSBIOS

Hi,

In studying DEEPSLEEP code described in “Power Module for C6748 and OMAP-L138”, I located file

C:\ti\bios_6_33_04_39\packages\ti\sysbios\family\c674\pmi\pmi_slp.c

which contains function

PMI_Status PMI_sleepCPU(PMI_Sleep state, unsigned scaleVoltage, unsigned sleepArg)

Line 306-307 of the function contains asm calls to

        asm(" .global _PMI_deepSleepInit");

        asm("_PMI_deepSleepInit:");

However, it is difficult to find definition of the callee _PMI_deepSleepInit, and I searched the contents of the entire “C:\ti\bios_6_33_04_39” folder without success.

Could someone tell me where to locate it?

Paul

  • Paul,

    Its a little confusing, but I believe there is no call to PMI_deepSleepInit.

    In pmi_slp.c:

            REG(DEEPSLEEP_REG) = (REG(DEEPSLEEP_REG) & ~SLEEPCOUNT_MASK) |
                sleepcount;

            asm(" .global _PMI_deepSleepInit");
            asm("_PMI_deepSleepInit:");

            /* set SLEEPENABLE bit to initiate deep sleep.................. */
            REG(DEEPSLEEP_REG) |= SLEEPENABLE_BIT;

    The asm(" .global _PMI_deepSleepInit") statement is declaring the label "_PMI_deepSleepInit" to be globally accessible.

    The asm("_PMI_deepSleepInit:"); statement is placing the "_PMI_deepSleepInit" label just before the code which follows it.

    I could not find any other reference to the PMI_deepSleepInit label in the code base, so I believe this is provided simply for debugging purposes to make it easy to see where the PC is after the device is placed in deep sleep in the C code just after the label.

    Alan

  • Alan,

    This is correct, thanks.

    Paul

  • Alan,

    Alan DeMars said:

    so I believe this is provided simply for debugging purposes to make it easy to see where the PC is after the device is placed in deep sleep in the C code just after the label.

    I have some questions with this. The statement immediately followings the two lines of asm code initiates the DEEPSLEEP mode, and in DEEPSLEEP mode the JTAG connection is cut off. Only after waking up from DEEPSLEEP and a JTAG re-connect could we possibly restart debugging the code, so what benefit does this assembly label could actually have?

     

    Paul

  • Paul,

    This label was used during development testing to halt the debugger *before* transitioning the device to DEEPSLEEP.  It was useful so it was left it in place for other developers who may be modifying, rebuilding, and re-testing the sources.

    Scott

  • Scott,

    It makes sense, thanks.

    Paul