How to deal with this kind of dma problem.
- From: "huxuelei630@xxxxxxxxx" <huxuelei630@xxxxxxxxx>
- Date: Thu, 28 Feb 2008 23:58:36 -0800 (PST)
Hi, I have a big problem, please give me some help.
I have a PCI Card use PLX9656 as a bridge. The PCI Card has a DSP
write datas into dual-ram in every 3 seconds.After DSP writting
complete, there will be a interrupt to notice the data is available.
My job is copy these data from the dual-ram and send them out by
socket.I have transfer these data successfully by use memcpy.Now I
want to use DMA to finish the job.After I complete the codes, DMA is
work and I can receive the DMA interrupt when the DMA is done.Then I
can get these data transfered by DMA, but the data is incorrect.The
situation is like this:
first group
Correct data: 0xAAAAAAAA, 0xB10043AA, 0x00000055, 0x00000098,
0x00000041, 0x00000001
Incorrect data:0x0000000000, 0xAAEAAAAA, 0xB1004355, 0x00400098,
0x00000041, 0x004000001
second group
Correct data: 0xAAAAAAAA, 0xB10043AA, 0x00000055, 0x00000098,
0x00000041, 0x00000002
Incorrect data:0x0000000000, 0xAAEAAAAA, 0xB1004355, 0x00400098,
0x00000041, 0x004000002
third group
Correct data: 0xAAAAAAAA, 0xB10043AA, 0x00000055, 0x00000098,
0x00000041, 0x00000003
Incorrect data:0x0000000000, 0xAAEAAAAA, 0xB1004355, 0x00400098,
0x00000041, 0x004000003
.......
Look at these carefully, you could find that some data has been add a
number 0x00400000, some are not.
The codes about start dma are like these:
//clear DMA Channel 0 interrupt
HAL_PLX9656_REG_WRITE_BYTE(plxRegAddr, PLX9656_DMACSR0, 0x8);
//open DMA Channel x Done Interrupt,DMA Channel 0 Clear Count Mode
bit(0xe2100080)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMAMODE0,0x20443);
//write address to DMA Channel 0 PCI Address,(0xE2100084)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMAPADR0,
ubpHAL_PLX9656_BufferBase);
//write address to DMA Channel 0 Local Address,(0xE2100088)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMALADR0,
fifoBase);
//write the size of data will be transfered(0xE210008C)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMASIZ0,
IBUFFER_SIZE);
//set from local to pci address,0xE2100090)
HAL_PLX9656_REG_WRITE_WORD(plxRegAddr, PLX9656_DMADPR0, 0x8);
//start dma
HAL_PLX9656_REG_WRITE_BYTE(plxRegAddr, PLX9656_DMACSR0, 0x3);
I can assure I write these DMA registers correctly.But I don't know I
get these wrong datas.
if anybody know this problem, please tell me . thanks
.
- Prev by Date: Re: xilinx microblaze and picoblaze on a spartan 3e starter kit
- Next by Date: Re: Microcontroller for ENC28J60
- Previous by thread: Microcontroller for ENC28J60
- Next by thread: quieries related to math handling in micro controllers
- Index(es):
Relevant Pages
|