Forum Discussion
Altera_Forum
Honored Contributor
13 years agoOk, it seems that dev->descriptor_base is referred to a global variable set it up at alt_sys_init.c by calling a macro that it's defined in altera_avalon_sgdma.h:
#define ALTERA_AVALON_SGDMA_INSTANCE(name, dev)
static alt_sgdma_dev dev =
{
ALT_LLIST_ENTRY,
name##_NAME,
((void *)(name##_BASE)),
((alt_u32 *) 0x0), \
((alt_u32) 0x0),
((alt_u32) 0x0),
((alt_sgdma_descriptor *) 0x0),
((alt_sgdma_descriptor *) 0x0),
((void *) 0x0),
((void *) 0x0),
((alt_u16) 0x0)
};
Plase note that i'm using external descriptor memory. Bold line is descriptor_base and it's not touched in code after this initialization. However, if i put the descritor base inside bold line, it stucks again in dma loop, but dev->descritor_base is now correct. Question: descriptor_base should be the same value for sgdma tx and rx?