Altera_Forum
Honored Contributor
15 years agoSGDMA descriptor list questions
I want to build a descriptor linked list to transfer data form memory to TSE MAC.If I build one descriptor there's no problem.If I build more than one descriptors no data was transfered.Is there anybody tell me why?
this is the code: alt_avalon_sgdma_register_callback(pM_Context->mac_mi.tx_sgdma, &sgdma_transmit_callback_function, ( ALTERA_AVALON_SGDMA_CONTROL_IE_GLOBAL_MSK |ALTERA_AVALON_SGDMA_CONTROL_IE_CHAIN_COMPLETED_MSK) pM_Context); for(i=0;i<ASYNC_TRANS_DESC_MAX;i++)//|| { printf("config descrip \n"); p_write = pM_Context->Frame_List.Pbuffer[pM_Context->Frame_List.rear]+pM_Context->Frame_List.offset; pM_Context->Frame_List.offset += pM_Context->Frame_List.packetsize; pM_Context->Frame_List.framesubnum++; //packet_length = pM_Context->Frame_List.packetsize; alt_avalon_sgdma_construct_mem_to_stream_desc(&pM_Context->Current_desc[i], // descriptor &pM_Context->Current_desc[i+1], // next descriptor (alt_u32 *)p_write, // read buffer location (pM_Context->Frame_List.packetsize), // length of the buffer 0, // reads are not from a fixed location 1, // start of packet is enabled for the Avalon-ST interfaces 1, // end of packet is enabled for the Avalon-ST interfaces, 0); // there is only one channel } alt_avalon_sgdma_do_async_transfer(pM_Context->mac_mi.tx_sgdma, pM_Context->Current_desc);