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.

AWRL6432: How to fully enable I2C on idle mode?

Part Number: AWRL6432
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello team,

One of my customer wants to use I2C on idle state. To do this, with MMWAVE_L_SDK_05_04_00_01, they commented out below block inside powe_idle3entryhook() in power_management.c.

// Gate I2C clock

//  PRCMPeripheralClkEnable(Power_module.dbRecords[8], PRCM_GATE_CLK_DISABLE);

//  CSL_REG32_FINS((CSL_APP_RCM_U_BASE + CSL_APP_RCM_IPCFGCLKGATE0), APP_RCM_IPCFGCLKGATE0_IPCFGCLKGATE0_APP_I2C,

//                 PRCM_GATE_CLK_DISABLE);

However, even commented out I2C gate block as above, seems I2C communication fails from time to time. Can we provide some guidance how to use I2C on idle state?

Regards,

Victor Park

  • Hi Victor,
        I have looped in our SW expert. Please allow us a day or so to provide the respond.

    Thanks and Regards,
    Sivaprasad

  • Hi Victor,

    A couple of things to try:

    1. Let's first isolate the issue to the idle3entryhook() and idle3resumehook() functions. If both those functions are empty (everything commented out), does the I2C still work?

    2. If I2C works in the above case, then there is an issue in either of these functions. Please mage sure that the "// Ungate I2C clock" section is also commented out in the idle3resumehook() function.

    Let me know results of trying these, and we can continue from there.

    Regards,

    Tim

  • Hi, Tim

    1. I  commented both functions out. but I2C read not working.

    2. It does not work 

    What else is there to try?

    I2C cannot be used between each frame  in IDLE mode?

    Could you please explain with examples?

  • Hello ,

    Please give us your help on above questions from customer.

    Regards,

    Victor Park

  • Hi Taeheon, Victor,

    Are you sure the device is going into IDLE mode and not going into Deep Sleep instead? Are you able to set a breakpoint in the idle functions to confirm that you are going into the idle state? If not, the device is likely in deep sleep instead. You can go into SysConfig and in the "POWER" tab you can adjust the timing thresholds to enter deep sleep and idle modes.

    If we confirm you are actually entering the idle mode functions, then we can debug further.

    Regards,

    Tim

  • Hi Tim,

    According to your opinion, I tested as follows:

    //////////////////////////////////////////////////////////////////////////////

    SDK: MMWAVE_L_SDK_05_04_00_01,

    CCS: 12.6,

    Source: motion_and_presence_detection example,

    ////////////////////////////////////////////////////////////////////////////////

    1. The Threshold for LPDS value is set to a large value like the Threshold for Sleep(99999999, 99s).

    2. I set the frame rate value to 2s(2000) as follows:

    This is set for testing purposes and will use 5fps(200) later.

                      

    3. After that, when I proceed with debugging, an error occured from Power_idleFunc(slpTImeus) as shown below.

    4. And then I checked the log with Tera Term. You can see the result below.

    It was printed after Power_disablePolicy();

    The slpTimeus is about 1.9s(frame rate: 2s). and PwrStateTaken is 2(POWER_IDLE).

     

    As you said, it may have been set to deep sleep, How can I set it to IDLE?

    Regards,

    Taeheon

     

  • Hi Taeheon,

    Are you able to set a breakpoint in the idle3resumehook() and idle3entryhook() functions? Or set a print statement and see output in teraterm from those functions? Since the PwrStateTaken is POWER_IDLE, it should be going into idle and I wouldn't expect it to be going into LPDS.

    Also, have you configured I2C in a different configuration from the default settings?

    You also mention that I2C from time to time is failing. Does this mean it is working some of the time? Are there conditions under which it works or doesn't work?

    Does the I2C work fine when low power mode is disabled?

    Regards,

    Tim

  • Hi Tim,

    The answers to your qustrions are below:

    1. We can see the output of print statement through the Teraterm in the idle3resumehook() and idle3entryhook() functions.

    2. The I2C was only chagned the Transfer Mode from the Blocking to the Callback and Own Target Address.

    3. The I2C doesn't seem to work between Power_enablePolicy() and Power_disablePolicy().

    4. If I set the low power mode to disable, The I2C works fine.

    Regards,

    Taeheon 

      

  • Hi Taeheon,

    Thanks for confirming. Can you confirm again you've attempted trying it with both idle3_resume/entry() functions both empty?

    We are looking into the issue now on a deeper level and I'll let you know when we find anything else to try.

    Thanks,

    Tim

  • Hi Tim,

    Thanks for your help.

    After commenting out all code in the both idle3resumehook() and idle3entryhook() functions and setting the low power enable, I tested whether I2C communication works well. As a result, The I2C does not work well. Please let me know if you see anything I can try.

    Regards,

    Taeheon

  • Hi Taehon,

    Let me check internally, I hope to respond in a day or two.

    Thank you,

    Tim

  • Hi Taeheon,

    I've confirmed with our R&D team that the CPU is in deep sleep mode even when in IDLE mode. To use I2C, first the core needs to be woken up from the deep sleep state. You can refer to the TRM for the list of wakeup interrupts. See section 23.6: Wakeup Mechanism from PRCM.

    There is no specific I2C WIC to wake the device up, however, so you will likely need to get creative to find a workaround to wake the CPU up.

    If you would like to use I2C, I would suggest the simplest alternative would be to set lowPowerCfg to 0 and not use low power modes for this, as the best savings you may see in terms of power may be just to gate a handful of peripherals.

    Regards,

    Tim

  • Hi Tim,

    I'm wondering if there's a way to change lowPowerCfg mode dynamically(enable <-> disable).

    Regards,

    Taeheon

  • Hi Taehon,

    Can you please describe in what way you want to change it dynamically? Are you suggesting while the device is chirping you sometimes go into Low power deep sleep and other times not? Or something different.

    Thanks,

    Tim

  • Hi Tim

    Yes. I want to dynamically change to lowPowerCfg = 0 for next cycle frame while running with lowPowerCfg = 1. Also, I want the opposite. 

    Is it a proper way to change the value like gMmwMssMCB.lowPowerMode = 0 in powerManagementTask() in power_management.c? I'm a bit confused by the tasks that use gMmwMssMCB.lowPowerMode. Could you please tell me the proper way to do it?

    Regards,

    Taeheon

  • Hi Taehon,

    Sorry for the delay. There are probably a couple ways to do this. In "Power_sleepPolicy", this function determines which power mode is taken (Power_setLowPowModeTaken). You could alter this functions logic to keep track of a frame count and only allow low power mode on odd number frames for example.

    You could also do as you mentioned and set gMmwMssMCB.lowPowerMode = LOW_PWR_MODE_ENABLE or LOW_PWR_MODE_DISABLE depending on the frame number.

    You are welcome to try either option, I am not sure of any side effects they would have, besides raising power consumption.

    Regards,

    Tim