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.

SDMA gets disabled automatically

Prodigy 40 points

Replies: 2

Views: 739

Hi,

I am using Beagle XM board(DM3730) in one of my project. One of the requirement in our project is to have SPI/SDMA combination in DSP. The driver code for SPI and SDMA runs on DSP processor.

I am using SPI3 in salve duplex mode and configured SDMA channel 1 for SPIRX0(DMA req line 15 ie S_DMA_15) and channel 3 for SPITX0(DMA req line 14 ie S_DMA_14). Basically I am using  HW synchronized transfer mechanism.

I have configured DMA as follows,

Element size --> 32 bit

Element number --> 160

Frame number --> 1

And I have configured DMA channel for Block interrupt using CICR register. After a block transferred, I am getting proper block  interrupt also proper data at destination memory.

The problem I am facing is that, after a block get transferred at RX the DMA channel 1 gets disabled automatically and I am not able to receive next block. Even I try enabling the channel through SW, it does not have any effect. I tried with channel linking but there also I receive one block from original channel and other block from linked channel. totally I get 2 blocks and the transaction stops.

Can any body help me or suggest what might have gone wrong? Why the channel gets disabled automatically and it can not be enabled further? My requirement is to get block of data continuously till SW disables the DMA channel.

Regards

Ganapati Hegde

2 Replies

  • Hi Ganapati,

    Could you share the SDMA configuration which you are using? Also check the AM/DM37x Technical Reference Manual which can be found at:

    www.ti.com/.../technicaldocuments

    section 11.5 SDMA Basic Programming Model whether described steps for configuring matching to yours.

    BR

    Tsvetolin Shulev

  • In reply to Cvetolin Shulev-XID:

    Hi Tsvetolin,

    Thanks for your time, and the configurations I am using are as follows, I have gone through the TRM, post that I came up with this driver code. May be I am missing something still.

    configRx.channelNo = SDMA_CHANNEL_1;
    configRx.req = SDMA_REQ_15;
    configRx.transferSync = SDMA_TRANSFER_SYNC_ELEMENT;
    configRx.srcAddrMode = SDMA_ADDR_MODE_CONST;
    configRx.destAddrMode = SDMA_ADDR_MODE_POSTINC;
    configRx.elementSize = SDMA_ELEMENT_SIZE_32; //4 byte
    configRx.sourceAddr = 0x480B803C; //SPI3 RX0
    configRx.destAddr = &slaveRx;
    configRx.elementsPerFrame = 160;
    configRx.srcElementIndex = 1;
    configRx.destElementIndex = 1;
    configRx.srcFrameIndex = 0;
    configRx.destFrameIndex = 0;
    configRx.frameNumbers = 1;
    configRx.transferType = TRANSFER_TYPE_RX; //To indicate SRC/DEST sync for HW sync transfer

    After this I am calling channelEnable(). After getting 160 elements get transferred to destination (ie unsigned int slaveRx[160]) I am getting block interrupt properly. But channel gets disabled automatically. Currently I am re enabling channel in DMA ISR handler while handling block interrupt but not sure this is the correct way or not.

    Regards
    Ganapati Hegde

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.