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!
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!