Other Parts Discussed in Thread: AUDK2G
Tool/software: TI-RTOS
I downloaded CCS and PDK and installed in the default directories:
C:\ti\bios_6_46_01_38
C:\ti\ccsv6\ [CCS Version: 6.1.3.00034]
C:\ti\edma3_lld_2_12_02_26
C:\ti\pdk_k2g_1_0_4
C:\ti\processor_sdk_rtos_k2g_3_02_00_05
C:\ti\xdctools_3_32_01_22_core
The example code, MCASP_Audio_evmK2G_armExampleProject, delivered for McASP driver is using McASP2 single TX/RX port. It utilizes APIs in the following orders
Edma3init(.) // Not an API but call two EDMA3 APIs: EDMA3_DRV_create(.) and EDMA3_DRV_open(.)
mcaspBindDev(.)
mcaspCreateChan(.) // call EDMA3 API: EDMA3_DRV_requestChannel(.)
mcaspSubmitChan(.) // call EDMA3_DRV_linkChannel(.) and EDMA3_DRV_enableTransfer(.)
I was able to get the audio loopback with on-board AIC31 codec when running the example code on EVMK2G board. But the example is different from my case. Since I need to support more than 6 ports I use McASP0 instead of McASP2.
Q1: I would like to know how to utilize the McASP APIs to configure a circular buffer in PaRAM for EDMA3 to support total 8 McASP0 AXR ports [McASP0_AXR0:AXR7] for MCASP_READ.
Refer to the Technical Reference Manual, spruhy8e, 10.4.4.3 the PaRam configuration for EDMA peripheral servicing in continuous operation. Correct me if I am wrong. I think the order of EDMA3 APIs would be the following:
EDMA3_DRV_requestChannel (hEdma, &ChId1, NULL, 1, NULL, NULL);
EDMA3_DRV_requestChannel (hEdma, &ChId2, NULL, 1, NULL, NULL);
EDMA3_DRV_setPaRAM(hEdma, chId1, ¶mSet1);
EDMA3_DRV_setPaRAM(hEdma, chId2, ¶mSet2);
EDMA3_DRV_linkChannel (hEdma, ChId1, ChId2);
// paramSet1 and paramSet2 are the same except the Link Address of paramSet1 points to paramSet2. The Link Address of paramSet2 points to paramSet2 itself.
EDMA3_DRV_enableTransfer (hEdma, chId1, EDMA3_DRV_TRIG_MODE_EVENT)
But the EDMA3_DRV_requestChannel(.) and EDMA3_DRV_linkChannel(.) are separated in McASP APIs: mcaspCreateChan(.) and mcaspSubmitChan(.). The EDMA3_DRV_linkChannel(.) and EDMA3_DRV_enableTransfer(.) are in the same API mcaspSubmitChan(.). Can I change the Link Address of paramSet1 after EDMA3 Transfer is enabled? How to utilize the McASP APIs directly to setup EDMA3 for circular buffering?
I modified EDMA3_RM_InstanceInitConfig sampleInstInitConfig[NUM_EDMA3_INSTANCES][EDMA3_MAX_REGIONS] in C:\ti\edma3_lld_2_12_02_26\packages\ti\sdo\edma3\drv\sample\src\platforms\sample_tci66ak2g02_cfg.c in order to use McASP0. Is there any place I can change to achieve my goal?
Q2: There is an external signal, let’s call it myEvent, neither synchronize to McASP frame-sync nor with a constant period . Whenever myEvent occurs I need to know the index for the last written sample in the circular buffer so I can extract the block of samples from all 8 channels for further process. It seems I need to access PaRAM to read the destination address or the counter to know the write index in circular buffer. But EDMA3 is also updating PaRAM. Is there any way I can get the index of the last written sample from circular buffer? Thanks.