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.

UART receive in DMA mode and power saving

Other Parts Discussed in Thread: CC2541

My CC2541 code collects 20 bytes from the UART and then sends them out as one GATT packet. So I modified the UART/DMA code to fire an interrupt only after receiving 20 bytes instead of on every byte. The problem is that many times I get wrong data in the DMA buffer (not sure if corrupted data or missing bytes).

When I disable power saving everything is working fine, which makes sense since going into PM2/PM3 disables the voltage regulator. However, I would assume that if I changed the sleep mode to be PM1 the DMA should still work, but that doesn't seem to be the case. Even with the sleep code modified to go into PM1, I still see the same data errors.

So my questions:

1. Does the DMA suppose to work as usual in PM1?

2. Has anyone been successful in making DMA and (any form of) power saving work together?

Thanks,

Tomer

  • Found the answer here: http://e2e.ti.com/support/low_power_rf/f/538/t/119687.aspx

    Not the answer I was hoping for but at least I know what to expect.

  • Hi Tomer,

    You could be seeing an issue where sometimes the chip goes to sleep even though it should not. I believe this should be fixed in BLE v1.4.0 coming out this or next week.

    Basically, the ISR that wakes you up must look a bit like
     ISR
    {
    CLEAR_SLEEP_MODE();
    osal_pwrmgr_task_state(<your task id>, PWRMGR_HOLD);

    }

    And hal_sleep.c should look like this, taken from 1.4.0:

        // check if radio allows sleep, and if so, preps system for shutdown
       if ( halSleepPconValue && ( LL_PowerOffReq(halPwrMgtMode) == LL_SLEEP_REQUEST_ALLOWED ) )
       {

    Best regards,
    Aslak 

  • Thank you Aslak for your response. However, my problem is not with the chip going to sleep when it shouldn't.

    Let me add more details on the problem I'm trying to solve. My CC2541 code receives data from the UART at a rate of one byte every 4ms (that's given , cannot change it). The code in the CC2541 waits for 20 bytes to be received, then sends them off over BLE as one GATT packet.

    Since the CC2541 has nothing significant to do until it receives the whole 20 bytes, I am trying to configure the DMA to collect 20 bytes while the chip is in some level of power saving and only wake up when all 20 bytes have been received.

    I understand that the only power saving option that allows the DMA/UART to continue working in the background is Idle mode. However, when the processor goes into Idle mode (I change the hal_sleep module to go into Idle mode instead of PM2), I don't receive DMA interrupts anymore. Any ideas why?

    (and the fact that the debugger doesn't work in Idle mode doesn't help to debug the problem...)

    Thanks,

    Tomer