Aug 23, 2018
05:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 23, 2018
05:24 AM
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!
- Tags:
- dma
- IFX
- sri bus error
4 Replies
Aug 30, 2018
08:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 30, 2018
08:07 AM
Which values (addresses) you wrote to SADR and DADR?
Aug 30, 2018
11:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 30, 2018
11:42 PM
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?
__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?
Aug 31, 2018
04:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 31, 2018
04:27 AM
The problem is the address you have chosen.
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.
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.
Sep 02, 2018
11:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 02, 2018
11:21 PM
Thank you!
Changing the base address solved the problem.
Changing the base address solved the problem.