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.

CC2541: How to select an idle DMA channel on CC2541?

Part Number: CC2541

Hello, everyone,

I need to use a DMA channel on a CC2541, but I do not know what channels are already in use by either the BT stack or the reference application.

I intend to start with the SimplePeripheral project and add my own code which will make use of a spare DMA channel.

My questions:
  - what DMA channels are available for use?
  - what channels are already allocated to either the BT stack or the SimplePeripheral app?
  - how do I configure an idle DMA channel if, say, channels 1 and 2 are used and I would like to use channel 3?
  - since channels 1-4 are setup together, how do I configure channel 3 after channels 1 and 2 have already been configured? Can I simply define my DMA structure and do a DMAARM = DMA_CHANNEL_3 assignment?

I looked over the Samples Guide but did not find answers to these questions.

Thanks,
Julio

  • Hi Julio,

    I would recommend to look at the Developer's Guide:

    "6.7 DMA
    To include the DMA driver, define HAL_DMA=TRUE in the preprocessor definitions. Because the DMA driver is used by the AES driver, it must always be included in the project. As stated in section 6.2, channels 1 and 2 are reserved for use by the AES driver. Furthermore, other channels will be used if the UART DMA or SPI driver is being used. The DMA API can be found in hal_dma.h. See the SPI driver for an example of using the DMA driver."

    You may also be interested by DMA example in CC2541 Peripherals Software Examples (www.ti.com/.../swrc257)

    Best regards,

  • Hi, Clément,

    Thanks for the reply.

    I have already read the section you pointed out as well as the DMA examples you mentioned. I am sorry I did not specify that I have already implemented my DMA routine and it is working perfectly. The examples were really helpful.

    My question is  actually how to incorporate it into the Simple Peripheral project, such that the channel I am using (channel 0) does not conflict with other uses in the Bluetooth stack.

    I do no plan on using either USART nor SPI DMA and since channels 1 and 2 are reserved for AES DMA (which is set as TRUE in my project), can I go ahead and use channel 0 for my application?

    I guess I can test it and if it works, it's done. If it doesn't, I'll try other channels (3 and 4). Is this reasonable?

    Thanks,
    Julio

  • Hi Julio,

    As you mentioned, you could test channels one by one and see which one is working - I mean you will quickly see if a channel can or cannot be used. To begin, I recommend to use channel 0 which is suppose to be available.

    Best regards,

  • Hi, Clément,

    I'll do as you suggested. To make matters easier for future users, I wonder if TI could add a section to Chapter 6 of the Software Developer's Guide (coming SWRU271H) indicating which hardware resources are used by the Bluetooth Stack and drivers (interrupts, DMA, ...).

    Best regards,
    Julio

  • Hi,

    Good point, thank you for the suggestion :)

    Regards,