cancel
Showing results for 
Search instead for 
Did you mean: 

CRC calculation with DMA

david tomsa
Associate III
Posted on October 06, 2017 at 11:31

Hi guys,

i tryed to use the CRC Modul with DMA Access but it doesn't work.

My first step is to configure the DMA Channel.

DMA.TCD[3].SSIZE = 2 /** 4 Bytes **/

DMA.TCD

[3]

.DSIZE = 4

DMA.TCD

[3]

.SOFF = 4

DMA.TCD

[3]

.DOFF = 0

DMA.TCD

[3]

.DADDR = (uint32_t) &CRC.INP.R

DMA.TCD

[3]

.NBYTES = 4

DMA.TCD

[3]

.DREQ = 1

I try to send Data in the following way.

DMA.TCD

[3]

.SADDR = (uint32_t)&source;

DMA.TCD

[3]

.BITER = amount;

DMA.TCD

[3]

.CITER = amount;

DMA.ERQL.B.ERQ3 = 1;

I'm using the SPC57 with the Hightec Compiler / IDE. Could anyone tell me where my error is ?

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on October 30, 2017 at 08:44

Hi Erwan,

sorry for my late answer, i was on vacation.

The µC is the SPC570S40.

I think i found the Problem. I have to set the configuration of Nbytes before i start the transmit.

My new Transmit function is:

void HAL_Dma_TransmitCrc(uint32_t *source, uint16_t amount)

{

   DMA.TCD[HAL_DMA_CHANNEL_CRC].SADDR = (uint32_t)source;

   DMA.TCD[HAL_DMA_CHANNEL_CRC].BITER = amount;

   DMA.TCD[HAL_DMA_CHANNEL_CRC].CITER = amount;

   DMA.TCD[HAL_DMA_CHANNEL_CRC].NBYTES = amount;

   DMA.TCD[HAL_DMA_CHANNEL_CRC].START = 1;

}

That work's fine.

View solution in original post

2 REPLIES 2
Erwan YVIN
ST Employee
Posted on October 06, 2017 at 16:03

Hello David ,

Could you confirm your microcontroller used ?

Did you start your DMA request ?

0690X00000608VpQAI.png

   Best regards

               Erwan

Posted on October 30, 2017 at 08:44

Hi Erwan,

sorry for my late answer, i was on vacation.

The µC is the SPC570S40.

I think i found the Problem. I have to set the configuration of Nbytes before i start the transmit.

My new Transmit function is:

void HAL_Dma_TransmitCrc(uint32_t *source, uint16_t amount)

{

   DMA.TCD[HAL_DMA_CHANNEL_CRC].SADDR = (uint32_t)source;

   DMA.TCD[HAL_DMA_CHANNEL_CRC].BITER = amount;

   DMA.TCD[HAL_DMA_CHANNEL_CRC].CITER = amount;

   DMA.TCD[HAL_DMA_CHANNEL_CRC].NBYTES = amount;

   DMA.TCD[HAL_DMA_CHANNEL_CRC].START = 1;

}

That work's fine.