TC234 - DMA SRI bus error

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User15620
Level 1
Level 1
Hi everyone!

After days of trying to work with the DMA module on the TC234 Tricore MCU I have no idea what I am doing wrong.
I would like to write a simple test program for the DMA. The test program transfers a 32 bit word from a source to a destination address, it's very simple.
The code is based on the use case example in the TC234 User Manual. The source code is the following:

volatile unsigned int error = 0x00000000;

void InitDma()
{
volatile signed long dummy = 0;
volatile signed long i = 0;

ResetENDINIT();
DMA_CLC.U = 0x0;
dummy = DMA_CLC.U;
SetENDINIT();

for(i = 0; i < 100000; i++)
{
asm("nop");
asm("nop");
}

ResetENDINIT();
DMA_ACCEN00.U = 0xFFFFFFFF;
DMA_ACCEN10.U = 0xFFFFFFFF;
DMA_ACCEN20.U = 0xFFFFFFFF;
DMA_ACCEN30.U = 0xFFFFFFFF;

DMA_MODE0.U = 0x00000001;
DMA_MODE1.U = 0x00000001;
DMA_MODE2.U = 0x00000001;
DMA_MODE3.U = 0x00000001;
SetENDINIT();
}


void TransferUInt(unsigned int src, unsigned int dst)
{
ResetENDINIT();
DMA_SADR000.U = src; //source address
DMA_DADR000.U = dst; //destination address
DMA_CHCFGR000.U |= (010 << 21);
DMA_TSR000.U |= (1 << 17);
DMA_CHCSR000.U |= (1 << 31);
error = DMA_ERRSR1.U;
SetENDINIT();
}

The Initdma() functions gets called in the main function after companion chip and PLL settings initialization.
TheTransferUInt() function gets called after the DMA module initialization.
After that, in the error variable I can see, that this request caused a source error (DMA_ERRSR1.SER == 1) and an SRI bus error (DMA_ERRSR1.SRIER == 1) in the DMA move engine 1.
The source and destination addresses are 64bit aligned " __attribute__ ((aligned(64))) " and written correctly into the SADR and DADR registers.

I suggest that we are speaking about an invalid access on the SRI bus. But if I know right, all access bits are enabled by default and in any of the examples there are no access register modification before the DMA initialization.
I am really confused and searched all the user manual for any relevant information.

Please help me to resolve this problem!

Thank you!
0 Likes
4 Replies
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
Which values (addresses) you wrote to SADR and DADR?
0 Likes
User15620
Level 1
Level 1
They are two global variable declared the following way:

__attribute__ ((aligned(64))) unsigned int srce = 150;
__attribute__ ((aligned(64))) unsigned int desti = 0;

The function was called this way:

TransferUInt((unsigned int)(&srce), (unsigned int)(&desti));

The values written in the registers:

Address of srce: 0xD0000000;
Address of desti: 0xD0000500;

These are the correct addresses written in the SADR and DADR. I can check them in the .map file.

Any ideas?
0 Likes
cwunder
Employee
Employee
5 likes given 50 likes received 50 solutions authored
The problem is the address you have chosen.

Address of srce: 0xD0000000;
Address of desti: 0xD0000500;


See the section 6.7.2: ´CPU, ´Local and Global Addressing´ for CPU local views to segment ´C´ and segment ´D´ in the user's manual. Basically you need to address the DSPR by its global address which for the TC234 is 0x70000000--0x7002DFFF.
0 Likes
User15620
Level 1
Level 1
Thank you!

Changing the base address solved the problem.
0 Likes