Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

TM4C123GXL SSI uDMA Timing Issue

I'm having an issue with uDMA and SSI on the TM4C123GXL launchpad board. When I'm communicating with a slave device. I have the master and slaved wire like at the end of the post and am sending some data to SPI. The data transfered should look like this:

TX: 0x40 0x2A 0x00 0x02 0x00 0x00 0x40 0x01 0x00 0x01 0x00 0x40 0x22 0x00 0x02 0x00 0x00

RX: 0x00 0x00 0x00 0x00 0x00 0x3E 0x00 0x00 0x00 0x00 0x42 0x00 0x00 0x00 0x00 0x00 0x00

To perform this transfer, I ensure that the SSI Rx queue is empty. After that I enable the uDMA channel for RX, then the uDMA channel for TX similar to the UDMA demo, but using UDMA_MODE_BASIC. However, when I look at the received data, the position of received data is shift by 1-4 places depending on the arbitration size. Rather than it looking like the above, which is what a waveform puts out of the physical signal, I get the following when using an arbitration size of 4.

TX: 0x40 0x2A 0x00 0x02 0x00 0x00 0x40 0x01 0x00 0x01 0x00 0x40 0x22 0x00 0x02 0x00 0x00

RX: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3E 0x00 0x00 0x00 0x00 0x42 0x00 0x00


Does anyone know why this is happening? It seems like when I enable the uDMAChannel, it instantly reads 4 bytes of data regardless of if there is data there or not. Is there a way to delay the first arbitration so that is ensured the RX queue is at least half full?

SSI0_Tx -> MOSI

SSI0_Rx -> MISO

SSI0_Fss -> CS

SSI0_CLK -> SCLK

  • Hello Jordan,

    Can you please post the code that you have for configuration of the UDMA and SSI. It will help us co-relate.

    In general this should not happen as the UDMA will not recieve any data if the RX FIFO is empty for SSI. Did you try reset of the UDMA and SSI before you enable the peripherals in the code. It could be possible that a previous transaction was left prematurely causing the code restart to cause a false transfer.

    Regards

    Amit

  • Amit,

    Thanks for the reponse. I played around with it a bit more - I had ensured that the status of the SSI queue was TX Empty, TX Not Full, and that the RX fifo was empty (NE being 0) and RX full was 0 as well. However, since I didn't want to do any computations during setup of the SPI slaves, I made the setup blocking and wanted actual data transfer to use DMA. Just in case there was something I wasn't seeing, as you mentioned, I tried re-initializing the SSI/DMA peripherals. After re-running the configuration code the DMA operation worked properly and was now showing data at the right spot. 

    Since that code worked, but it was pretty clear I didn't want to re-run all of the re-initialization code, I did some trial and error and found out that the following lines made it sync up again:

    SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, // Configure SSI0 settings
    SSI_MODE_MASTER, SPI_FREQ, 8);
    SSIConfigSetExpClk(SSI1_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, // Configure SSI1 settings
    SSI_MODE_MASTER, SPI_FREQ, 8);
    SSIEnable(SSI0_BASE); // Enable SSI
    SSIEnable(SSI1_BASE);

    I still can't pinpoint the ultimate cause, but it seems to be working just fine after re-running that before I start doing DMA operations.

    Thanks for pointing me in the right direction!

    - Jordan