Forum Discussion
Altera_Forum
Honored Contributor
13 years agoI switched the design over to the modular SGDMA and use the following code to try and set things up, nothing returns any errors and all the steps seem to complete successfully but my interrupt is never fired and nothing is written to the onchip memory that I'm viewing via in system memory content editor. I can see the data coming out and it should be getting to the mSGDMA fine.... the code is below:
int main() {
int i = 0;
sgdma_standard_descriptor a_descriptor;
sgdma_standard_descriptor * a_descriptor_ptr = &a_descriptor; // using this instead of 'a_descriptor' throughout the code
int valid = alt_ic_isr_register (NULL, MODULAR_SGDMA_DISPATCHER_CSR_IRQ, sgdma_complete_isr, NULL, NULL); // register the ISR
enable_global_interrupt_mask(MODULAR_SGDMA_DISPATCHER_CSR_BASE); // turn on the global interrupt mask in the SGDMA
construct_standard_st_to_mm_descriptor(a_descriptor_ptr,
(alt_u32 *) ONCHIP_MEMORY2_0_BASE, 0x3fc,
DESCRIPTOR_CONTROL_TRANSFER_COMPLETE_IRQ_MASK);
int freq = 0;
while (1) {
if (sgdma_interrupt_fired == 1) {
for (i = 0; i < 0x3fc; i++) {
printf("%x\n", IORD_32DIRECT(ON_CHIP_MEM_BASE, i));
}
sgdma_interrupt_fired = 0;
}
freq ++;
if(freq % 10000000 == 0){
printf("Frequency set to %d.\n\r", (int) freq);
if (write_standard_descriptor(MODULAR_SGDMA_DISPATCHER_CSR_BASE,
MODULAR_SGDMA_DISPATCHER_DESCRIPTOR_SLAVE_BASE, a_descriptor_ptr)
!= 0) {
printf("Failed to write descriptor to the descriptor SGDMA port.");
}
}
}
} With the qsys setup that's attached. This SHOULD work I take it and I'm at a loss as to why this wouldn't be working. I left the TSE things in qsys because that's part of the next step for me, but if any of you guys had any ideas that would be great. https://www.alteraforum.com/forum/attachment.php?attachmentid=6570 Edit: I've since fully disabled the response port and made sure I was in 128 bit descriptor mode