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.

CC3235MODSF: How to enter MCU LPDS ?

Part Number: CC3235MODSF
Other Parts Discussed in Thread: SYSCONFIG

Hello,

I configured the sysconfig like below.

And I set ip and NWP power like below when the module powered on. (My project based on the "at_commands" example)

Here are questions:

1. The MCU and NWP will enter to LPDS automatically if there are no actions. Is it right?

But the current consumption is about 18mA on my device after set the NWP power and no more action like above log. It seems that the MCU not entered to LPDS.

2. When I send AT Command like "at+wlanget=connection," after the MCU entered to LPDS, the MCU wakes up from LPDS ?

Or should I control the gpio 13 to wake it?

Thanks,

Calvin

  • The MCU and NWP will enter to LPDS automatically, however in this case the UART is blocking the MCU from getting to LPDS.

    Check the following thread (and read the Drivers Power Management Guide it refers to):

    https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/896411/cc3235modsf-questions-about-some-code-of-at_commands-example

    Basically waiting on UART RX (which is what the AT-CMD is doing) prevents the MCU from getting to LPDS (which supposed to be done automatically).

    The example sets the RXDISABLE (isee InitTerm()) and is using UART_readPolling - so the application won't go to LPDS (you need to put the application thread in blocking or sleep mode in order to enable the OS low priority thread to enter the device to LPDS). 

    If you replace UART_readPolling with UART_read - the MCU will go to LPDS but then it won't wakeup on UART commands. So you'll need to use other method to enable LPDS (e.g. using gpio13). The current code doesn't support this.

  • Hi Kobi,

    Thank you for your explanation.

    1. I changed all UART_readPolling to UART_read in uart_term.c and test it but there's no change of the current consumption.

    I added two hook functions in at_commands.c to see whether entering LPDS or not.

       

    After this, when boot it up, the enterToLPDS called.

    Hook function of entering LPDS always called when it boot up?

    After added the hook function, the ATCommands_displayBanner() does not executed.

    The mainThread of the at_commands.c does not working correctly. How to use the hook functions?

    2. Do I need to add Power_enablePolicy(); in code of at_commands.c?

        It can be omitted because it's checked from the sysconfig checkbox. Is it right?

    Thanks,

    Calvin

  • Why do you want the hook function?

    It is typically used for debug only (e.g. toggle a led). It is not needed.

    Power_enablePolicy is already enabled in your case (according to the syscfg file and as the hook gets invoked).

    If the enterLPDSHookFxn is NULL (or the function does nothing), does the resumeLPDSHookFxn get invoked?

    br,

    Kobi  

  • Hi Kobi,

    I found the cause that cannot into LPDS even after changed the UART_readPolling to UART_read.

    I checked the "Use DMA" box from configuration of UART. It was the cause.

    After unchecked it, LPDS works fine.

    But with power policy, my project based on at commands doesn't seem to fit it well.

    My device's main MCU sends many times of at commands to the CC3235 to connect an AP,

    connect a remote server, send and receive data for a communication.

    With power policy, the CC3235 goes into LPDS automatically,

    So my device's main MCU have to wake the CC3235 everytime just before send an at command. I think it's not graceful.

     

    1. Can I send a custom at command to CC3235 to go into LPDS? (Control manually)

    For example, If my device's main MCU send a command like "at+enter_lpds" to CC3235, 

    it goes into LPDS and use gpio13 to wake it up.

    Is it possible?

     

    2. There's a problem where the CC3235 does not properly read the at command sent by the main MCU.

    For example, below is the RX log from main MCU. It is the echo from the CC3235 after sent "at+wlanget=connection," by the main MCU.

    ( I tested this with "Use DMA" checked because not implemented wake up by gpio yet.)

    [2021-01-01T00:06:21][DBG][wifi.c:1388] [ATRx:49]-["

    at+wlanget=conne,
    ERROR: parse parameters,-4
    "]

    This seems to be because I changed UART_readPolling to UART_read.

    Is there any solution for this?

     

    Thanks,

    Calvin

  • 1. Yes, you will need to add such command yourself. It should be used to enable and disable the power policy.

    You can also think about replacing this command with an idle timeout (that will get reset every time an AT command is processed) that upon expiration will enable the power policy.

    2. I'm not familiar with the issue. Maybe the app has latencies in response to interrupts causing a buffer overrun (i believe you can check this through reading the UART status). You can try to play with task priorities (i'm not sure this use-case was considered when the example was designed). You may also consider reducing the baudrate or adding HW flow control (w RTS/CTS). 

    If you are disabling the power policy during AT Commands transfer, you can re-enable the polling mode. 

    Br,

    Kobi

  • Hi kobi,

    Using timer would be nice.

    I'm trying to wake up by gpio. How to set the gpio in sysconfig?

  • Your Power configuration seem ok (you don't need to configure the specific GPIO if it is only used as an LPDS wakeup source).

     Please use the "Power Measurement" example as a reference.

  • Hi Kobi,

    I solved this problem with power policy control manually in timer callback function and wakeup gpio lpds function.

    Thank you!