Part Number: AM3358
Hello!
I am using an Octavo Systems OSD3358 part which contains an AM3358 processor inside. This processor is connected to a FPGA which is streaming 24-bit analogue samples from four ADCs at a variable rate. I have chosen to use the McASP peripheral in burst mode using the frame sync (AFSR) signal to indicate the start of a transfer. This is not an audio project but I am treating the streaming data from my ADCs as if they were audio samples. The FPGA is the ACLKR master and there is no AHCLKR signal; the four ADC channels are connected to AXR0 thru AXR3.
After reading the McASP section in SPRUH73P many times and using the Linux and TI-RTOS code bases as a guide I have managed to get data to be transferred and read by the processor using by own code. The code is running on Linux but I am not using any of the McASP drivers or ALSA code, moreover I am using /dev/mem to access the register space directly in my software.
For testing I am only using one AXR channel, the others have been set to inactive. My software polls the RDATA flag in the RSTAT register in a loop and when it is set I make a read from the McASP data memory area (0x46000000 according to the memory map in SPRUH73P). However it seems that I have to make two reads from this address in order for the RDATA flag to be cleared. The first word does contain the ADC sample as expected but the second read always comes back as zero. As the example driver code in Linux and the SDK use DMA transfers I don't have a reference to compare to so I'm uneasy that I've just coded a fix to an issue I don't understand.
From SPRUH73P, section 22.3.10.1.2 Transfers Through the Data Port (DAT) page 4683:
Similarly, for receive operations through the data port, the DMA/CPU should read from the same RBUF
data port address to service all of the active receive serializers. In addition, reads from the active receive
serializers through the data port return data in incremental (although not necessarily consecutive) order.
For example, if serializers 1, 2, and 3, are set up as active receivers, the DMA/CPU should read from the
RBUF data port address four times to obtain data for serializers 1, 2, and 3, in this exact order, upon each
receive data ready event.
This text suggests to make four reads for three serialisers but doesn't explain why.
One extra point is that I cannot seem to make use of the RBUF_0 register even if the McASP is configured to use the CFG port and not the DAT port; it always returns 0.
In summary, please can you answer why I have to make two reads instead of one and why I cannot use the RBUF_0 register in my code.
Thank you,
Simon