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.

CCS: TMS570LC4357 - DMA test : RAM access, HW Trigger

Tool/software: Code Composer Studio

I use DMA to CRC Auto mode.

In technical documt, DMA can access RAM area. But I cannot access RAM area. If I access RAM area, the data is 0.

For example, If the reference CRC(pre-determined CRC) is declared in ram( ex) uint32_t ref_data[2] = {0x242945, 0x489397};), the CRC data is read as 0.

I wonder the other setting needs to access RAM area by DMA.

The second question is How i use the request trigger as HW.

I set the trigger by HW( ex) dmaSetChEnable(DMA_CH0 ,DMA_HW)). The trigger don't work.

Can I get some example code about using the HW trigger?

  • Hi Minwoo,

    If the cache is enabled, the pre-determined CRC are in cache and have not updated to the RAM. You can change the MPU setting for SRAM to write-through instead of write-back.

    dmaSetChEnable(DMA_CH0 ,DMA_HW)) is to enable HW to trigger the DMA transfer.

  • Hi Minwoo,

    After system reset and when AUTO mode is enabled, CRC Controller automatically generates a DMA request to request the pre-determined CRC value corresponding to the first sector of memory to be checked.

    This is example code of DMA setting for transferring pre-determined CRC:

    dma_config.SADD = (uint32_t)&CRC_Pattern[0];

    dma_config.DADD = (uint32_t)&(crcREG1->REGL1 );

    dma_config.PORTASGN = PORTA_READ_PORTB_WRITE;

    dma_config.RDSIZE = ACCESS_64_BIT;

    dma_config.WRSIZE = ACCESS_64_BIT;

    dma_config.TTYPE = FRAME_TRANSFER;

    dma_config.ADDMODERD = ADDR_FIXED;

    dma_config.ADDMODEWR = ADDR_FIXED;

    dma_config.AUTOINIT = AUTOINIT_OFF;

    dmaReqAssign(DMA_CH0, DMA_REQ26); //DMA request line 26, CRC1 channel0

    dmaSetChEnable(DMA_CH0, DMA_HW);

     

  • Thanks to your answer.

    I have a question about your answer.

    1. DMA trigger is set as HW. Then, how i can generate HW_trigger. Can you show a example code? 

      - just set dmaReqAssign(), the HW trigger is generated automately as DMA Request Line connection in technical documentation?

    Thanks and Regards,

    Minwoo

  • Hello Minwoo,

    As I mentioned, the DMA request to transfer the pre-determined CRC value is generated when AUTO mode is enabled.

    crcREG1->CTRL2 = 0x01; //auto mode

    1. Set DMA control packets

    2. Assign DMA request line, and trigger type

    3. Enable DMA

    4. Enable CRC auto mode

    Then the pre-determined CRC value is transferred to CRC_REGL1 and CRC_REGH1