Hi,
a question about synchronization between BSS & DSS, based on chirpAvailable interrupts.
Setup (starting from oob_demo):
> BSS is running continuous mode, adcBuf set to take 4096 ImRe samples at e.g. 20MHz (faster end of sampling, to check everything runs in time)
> MSS configures, then starts BSS running contMode. Uses ISR on MSS chirpAvail to count the blocks of 4096 samples, then stops contMode. This all works perfectly every time, except for one extra chirpAvail, presumable because BSS doesn't stop immediately, so get on more. That's not a problem.
In DSS, I want to do much the same i.e. it is configured, then just waits for chirpAvail interrupts, counting these to know when do do the following processing. This does NOT work....
Interestingly, despite what I'm about tp describe, it does appear to transfer the correct number of samples i.e. clear memory, let it run, and see what is written. The problem is with synchronizing the sampling/EDMA with the further DSS processing.
Setup:
> taking samples into DSS via EDMA - using DPC_OBJDET_DPU_RANGEPROC_EDMAIN_CH, which becomes EDMA_TPCC0_REQ_DFE_CHIRP_AVAIL which is channel 9 (copied from oob_demo). EDMA is event triggered, and uses a callback function. I configure aCount = 4096*ImRe; bCount = number of blocks; cCount = 1; using A synchronization. Presumably I should get ONE completion after bCount has expired.
> ISR on chirpAvail - using SOC_XWR18XX_MSS_CHIRP_AVAIL_IRQ, which is channel 123.
> count number of transfers, then run DSS code. When that completes, the EDMA is re-configured ready for the next event.
When I run the code, it appears that the DSS processing does NOT run ... memory always has samples from adcBuf, not what DSS should write in there (e.g. simple test pattern, so I can see it). However, if I stop at a breakpoint on the DSS ocde, then it certainly IS being called and, in this case, writes the expected pattern to memory.
>> What I think is happening is that DSS is trying to write to (L3) memory, but it can't access it, because the EDMA is still running, and takes priority over memory access. Pausing DSS at the break point gives this time to complete, and so writes to memory as expected.
QUESTION1: does that sound correct?
QUESTION 2; how do I get the EDMA and DSS processing to align i.e. DSS waits for EDMA to complete before it runs?
I have tried counting chirpAvail's in BOTH the DSS chirpAvail ISR AND via the EDMA callback. (I've also tried the "waitForEDMACompletion" routine from oob_demo)
>> If I modify the code so that no DSS processing takes place, all I do is count how many times the ISR and EDMA callback are called (i.e. simply increments & saves a counter - no other code, exactly the same as how I count chirpAvails in MSS ISR) - I'd expect to see exactly what I do in MSS. However, I get much larger numbers - say I config for 5 blocks of 4096 samples. This DOES transfer that may samples into L3, but the ISR runs about 100 times, and the callBack about 500!
Evidently I'm not using the ISR/callBack correctly, in some way. Either this is just the wrong way to do things, or I need to be clearing something inside the ISR/CallBack?
many thanks
Alan Milne