Post Go back to editing

CCES incorrect data values found while debugging

Hello

I have been having great difficulty getting the Sport DMA driver working on my custom ADSP‑21565 DSP board to drive two external 16 bit serial DACs and two two external 16 bit serial ADCs. I have previously developed similar DMA functionality on previous Analog Device Sharc processors without problem, however this is the first time I have used the Analog Device drivers (I previously implemented my own register based DMA drivers in C++).

I have so far managed to only output just a few DAC frames (as observed on a scope), however these streams are not working reliably and stop after just a few. My aim is to output a continuous stream in ping-pong fashion, however I have found that the stream stops before getting to the end of the first “ping” buffer.

I have been investigating the workings of the AD drivers Using the CCES debugger and I have found some very strange behaviour which I would be grateful for help on, examples of which I will outline here:

Having opened a Sport port using “adi_sport_Open()” (in file adi_sport_2146x.cpp), I then set up the Data format using “adi_sport_ConfigData()” with parameters of particular interest here being nWordLength=15 and bEnablePack=false. Now single stepping the debugger down to line 2057 (pDevice->eDmaMSize), i.e.

else

{

pDevice->eDmaMSize = ADI_DMA_MSIZE_2BYTES;

pDevice->eDmaPSize = ADI_DMA_PSIZE_2BYTES;

}

Before stepping over this line, pDevice->eDmaMSize is found to hold the value “ADI_DMA_MSIZE_1BYTE” (i.e. a numeric value of 0x00000000), and pDevice-eDmaPSize a value of ADI_DMA_PSIZE_4BYTES (i.e. a numeric value of 0x00000020).

Now stepping over these two lines I find that pDevice->eDmaMSize fails to change and its value is left as ADI_DMA_MSIZE_1BYTE, however pDevice-eDmaPSize does infact change to ADI_DMA_PSIZE_2BYTES as expected.

Moving on now to arming the DMA mechanism by calling adi_sport_DMATransfer() with a parameter of interest here being ePDMAMode=ADI_PDMA_DESCRIPTOR_LIST (Value 0x0000000).

Now single stepping down to line 654, i.e.

PDMAConfig = (uint32_t)pDevice->eDmaPSize | (uint32_t)pDevice->eDmaMSize | (uint32_t)ePDMAMode | (uint32_t)pDevi;


Here I find that the parameters on this line have values as follows (with numeric values found by viewing the cast (uint32_t) value directly:

pDevice->eDmaPSize= ADI_DMA_PSIZE_2BYTES (Value 0x00000010)
pDevice->eDmaMSize= ADI_DMA_MSIZE_1BYTE (Value 0x00000000)
ePDMAMode= ADI_PDMA_STOP_MODE (Value 0x00000000)
pDevice->eDirection= ADI_SPORT_DIR_TX (Value 0x00000000)

So pDevice->eDmaMSize is the wrong value as before, and ePDMAMode is not the value passed to adi_sport_DMATransfer() (this should be ADI_PDMA_DESCRIPTOR_LIST).

Now stepping over this line I see that the value of PDMAConfig changes from 0x00000000 to 0x00004110, which by my reckoning should actually be 0x00000010, i.e...

0x00000010= 0x00000010 | 0x00000000 | 0x00000000 | 0x00000000;

Strangely, I note however that the PDMAConfig value of 0x00004110 is in fact what I would have expected if all the other values above had been correct, i.e...

0x00004110= 0x00000100 | 0x00000010 | 0x00004000 | 0x00000000;

As you may gather, I am at a bit of a loss to know what is going on here - any help would be appreciated. I’ll just point out that I have now completed other parts of the firmware on this DSP (including a serial port driver with DMA for both Tx and Rx) which all seem to be working correctly.

Many thanks