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.

TM4C129ENCPDT: Tivaware for uDMA

Part Number: TM4C129ENCPDT

Hi,

I am trying to set up DMA for the SSI2 Rx. When I included udma.h (comes with Tivaware C Series 2.2.0.295) into my project, I found the following:

#define UDMA_CHANNEL_USBEP1RX   0
#define UDMA_CHANNEL_USBEP1TX   1
#define UDMA_CHANNEL_USBEP2RX   2
#define UDMA_CHANNEL_USBEP2TX   3
#define UDMA_CHANNEL_USBEP3RX   4
#define UDMA_CHANNEL_USBEP3TX   5
#define UDMA_CHANNEL_ETH0RX     6
#define UDMA_CHANNEL_ETH0TX     7
#define UDMA_CHANNEL_UART0RX    8
#define UDMA_CHANNEL_UART0TX    9
#define UDMA_CHANNEL_SSI0RX     10
#define UDMA_CHANNEL_SSI0TX     11
#define UDMA_CHANNEL_ADC0       14
#define UDMA_CHANNEL_ADC1       15
#define UDMA_CHANNEL_ADC2       16
#define UDMA_CHANNEL_ADC3       17
#define UDMA_CHANNEL_TMR0A      18
#define UDMA_CHANNEL_TMR0B      19
#define UDMA_CHANNEL_TMR1A      20
#define UDMA_CHANNEL_TMR1B      21
#define UDMA_CHANNEL_UART1RX    22
#define UDMA_CHANNEL_UART1TX    23
#define UDMA_CHANNEL_SSI1RX     24
#define UDMA_CHANNEL_SSI1TX     25
#define UDMA_CHANNEL_I2S0RX     28
#define UDMA_CHANNEL_I2S0TX     29
#define UDMA_CHANNEL_SW         30

The definitions do not match the Tiva microcontroller, but they seem to be for the Stellaris MCUs. Please confirm this and advice if I can continue to use these modules (udma.h and udma.c).

Thanks,

Tianlei

  • Hello Tianlei,

    Couple elements to this... first I'll explain the table, and I can address your specific issue which is caused because the table seems to be missing entries (Which I don't know how that wasn't filed as a bug report before...?!?)

    This will match for TM4C MCUs and there is a reason that they have been provided this way. To start, here is the table out of the datasheet:

    What you'll see is that the names used map tot he Encoding 0 Peripherals. For the 'Reserved' channels, it appears that either internal names were released as part of the package or maybe you guess there was a Stellaris device which that matched for - either way, I was not part of the team so I can't really comment on why we chose to do that, but that is why they don't seem to match at a glance. But you'll see that UART, ADC, Timer etc. all match up properly to the channel #.

    Now the reason we have the single define and not one for SSI2 which is Encoding 2 on Channels 12 & 13 is that a uDMA channel cannot be assigned to multiple peripherals at once. If we made unique names for every iteration of the channel # and peripheral association, then a user would just use it without understanding how the channel is actually shared with other peripherals. Having the single name for a channel requires them to review the datasheet and find the proper channel as well as understand that if their peripherals share the same channel, they will need to either only select one peripheral or re-configure the uDMA each time that peripheral needs to use the uDMA.

    Now with that explanation given...

    You need uDMA channels 12 & 13 for SSI2. Unfortunately for reasons I don't really understand, those channels don't even have defines. So for this case I would recommend you make your own such as:

    #define UDMA_CHANNEL_CH12     12
    #define UDMA_CHANNEL_CH13     13
    

    In all honesty, the nomenclature I used above is what should have probably been done day 1 but I didn't have any role in the initial update. I've submitted a bug ticket in the meantime so when we do the next update we will address that and probably revisit the unclear table as well (which probably will require having a legacy + modern table so it is backward compatible.)

    Best Regards,

    Ralph Jacobi

  • Thanks Ralph! The clarification is very helpful to me.