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 manage DMA or UART manually in my application based on the at_commands example?

Part Number: CC3235MODSF

Hello, 

I do not use DMA and UART_readPolling for entering LPDS.

But it cause a problem sometimes that the cc3235 module seems to be stuck with uart receive processing.

So I revert code to use DMA and UART_readPolling and I'm trying to find a way to use LPDS.

My scenario is that,

1. Stop the 'while' process in ATCommands_readCmd() to stop UART_readPolling in the GetRawCmd() when the timer expired.

2. Call ATCommands_readCmd() when it wakes up from LPDS.

But it still cannot go into LPDS when the timer expired because of the DMA, I think.

So I need to initialize or de-initialize the DMA or UART in the timer callback and wakeup callback function.

How can I do that??

void timerCallback(Timer_Handle myHandle, int_fast16_t status)
{
  stopReadPolling = true;
  UART_disableRx();
  Power_enablePolicy();
}

void wakeupFromLPDS(uint_least8_t argument)
{
  stopReadPolling = false;
  Power_disablePolicy();
  UART_enableRx();
  timerStart();
  ATCommands_readCmd();
}

Thanks,

Calvin

  • Hi Calvin,

    UART with DMA does not have a good way to close and reopen the DMA from the application, since the UART driver is expecting a certain DMA handle internally. Your options are to:

    1. Use the UART driver without DMA
    2. Close and reopen the UART driver for LPDS
    3. Switch to the UART2 driver
      1. UART2 is an updated version of the UART driver, using the same underlying hardware peripherals, but with some additional functionality. This includes the API UART2_rxDisable() that stops the DMA for you. For more details, see the TI Drivers API guide in the SDK.

    Additionally, what timer mode are you using? If you are using continuous mode, the MCU cannot enter LPDS if the hardware timer is still running. A software alternative that works with the TI Drivers power policy is the POSIX timer handled by the RTOS in source/ti/posix/<compiler>/time.h.

    Best regards,

    Sarah

  • Hi Sarah,

    I'm using oneshot callback mode for timer.

    I solved the problem what I mentioned.

    "But it cause a problem sometimes that the cc3235 module seems to be stuck with uart receive processing."

    It's from my recent wrong modification about the timer. I fixed it and no more problem.

    Maybe I'll try the #3 option to use DMA.

    Thanks,

    Calvin